]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #7099: Fix bug #7099: Math toolbars don't autoshow.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 3 Jan 2011 16:49:15 +0000 (16:49 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 3 Jan 2011 16:49:15 +0000 (16:49 +0000)
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: r37075 and r37076.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37077 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index 5dbdde30a7ebc7260cb7047396caa6f3db84cb43..aeee76829eddc610e29231580d1b81de5e766170 100644 (file)
@@ -631,6 +631,19 @@ void GuiView::saveLayout() const
 }
 
 
+void GuiView::saveUISettings() const
+{
+       // Save 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();
+}
+
+
 bool GuiView::restoreLayout()
 {
        QSettings settings;
@@ -862,16 +875,8 @@ void GuiView::closeEvent(QCloseEvent * close_event)
        // 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();
@@ -3726,6 +3731,7 @@ void GuiView::resetDialogs()
        // Make sure that no LFUN uses any GuiView.
        guiApp->setCurrentView(0);
        saveLayout();
+       saveUISettings();
        menuBar()->clear();
        constructToolbars();
        guiApp->menus().fillMenuBar(menuBar(), this, false);
index d2d2f5214e0de08c5c13e44a72515f9ed2291e56..be1e782442ca303089ddd3dbfc3a4c75d75fb7b3 100644 (file)
@@ -336,8 +336,10 @@ public:
        void disconnectDialog(std::string const & name);
 
 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();
        ///