aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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