diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 7d845cb8b3..69db61a2a2 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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::const_iterator it = d.dialogs_.begin(); + for (; it!= d.dialogs_.end(); ++it) + it->second->saveSession(); +} + + bool GuiView::restoreLayout() { QSettings settings; @@ -554,16 +566,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::const_iterator it = d.dialogs_.begin(); - for (; it!= d.dialogs_.end(); ++it) - it->second->saveSession(); + saveUISettings(); } close_event->accept(); @@ -2470,6 +2474,7 @@ void GuiView::resetDialogs() // Make sure that no LFUN uses any LyXView. theLyXFunc().setLyXView(0); saveLayout(); + saveUISettings(); menuBar()->clear(); constructToolbars(); guiApp->menus().fillMenuBar(menuBar(), this, false); diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 3366ca3a63..f59af33b1f 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -248,8 +248,10 @@ public: 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(); ///