diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-15 22:09:03 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-01-15 22:09:03 +0000 |
commit | ecd73365728f03123cb2b412ae11d49610b4a12f (patch) | |
tree | f5e52465f5e09bb6790f89c30e2930db8c32afbd /wizard.cpp | |
parent | restart app after loading old qgq4usb config (diff) | |
download | gpg4usb-ecd73365728f03123cb2b412ae11d49610b4a12f.tar.gz gpg4usb-ecd73365728f03123cb2b412ae11d49610b4a12f.zip |
reopen wizard on specified page after restart
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@743 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'wizard.cpp')
-rw-r--r-- | wizard.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
@@ -41,6 +41,37 @@ Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) setWizardStyle(ModernStyle); #endif setWindowTitle(tr("First Start Wizard")); + + QSettings settings; + setStartId(settings.value("wizard/page", -1).toInt()); + settings.remove("wizard/page"); + +} + +LanguagePage::LanguagePage(QWidget *parent) + : QWizardPage(parent){ + + setTitle(tr("Choose Language")); + setPixmap(QWizard::WatermarkPixmap, QPixmap(":/logo-flipped.png")); + + QVBoxLayout *layout = new QVBoxLayout; + + topLabel = new QLabel(tr("Choose a Language")); + topLabel->setWordWrap(true); + layout->addWidget(topLabel); + + QHash<QString, QString> languages = SettingsDialog::listLanguages(); + foreach(QString l, languages) { + qDebug() << l; + } + + + setLayout(layout); +} + +int LanguagePage::nextId() const +{ + return 1; } IntroPage::IntroPage(QWidget *parent) @@ -217,17 +248,19 @@ bool ImportPage::importKeysFromGpg4usb() mKeyMgmt->importKeys(inBuffer); } + // TODO: edit->maybesave? qApp->exit(RESTART_CODE); + QSettings settings; + //settings.setValue("wizard/page", this->wizard()->currentId()); + settings.setValue("wizard/page", this->nextId()); return true; } bool ImportPage::importConfFromGpg4usb(QString dir) { QString path = dir+"/conf/gpg4usb.ini"; - qDebug() << "import old conf from: " << path; QSettings oldconf(path, QSettings::IniFormat, this); QSettings actualConf; foreach(QString key, oldconf.allKeys()) { - qDebug() << key << ": " << oldconf.value(key); actualConf.setValue(key, oldconf.value(key)); } |