mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 16:50:39 +00:00
branch: Fix bug #7099: Math toolbars don't autoshow.
When applying the preference we need to save the full session information, because when this information is not yet saved, we will lose it forever. We can enter the preferences without a saved state when we start LyX with a modified default.ui. see also: r37077, r37075 and r37076. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@37078 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7c588c5b2d
commit
9e4a5c8940
@ -368,6 +368,18 @@ void GuiView::saveLayout() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiView::saveUISettings() const
|
||||||
|
{
|
||||||
|
ToolbarMap::iterator end = d.toolbars_.end();
|
||||||
|
for (ToolbarMap::iterator it = d.toolbars_.begin(); it != end; ++it)
|
||||||
|
it->second->saveSession();
|
||||||
|
// Now take care of all other dialogs:
|
||||||
|
map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
|
||||||
|
for (; it!= d.dialogs_.end(); ++it)
|
||||||
|
it->second->saveSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiView::restoreLayout()
|
bool GuiView::restoreLayout()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
@ -554,16 +566,8 @@ void GuiView::closeEvent(QCloseEvent * close_event)
|
|||||||
// Saving fullscreen requires additional tweaks in the toolbar code.
|
// Saving fullscreen requires additional tweaks in the toolbar code.
|
||||||
// It wouldn't also work under linux natively.
|
// It wouldn't also work under linux natively.
|
||||||
if (lyxrc.allow_geometry_session) {
|
if (lyxrc.allow_geometry_session) {
|
||||||
// Save this window geometry and layout.
|
|
||||||
saveLayout();
|
saveLayout();
|
||||||
// Then the toolbar private states.
|
saveUISettings();
|
||||||
ToolbarMap::iterator end = d.toolbars_.end();
|
|
||||||
for (ToolbarMap::iterator it = d.toolbars_.begin(); it != end; ++it)
|
|
||||||
it->second->saveSession();
|
|
||||||
// Now take care of all other dialogs:
|
|
||||||
map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
|
|
||||||
for (; it!= d.dialogs_.end(); ++it)
|
|
||||||
it->second->saveSession();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close_event->accept();
|
close_event->accept();
|
||||||
@ -2470,6 +2474,7 @@ void GuiView::resetDialogs()
|
|||||||
// Make sure that no LFUN uses any LyXView.
|
// Make sure that no LFUN uses any LyXView.
|
||||||
theLyXFunc().setLyXView(0);
|
theLyXFunc().setLyXView(0);
|
||||||
saveLayout();
|
saveLayout();
|
||||||
|
saveUISettings();
|
||||||
menuBar()->clear();
|
menuBar()->clear();
|
||||||
constructToolbars();
|
constructToolbars();
|
||||||
guiApp->menus().fillMenuBar(menuBar(), this, false);
|
guiApp->menus().fillMenuBar(menuBar(), this, false);
|
||||||
|
@ -248,8 +248,10 @@ public:
|
|||||||
void updateCompletion(Cursor & cur, bool start, bool keep);
|
void updateCompletion(Cursor & cur, bool start, bool keep);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
/// Saves the layout and geometry of the window
|
||||||
void saveLayout() const;
|
void saveLayout() const;
|
||||||
|
/// Saves the settings of toolbars and all dialogs
|
||||||
|
void saveUISettings() const;
|
||||||
///
|
///
|
||||||
bool restoreLayout();
|
bool restoreLayout();
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user