From 00a6151d9d2f974ee44ef7d8772be801090fa3fc Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 4 Feb 2012 19:46:49 +0000 Subject: beautified wizard git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@790 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- wizard.cpp | 120 ++++++++++++++++++++++++++----------------------------------- 1 file changed, 50 insertions(+), 70 deletions(-) (limited to 'wizard.cpp') diff --git a/wizard.cpp b/wizard.cpp index 48c02ab..7bc70d4 100644 --- a/wizard.cpp +++ b/wizard.cpp @@ -103,20 +103,24 @@ bool Wizard::importPubAndSecKeysFromDir(const QString dir, KeyMgmt *keyMgmt) IntroPage::IntroPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr("Introduction")); - setSubTitle(tr("About this wizard.")); - - topLabel = new QLabel(tr("This wizard will help you getting started by importing settings and keys" - "from an older version of gpg4usb, import keys from a locally installed Gnupg or to " - "generate a new key to encrypt and decrypt.")); + setTitle(tr("Getting started...")); + setSubTitle(tr("... with gpg4usb")); + + QLabel *topLabel = new QLabel(tr("To use gpg4usb for decrypting and signing messages, you need a " + "private key. The next page will help you with " + "key generation or import.

" + "For more information have a look at the concepts " + "(by clicking the link, the page will open in the main window).
")); topLabel->setWordWrap(true); + connect(topLabel, SIGNAL(linkActivated(const QString&)), parentWidget()->parentWidget(), SLOT(openHelp(const QString&))); // QComboBox for language selection - langLabel = new QLabel(tr("Choose a Language")); + QLabel *langLabel = new QLabel(tr("Choose a Language")); langLabel->setWordWrap(true); languages = SettingsDialog::listLanguages(); - langSelectBox = new QComboBox(); + QComboBox *langSelectBox = new QComboBox(); + foreach(QString l, languages) { langSelectBox->addItem(l); } @@ -154,56 +158,29 @@ ChoosePage::ChoosePage(QWidget *parent) { setTitle(tr("Choose your action...")); setSubTitle(tr("...by clicking on the apropriate link.")); - QLabel *topLabel = new QLabel(tr("First you've got to create an own keypair.
" - "The pair contains a public and a private key.
" - "Other users can use the public key to encrypt texts for you
" - "and verify texts signed by you.
" - "You can use the private key to decrypt and sign texts.
" - "For more information have a look in the offline tutorial (which then is shown in the main window:")); - - //QGroupBox *keygenBox = new QGroupBox("Create a new Key"); - //QVBoxLayout *keygenBoxLayout = new QVBoxLayout(keygenBox); + QLabel *keygenLabel = new QLabel(tr("If you have never used gpg4usb before and also don't own a gpg key yet you " "may possibly want to ")+"" - +tr("create a private key")+"
"); + +tr("create a new keypair")+"
"); keygenLabel->setWordWrap(true); - //QLabel *keygenLinkLabel = new QLabel(""+tr("create your private key")+"
"); connect(keygenLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(jumpPage(const QString&))); - //keygenBoxLayout->addWidget(keygenLabel); - //keygenBoxLayout->addWidget(keygenLinkLabel); - //QGroupBox *importGpg4usbBox = new QGroupBox("Import gpg4usb"); - //QVBoxLayout *importGpg4usbBoxLayout = new QVBoxLayout(importGpg4usbBox); QLabel *importGpg4usbLabel = new QLabel(tr("If you upgrade from an older version of gpg4usb you may want to ") +"" - +tr("import settings and/or keys from Gpg4usb")+""); + +tr("import settings and/or keys from gpg4usb")+""); importGpg4usbLabel->setWordWrap(true); - //QLabel *importGpg4usbLinkLabel = new QLabel(""+tr("import settings and/or keys from Gpg4usb")+""); connect(importGpg4usbLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(jumpPage(const QString&))); - //importGpg4usbBoxLayout->addWidget(importGpg4usbLabel); - //importGpg4usbBoxLayout->addWidget(importGpg4usbLinkLabel); - //QGroupBox *importGnupgBox = new QGroupBox("import gnupg"); - //QVBoxLayout *importGnupgBoxLayout = new QVBoxLayout(importGnupgBox); - QLabel *importGnupgLabel = new QLabel(tr("If you are already using Gnupg you may want to ") + QLabel *importGnupgLabel = new QLabel(tr("If you are already using GnuPG you may want to ") +"" - +tr("import keys from Gnupg")+"
"); + +tr("import keys from GnuPG")+"
"); importGnupgLabel->setWordWrap(true); - //QLabel *importGnupgLinkLabel = new QLabel(""+tr("import keys from Gnupg")+"
"); connect(importGnupgLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(jumpPage(const QString&))); - //importGnupgBoxLayout->addWidget(importGnupgLabel); - //importGnupgBoxLayout->addWidget(importGnupgLinkLabel); QVBoxLayout *layout = new QVBoxLayout(); - //layout->addWidget(keygenBox); - //layout->addWidget(importGpg4usbBox); - //layout->addWidget(importGnupgBox); layout->addWidget(keygenLabel); -// layout->addWidget(keygenLinkLabel); layout->addWidget(importGnupgLabel); -// layout->addWidget(importGnupgLinkLabel); layout->addWidget(importGpg4usbLabel); -// layout->addWidget(importGpg4usbLinkLabel); setLayout(layout); nextPage=Wizard::Page_Conclusion; } @@ -228,12 +205,12 @@ ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *ke { mCtx=ctx; mKeyMgmt=keyMgmt; - setTitle(tr("Keyring Import")); - setSubTitle("bla"); + setTitle(tr("Import from...")); + setSubTitle(tr("...existing gpg4usb")); - QLabel *topLabel = new QLabel(tr("Import keys and/or settings from older gpg4usb. Just check, what you want to " - "import, click the import button and choose the directory " - "of your old gpg4usb in the appearing file dialog."), this); + QLabel *topLabel = new QLabel(tr("You can import keys and/or settings from existing gpg4usb.

" + "Just check what you want to import, click the import button and choose " + "the directory of your other gpg4usb in the appearing file dialog."), this); topLabel->setWordWrap(true); gpg4usbKeyCheckBox = new QCheckBox(); @@ -244,8 +221,8 @@ ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *ke gpg4usbConfigCheckBox->setChecked(true); QLabel *configLabel = new QLabel(tr("Configuration")); - importFromGpg4usbButton = new QPushButton(tr("Import from older gpg4usb")); - connect(importFromGpg4usbButton, SIGNAL(clicked()), this, SLOT(importFormOlderGpg4usb())); + QPushButton *importFromGpg4usbButton = new QPushButton(tr("Import from gpg4usb")); + connect(importFromGpg4usbButton, SIGNAL(clicked()), this, SLOT(importFromOlderGpg4usb())); QGridLayout *gpg4usbLayout = new QGridLayout(); gpg4usbLayout->addWidget(topLabel,1,1,1,2); @@ -258,9 +235,9 @@ ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *ke this->setLayout(gpg4usbLayout); } -bool ImportFromGpg4usbPage::importFormOlderGpg4usb() +bool ImportFromGpg4usbPage::importFromOlderGpg4usb() { - QString dir = QFileDialog::getExistingDirectory(this,tr("Old gpg4usb directory")); + QString dir = QFileDialog::getExistingDirectory(this,tr("Other gpg4usb directory")); // Return, if cancel was hit if (dir.isEmpty()) { @@ -300,7 +277,7 @@ bool ImportFromGpg4usbPage::importConfFromGpg4usb(QString dir) { int ImportFromGpg4usbPage::nextId() const { - return Wizard::Page_ImportFromGnupg; + return Wizard::Page_Conclusion; } ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) @@ -308,11 +285,11 @@ ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgm { mCtx=ctx; mKeyMgmt=keyMgmt; - setTitle(tr("Key import from Gnupg")); - setSubTitle("bla"); + setTitle(tr("Import keys...")); + setSubTitle(tr("...from existing GnuPG installation")); - QLabel *gnupgLabel = new QLabel(tr("Should I try to import keys from a locally installed GnuPG?
The location is read " - "from registry in Windows and assumed to be the .gnupg folder in the your home directory in Linux")); + QLabel *gnupgLabel = new QLabel(tr("You can import keys from a locally installed GnuPG.

The location is read " + "from registry in Windows or assumed to be the .gnupg folder in the your home directory in Linux.
")); gnupgLabel->setWordWrap(true); importFromGnupgButton = new QPushButton(tr("Import keys from GnuPG")); @@ -369,14 +346,15 @@ KeyGenPage::KeyGenPage(GpgME::GpgContext *ctx, QWidget *parent) //setPixmap(QWizard::WatermarkPixmap, QPixmap(":/logo-flipped.png")); mCtx=ctx; - setTitle(tr("Key-Generating")); - setSubTitle("bla"); - topLabel = new QLabel(tr("First you've got to create an own keypair.
" - "The pair contains a public and a private key.
" - "Other users can use the public key to encrypt texts for you
" - "and verify texts signed by you.
" - "You can use the private key to decrypt and sign texts.
" - "For more information have a look in the offline tutorial (which then is shown in the main window:")); + setTitle(tr("Create a keypair...")); + setSubTitle(tr("...for decrypting and signing messages")); + QLabel *topLabel = new QLabel(tr("You should create an own keypair." + "The pair consists of a public and a private key.
" + "Other users can use the public key to encrypt messages for you " + "and verify messages signed by you." + "You can use the private key to decrypt and sign messages.
" + "For more information have a look at the offline tutorial (which then is shown in the main window):")); + topLabel->setWordWrap(true); QLabel *linkLabel = new QLabel(""+tr("Offline tutorial")+""); //linkLabel->setOpenExternalLinks(true); @@ -384,7 +362,7 @@ KeyGenPage::KeyGenPage(GpgME::GpgContext *ctx, QWidget *parent) QWidget *createKeyButtonBox = new QWidget(this); QHBoxLayout *createKeyButtonBoxLayout = new QHBoxLayout(createKeyButtonBox); - createKeyButton = new QPushButton(tr("Create New Key")); + QPushButton *createKeyButton = new QPushButton(tr("Create New Key")); createKeyButtonBoxLayout->addWidget(createKeyButton); createKeyButtonBoxLayout->addStretch(1); QVBoxLayout *layout = new QVBoxLayout(); @@ -410,25 +388,27 @@ void KeyGenPage::generateKeyDialog() ConclusionPage::ConclusionPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr("Finish Start Wizard")); - setSubTitle("bla"); + setTitle(tr("Ready.")); + setSubTitle(tr("Have fun with gpg4usb!")); - bottomLabel = new QLabel(tr("You're ready to encrypt and decrpt now.")); + QLabel *bottomLabel = new QLabel(tr("You are ready to use gpg4usb now.

" + "The offline help will get you started with gpg4usb. " + "It will open in the main window.
")); bottomLabel->setWordWrap(true); - dontShowWizardCheckBox = new QCheckBox(tr("Dont show the wizard again.")); - dontShowWizardCheckBox->setChecked(Qt::Checked); - openHelpCheckBox = new QCheckBox(tr("Open offline help.")); openHelpCheckBox->setChecked(Qt::Checked); + dontShowWizardCheckBox = new QCheckBox(tr("Dont show the wizard again.")); + dontShowWizardCheckBox->setChecked(Qt::Checked); + registerField("showWizard", dontShowWizardCheckBox); registerField("openHelp", openHelpCheckBox); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(bottomLabel); - layout->addWidget(dontShowWizardCheckBox); layout->addWidget(openHelpCheckBox); + layout->addWidget(dontShowWizardCheckBox); setLayout(layout); setVisible(true); } -- cgit v1.2.3