Author: vfr
Date: Mon Jan 3 18:07:21 2011
New Revision: 37078
URL: http://www.lyx.org/trac/changeset/37078
Log:
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.
Modified:
lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp
lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.h
Modified: lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp Mon Jan
3 17:49:15 2011 (r37077)
+++ lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.cpp Mon Jan
3 18:07:21 2011 (r37078)
@@ -368,6 +368,18 @@
}
+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()
{
QSettings settings;
@@ -554,16 +566,8 @@
// Saving fullscreen requires additional tweaks in the toolbar code.
// It wouldn't also work under linux natively.
if (lyxrc.allow_geometry_session) {
- // Save this window geometry and layout.
saveLayout();
- // Then the toolbar private states.
- 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();
+ saveUISettings();
}
close_event->accept();
@@ -2470,6 +2474,7 @@
// Make sure that no LFUN uses any LyXView.
theLyXFunc().setLyXView(0);
saveLayout();
+ saveUISettings();
menuBar()->clear();
constructToolbars();
guiApp->menus().fillMenuBar(menuBar(), this, false);
Modified: lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.h
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.h Mon Jan 3
17:49:15 2011 (r37077)
+++ lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiView.h Mon Jan 3
18:07:21 2011 (r37078)
@@ -248,8 +248,10 @@
void updateCompletion(Cursor & cur, bool start, bool keep);
private:
- ///
+ /// Saves the layout and geometry of the window
void saveLayout() const;
+ /// Saves the settings of toolbars and all dialogs
+ void saveUISettings() const;
///
bool restoreLayout();
///