]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QtView.C
clean up the function renaming cleanup
[lyx.git] / src / frontends / qt4 / QtView.C
index ed8c628ec515e0a59218cfce872f0bef83de0981..03ad639a45a215fee7aa2596d396202756f1f46d 100644 (file)
 
 #include "BufferView.h"
 #include "lyx_cb.h"
+#include "lyxrc.h"
+#include "lyx_main.h"
+#include "session.h"
 #include "lyxfunc.h"
 #include "MenuBackend.h"
+#include "funcrequest.h"
+#include "funcrequest.h"
 
 #include "debug.h"
 
@@ -23,6 +28,7 @@
 
 #include "support/filetools.h"
 
+#include "support/convert.h"
 #include <boost/bind.hpp>
 
 #include "QtView.h"
@@ -51,7 +57,7 @@ FontLoader fontloader;
 namespace lyx {
 
 using support::subst;
-using support::LibFileSearch;
+using support::libFileSearch;
 
 namespace frontend {
 
@@ -87,7 +93,7 @@ QtView::QtView(unsigned int width, unsigned int height)
 #ifndef Q_WS_MACX
        //  assign an icon to main form. We do not do it under Qt/Mac,
        //  since the icon is provided in the application bundle.
-       string const iconname = LibFileSearch("images", "lyx", "xpm");
+       string const iconname = libFileSearch("images", "lyx", "xpm");
        if (!iconname.empty())
                setIcon(QPixmap(toqstr(iconname)));
 #endif
@@ -173,7 +179,16 @@ bool QtView::hasFocus() const
 
 void QtView::closeEvent(QCloseEvent *)
 {
-       QuitLyX(false);
+       // save windows size and position
+       LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
+       LyX::ref().session().saveSessionInfo("WindowHeight", convert<string>(height()));
+       if (lyxrc.geometry_xysaved) {
+               LyX::ref().session().saveSessionInfo("WindowPosX", convert<string>(x()));
+               LyX::ref().session().saveSessionInfo("WindowPosY", convert<string>(y()));
+       }
+       // trigger LFUN_QUIT instead of quit directly
+       // since LFUN_QUIT may have more cleanup stuff
+       getLyXFunc().dispatch(FuncRequest(LFUN_QUIT));
 }