aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-01-18 21:57:33 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-01-18 21:57:33 +0000
commit04822ac44a8c45e9d4ff1e8205d4482bd5d1afb7 (patch)
treec6e18e3f7b06200d4cc7e34e1ad600ea76641b62
parentinstantly apply language selection in wizard (diff)
downloadgpg4usb-04822ac44a8c45e9d4ff1e8205d4482bd5d1afb7.tar.gz
gpg4usb-04822ac44a8c45e9d4ff1e8205d4482bd5d1afb7.zip
save 'showWizard' to settings on finishing wizard
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@753 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--wizard.cpp19
-rw-r--r--wizard.h3
2 files changed, 14 insertions, 8 deletions
diff --git a/wizard.cpp b/wizard.cpp
index fa255d6..18d8a07 100644
--- a/wizard.cpp
+++ b/wizard.cpp
@@ -41,6 +41,15 @@ Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
QSettings settings;
setStartId(settings.value("wizard/page", -1).toInt());
settings.remove("wizard/page");
+
+ connect(this, SIGNAL(accepted()), this, SLOT(wizardAccepted()));
+
+}
+
+void Wizard::wizardAccepted() {
+ qDebug() << "noShow: " << field("showWizard").toBool();
+ QSettings settings;
+ settings.setValue("wizard/showWizard", field("showWizard").toBool());
}
IntroPage::IntroPage(QWidget *parent)
@@ -328,6 +337,8 @@ ConclusionPage::ConclusionPage(QWidget *parent)
dontShowWizardCheckBox = new QCheckBox(tr("Dont show the wizard again."));
dontShowWizardCheckBox->setChecked(Qt::Checked);
+ registerField("showWizard", dontShowWizardCheckBox);
+
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(bottomLabel);
layout->addWidget(dontShowWizardCheckBox);
@@ -337,13 +348,5 @@ ConclusionPage::ConclusionPage(QWidget *parent)
int ConclusionPage::nextId() const
{
- QSettings settings;
- qDebug() << "dont show" << dontShowWizardCheckBox->isChecked();
- if (dontShowWizardCheckBox->isChecked())
- {
- settings.setValue("wizard/showWizard", false);
- } else {
- settings.setValue("wizard/showWizard", true);
- }
return -1;
}
diff --git a/wizard.h b/wizard.h
index bd76ff6..c4a8398 100644
--- a/wizard.h
+++ b/wizard.h
@@ -47,6 +47,9 @@ public:
private:
GpgME::GpgContext *mCtx;
KeyMgmt *mKeyMgmt;
+
+private slots:
+ void wizardAccepted();
};
class IntroPage : public QWizardPage