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 | |
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
-rw-r--r-- | gpgwin.cpp | 22 | ||||
-rw-r--r-- | gpgwin.h | 1 | ||||
-rwxr-xr-x | keymgmt.cpp | 5 | ||||
-rwxr-xr-x | settingsdialog.h | 2 |
4 files changed, 17 insertions, 13 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(); } @@ -86,6 +86,7 @@ private: void loadFile(const QString &fileName); void setCurrentFile(const QString &fileName); bool maybeSave(); + void restoreSettings(); void preventNoDataErr(QByteArray *in); QString strippedName(const QString &fullFileName); diff --git a/keymgmt.cpp b/keymgmt.cpp index 371b27d..45e23fd 100755 --- a/keymgmt.cpp +++ b/keymgmt.cpp @@ -39,11 +39,12 @@ KeyMgmt::KeyMgmt(GpgME::Context *ctx, QString iconpath) createActions(); createMenus(); createToolBars(); + + /* Restore the iconstyle */ QSettings settings; QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize(); Qt::ToolButtonStyle buttonStyle = static_cast<Qt::ToolButtonStyle>(settings.value("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon).toUInt()); - - setIconSize(iconSize); + setIconSize(iconSize); setToolButtonStyle(buttonStyle); setWindowTitle(tr("Keymanagement")); diff --git a/settingsdialog.h b/settingsdialog.h index a75cfca..255a8e3 100755 --- a/settingsdialog.h +++ b/settingsdialog.h @@ -33,8 +33,6 @@ public: public slots: void applySettings(); - - private: QGroupBox *groupBox1; QGroupBox *groupBox2; |