diff options
author | Amit Chaudhuri <amit.k.chaudhuri@gmail.com> | 2013-04-27 10:09:57 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-04-27 20:44:36 -0700 |
commit | 89f02c42aa2fb49a811cb6e31dd40cd56dee0cf9 (patch) | |
tree | 6b4dd4cc75dd4a1319e19380bc0c8141b36b0907 /qt-ui/mainwindow.h | |
parent | 1d0d42f861fc3a658eb22b99ba58616d716e095e (diff) | |
download | subsurface-89f02c42aa2fb49a811cb6e31dd40cd56dee0cf9.tar.gz |
Add support for remembering settings
Use QSettings to provide persistent storage of settings. For example, we
store and restore the size of the MainWindow.
We use the organisation name hohndel.org and keep subsurface as the
application name.
A section is specified for things to do with the MainWindow; other
sections could be added e.g. for preferred units?
Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.h')
-rw-r--r-- | qt-ui/mainwindow.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index fdb100c7a..eece91ade 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -66,12 +66,17 @@ private Q_SLOTS: void on_actionAboutSubsurface_triggered(); void on_actionUserManual_triggered(); +protected: + void closeEvent(QCloseEvent *); + private: Ui::MainWindow *ui; DiveTripModel *model; QSortFilterProxyModel *sortModel; QString filter(); bool askSaveChanges(); + void readSettings(); + void writeSettings(); }; |