diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-03-28 14:39:13 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-03-28 14:39:13 +0000 |
commit | 4bb062264d9f6b1840d83eae52c53f366d8902ed (patch) | |
tree | 1f119f2704010a2b00befcf69181f94ac80fa307 /gpgwin.cpp | |
parent | icon style settings added and icon settings are also used by key management (diff) | |
download | gpg4usb-4bb062264d9f6b1840d83eae52c53f366d8902ed.tar.gz gpg4usb-4bb062264d9f6b1840d83eae52c53f366d8902ed.zip |
settings are taken instantly. No program restart necessary.
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@287 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgwin.cpp')
-rw-r--r-- | gpgwin.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -54,12 +54,16 @@ GpgWin::GpgWin() createToolBars(); createStatusBar(); createDockWindows(); - setToolButtonStyle(Qt::ToolButtonTextUnderIcon); setCurrentFile(""); mKeyList->addMenuAction(appendSelectedKeysAct); - - // Restore window size & location + restoreSettings(); + +} + +void GpgWin::restoreSettings() +{ + // Restore window size & location // TODO: is this a good idea for a portable app? screen size & resolution may vary QSettings settings; //restoreGeometry(settings.value("window/geometry").toByteArray()); @@ -68,15 +72,14 @@ GpgWin::GpgWin() QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize(); Qt::ToolButtonStyle buttonStyle = static_cast<Qt::ToolButtonStyle>(settings.value("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon).toUInt()); - resize(size); - move(pos); - setIconSize(iconSize); - setToolButtonStyle(buttonStyle); + this->resize(size); + this->move(pos); + this->setIconSize(iconSize); + this->setToolButtonStyle(buttonStyle); // state sets pos & size of dock-widgets - restoreState(settings.value("window/windowState").toByteArray()); + this->restoreState(settings.value("window/windowState").toByteArray()); } - /* void GpgWin::dropEvent(QDropEvent *event) { edit->setPlainText(event->mimeData()->text()); @@ -581,4 +584,5 @@ void GpgWin::fileEncryption() void GpgWin::openSettingsDialog() { new SettingsDialog(); + restoreSettings(); } |