]> git.lyx.org Git - features.git/commitdiff
* GuiDialog: Initial Window geometry session support. Inheriting class will have...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 27 Sep 2007 14:35:12 +0000 (14:35 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 27 Sep 2007 14:35:12 +0000 (14:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20539 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiDialog.cpp
src/frontends/qt4/GuiDialog.h

index b53877bd9d82e8bdc5370812226af6a3d45d98ad..f2eb9086a4946ca14ab5cd45917549c558b80c73 100644 (file)
 #include "qt_helpers.h"
 #include "frontends/LyXView.h"
 
+#include <QCloseEvent>\r
+#include <QSettings>\r
+#include <QShowEvent>\r
+\r
 using std::string;
 
 namespace lyx {
@@ -237,6 +241,23 @@ void GuiDialog::setController(Controller * controller)
 }
 
 
+void GuiDialog::showEvent(QShowEvent * e)\r
+{\r
+       QSettings settings;\r
+       string key = name_ + "/geometry";\r
+       restoreGeometry(settings.value(key.c_str()).toByteArray());\r
+       QDialog::showEvent(e);\r
+}\r
+\r
+\r
+void GuiDialog::closeEvent(QCloseEvent * e)\r
+{\r
+       QSettings settings;\r
+       string key = name_ + "/geometry";\r
+       settings.setValue(key.c_str(), saveGeometry());\r
+       QDialog::closeEvent(e);\r
+}\r
+
 } // namespace frontend
 } // namespace lyx
 
index 1628efd16a5239585dc1a777821f6b80d606aa10..da51ee924436e9acf092f435ee8c5edb1a324945 100644 (file)
@@ -18,6 +18,9 @@
 #include <QDialog>
 #include <QObject>
 
+class QCloseEvent;
+class QShowEvent;
+
 namespace lyx {
 namespace frontend {
 
@@ -75,7 +78,11 @@ public:
        virtual void applyView() {}
        /// default: do nothing
        virtual void updateContents() {}
-
+       ///
+       void closeEvent(QCloseEvent *);\r
+       ///\r
+       void showEvent(QShowEvent *);\r
+\r
 protected:
        /// Hide the dialog.
        virtual void hideView();