From 4bb062264d9f6b1840d83eae52c53f366d8902ed Mon Sep 17 00:00:00 2001 From: nils Date: Sun, 28 Mar 2010 14:39:13 +0000 Subject: settings are taken instantly. No program restart necessary. git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@287 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'gpgwin.cpp') diff --git a/gpgwin.cpp b/gpgwin.cpp index 5aaa4bc..477f566 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -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(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(); } -- cgit v1.2.3