diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-18 21:57:33 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-18 21:57:33 +0000 |
commit | 04822ac44a8c45e9d4ff1e8205d4482bd5d1afb7 (patch) | |
tree | c6e18e3f7b06200d4cc7e34e1ad600ea76641b62 | |
parent | instantly apply language selection in wizard (diff) | |
download | gpg4usb-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.cpp | 19 | ||||
-rw-r--r-- | wizard.h | 3 |
2 files changed, 14 insertions, 8 deletions
@@ -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; } @@ -47,6 +47,9 @@ public: private: GpgME::GpgContext *mCtx; KeyMgmt *mKeyMgmt; + +private slots: + void wizardAccepted(); }; class IntroPage : public QWizardPage |