aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-03-28 14:39:13 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-03-28 14:39:13 +0000
commit4bb062264d9f6b1840d83eae52c53f366d8902ed (patch)
tree1f119f2704010a2b00befcf69181f94ac80fa307
parenticon style settings added and icon settings are also used by key management (diff)
downloadgpg4usb-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.cpp22
-rw-r--r--gpgwin.h1
-rwxr-xr-xkeymgmt.cpp5
-rwxr-xr-xsettingsdialog.h2
4 files changed, 17 insertions, 13 deletions
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<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();
}
diff --git a/gpgwin.h b/gpgwin.h
index 2208760..180a87b 100644
--- a/gpgwin.h
+++ b/gpgwin.h
@@ -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;