aboutsummaryrefslogtreecommitdiffstats
path: root/gpgwin.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-02-07 17:16:29 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-02-07 17:16:29 +0000
commit9f7682c3cd103379af2916ef83e4a24010ae67c4 (patch)
tree455d607b5361bd632d8df957c97d886dfa2b17a3 /gpgwin.cpp
parentupdated TODO (diff)
downloadgpg4usb-9f7682c3cd103379af2916ef83e4a24010ae67c4.tar.gz
gpg4usb-9f7682c3cd103379af2916ef83e4a24010ae67c4.zip
experiment with QSettings, store & restore size and location of mainwindow, save settings to appplication path
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@272 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgwin.cpp')
-rw-r--r--gpgwin.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gpgwin.cpp b/gpgwin.cpp
index 18cffde..4087050 100644
--- a/gpgwin.cpp
+++ b/gpgwin.cpp
@@ -54,6 +54,14 @@ GpgWin::GpgWin()
setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
setIconSize(QSize(32, 32));
setCurrentFile("");
+
+ // Restore window size & location
+ // TODO: is this a good idea for a portable app? screen size & resolution may vary
+ QSettings settings;
+ QPoint pos = settings.value("pos", QPoint(100, 100)).toPoint();
+ QSize size = settings.value("size", QSize(800, 450)).toSize();
+ resize(size);
+ move(pos);
//mKeyList->addMenuAction(deleteSelectedKeysAct);
mKeyList->addMenuAction(appendSelectedKeysAct);
@@ -261,6 +269,10 @@ void GpgWin::closeEvent(QCloseEvent *event)
} else {
event->ignore();
}
+
+ QSettings settings;
+ settings.setValue("pos", pos());
+ settings.setValue("size", size());
}
void GpgWin::open()