aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO8
-rw-r--r--mainwindow.cpp1
-rw-r--r--wizard.cpp127
-rw-r--r--wizard.h8
4 files changed, 59 insertions, 85 deletions
diff --git a/TODO b/TODO
index 808980d..9466bfd 100644
--- a/TODO
+++ b/TODO
@@ -24,6 +24,14 @@ Release 0.3.2
- if import failed, because no key was found [DONE]
- if key is already in keyring [DONE]
- BUG: Also show details, when key is really new [DONE]
+<<<<<<< HEAD
+=======
+- Wizard on first start (Create Key, Import from keys older gpg4usb, import from gnupg) [DONE]
+ - import conf from old gpg4usb
+ - only show one import dateil dialog, when importing public/private keys
+ - always activate next button
+ - nextid is not called when clicking finish button
+>>>>>>> a rough new configuration of wizard. Pages are in right order
- option in settingsdialog for enabling steganographic operations [DONE]
- minimal steganography option: remove or add pgp-headers on demand [DONE]
- Add advanced tab to settings dialog [DONE]
diff --git a/mainwindow.cpp b/mainwindow.cpp
index d951454..9460df5 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -76,6 +76,7 @@ MainWindow::MainWindow()
// and keylist doesn't contain a private key
QSettings settings;
//if (settings.value("wizard/showWizard",true).toBool() && !mKeyList->containsPrivateKeys()) {
+
if (settings.value("wizard/showWizard",true).toBool() || !settings.value("wizard/next").isNull()) {
startWizard();
}
diff --git a/wizard.cpp b/wizard.cpp
index bea9292..2a12f78 100644
--- a/wizard.cpp
+++ b/wizard.cpp
@@ -49,12 +49,11 @@ IntroPage::IntroPage(QWidget *parent)
setTitle(tr("Introduction"));
setPixmap(QWizard::WatermarkPixmap, QPixmap(":/logo-flipped.png"));
- topLabel = new QLabel(tr("This wizard will help you getting started with encrypting "
- "and decrypting or to import keys from an older version of "
- "gpg4usb or an existing installation of Gnupg."));
+ 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."));
topLabel->setWordWrap(true);
-
// QComboBox for language selection
langLabel = new QLabel(tr("Choose a Language"));
langLabel->setWordWrap(true);
@@ -85,27 +84,27 @@ ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *ke
mKeyMgmt=keyMgmt;
setTitle(tr("Keyring Import"));
- QGroupBox *gpg4usbBox = new QGroupBox(tr("Import from older gpg4usb"), this);
+ QGroupBox *gpg4usbBox = new QGroupBox(tr("Import keys and/or settings from older gpg4usb"), this);
QGridLayout *gpg4usbLayout = new QGridLayout();
QLabel *gnupgLabel = new QLabel(tr("Point to the folder of last gpg4usb"));
- gpg4usbLayout->addWidget(gnupgLabel,1,1,1,2);
+ gpg4usbLayout->addWidget(gnupgLabel,1,3);
- gpg4usbPrivKeyCheckBox = new QCheckBox();
- gpg4usbPrivKeyCheckBox->setChecked(true);
- gpg4usbLayout->addWidget(gpg4usbPrivKeyCheckBox,2,1,Qt::AlignRight);
- QLabel *privateKeyLabel2 = new QLabel(tr("Private Keys"));
+ gpg4usbKeyCheckBox = new QCheckBox();
+ gpg4usbKeyCheckBox->setChecked(true);
+ gpg4usbLayout->addWidget(gpg4usbKeyCheckBox,2,1,Qt::AlignRight);
+ QLabel *privateKeyLabel2 = new QLabel(tr("Keys"));
gpg4usbLayout->addWidget(privateKeyLabel2,2,2);
- gpg4usbPubKeyCheckBox = new QCheckBox();
- gpg4usbPubKeyCheckBox->setChecked(true);
- gpg4usbLayout->addWidget(gpg4usbPubKeyCheckBox,3,1,Qt::AlignRight);
- QLabel *gpg4usbLabel = new QLabel(tr("Public Keys"));
+ gpg4usbConfigCheckBox = new QCheckBox();
+ gpg4usbConfigCheckBox->setChecked(true);
+ gpg4usbLayout->addWidget(gpg4usbConfigCheckBox,3,1,Qt::AlignRight);
+ QLabel *gpg4usbLabel = new QLabel(tr("Configuration"));
gpg4usbLayout->addWidget(gpg4usbLabel,3,2);
QWidget *importFromGpg4usbButtonBox = new QWidget(this);
QHBoxLayout *importFromGpg4usbButtonBoxLayout = new QHBoxLayout(importFromGpg4usbButtonBox);
- importFromGpg4usbButton = new QPushButton(tr("Import keys from gpg4usb"));
+ importFromGpg4usbButton = new QPushButton(tr("Import from older gpg4usb"));
connect(importFromGpg4usbButton, SIGNAL(clicked()), this, SLOT(importKeysFromGpg4usb()));
importFromGpg4usbButtonBox->setLayout(importFromGpg4usbButtonBoxLayout);
gpg4usbLayout->addWidget(importFromGpg4usbButton,2,3);
@@ -132,31 +131,12 @@ bool ImportFromGpg4usbPage::importKeysFromGpg4usb()
QFile secRing(dir+"/keydb/secring.gpg");
QFile pubRing(dir+"/keydb/pubring.gpg");
- qDebug() << pubRing.fileName();
// Return, if no keyrings are found in subdir of chosen dir
if (!(pubRing.exists() or secRing.exists())) {
QMessageBox::critical(0, tr("Import Error"), tr("Couldn't locate any keyring file in choosen directory"));
return false;
}
-/* if (pubRing.exists() and gnupgpPubKeyCheckBox->isChecked()) {
- if (!pubRing.open(QIODevice::ReadOnly)) {
- QMessageBox::critical(0, tr("Import error"), tr("Couldn't open public keyringfile: ") + pubRing.fileName());
- return false;
- }
- QByteArray inBuffer = pubRing.readAll();
- mKeyMgmt->importKeys(inBuffer);
- }
-
- if (secRing.exists() and gnupgPrivKeyCheckBox->isChecked()) {
- if (!secRing.open(QIODevice::ReadOnly)) {
- QMessageBox::critical(0, tr("Import error"), tr("Couldn't open private keyringfile: ") + secRing.fileName());
- return false;
- }
- QByteArray inBuffer = secRing.readAll();
- mKeyMgmt->importKeys(inBuffer);
- }
-*/
QSettings settings;
//settings.setValue("wizard/page", this->wizard()->currentId());
settings.setValue("wizard/page", this->nextId());
@@ -191,28 +171,15 @@ ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgm
QGroupBox *gnupgBox = new QGroupBox(tr("Import from GnuPG"), this);
QGridLayout *gnupgLayout = new QGridLayout();
- gnupgLabel = new QLabel(tr("Should I try to import keys from GnuPG?"));
- gnupgLayout->addWidget(gnupgLabel,1,1,1,2);
-
- gnupgPrivKeyCheckBox = new QCheckBox();
- gnupgPrivKeyCheckBox->setChecked(true);
- gnupgLayout->addWidget(gnupgPrivKeyCheckBox,2,1,Qt::AlignRight);
- QLabel *privateKeyLabel = new QLabel(tr("Private Keys"));
- gnupgLayout->addWidget(privateKeyLabel,2,2);
-
- gnupgpPubKeyCheckBox = new QCheckBox();
- gnupgpPubKeyCheckBox->setChecked(true);
- gnupgLayout->addWidget(gnupgpPubKeyCheckBox,3,1,Qt::AlignRight);
- QLabel *gnupgPrivKeyLabel = new QLabel(tr("Public Keys"));
- gnupgLayout->addWidget(gnupgPrivKeyLabel,3,2);
-
+ gnupgLabel = new QLabel(tr("Should I try to import keys from a locally installed GnuPG?"));
+ gnupgLayout->addWidget(gnupgLabel,1,1);
QWidget *importFromGnupgButtonBox = new QWidget(this);
QHBoxLayout *importFromGnupgButtonBoxLayout = new QHBoxLayout(importFromGnupgButtonBox);
importFromGnupgButton = new QPushButton(tr("Import keys from GnuPG"));
connect(importFromGnupgButton, SIGNAL(clicked()), this, SLOT(importKeysFromGnupg()));
importFromGnupgButtonBox->setLayout(importFromGnupgButtonBoxLayout);
- gnupgLayout->addWidget(importFromGnupgButton,2,3);
+ gnupgLayout->addWidget(importFromGnupgButton,2,1);
gnupgBox->setLayout(gnupgLayout);
@@ -231,33 +198,30 @@ bool ImportFromGnupgPage::importKeysFromGnupg()
return false;
}
- // try to import private files, if private key checkbox is checked
- if (gnupgPrivKeyCheckBox->isChecked()) {
- QString privRingFile = gnuPGHome+"/secring.gpg";
- QFile file;
- file.setFileName(privRingFile);
- if (!file.open(QIODevice::ReadOnly)) {
- QMessageBox::critical(0, tr("Import error"), tr("Couldn't open private keyringfile: ") + privRingFile);
- return false;
- }
- QByteArray inBuffer = file.readAll();
-
- mKeyMgmt->importKeys(inBuffer);
+ // try to import private files
+ QString privRingFile = gnuPGHome+"/secring.gpg";
+ QFile file;
+ file.setFileName(privRingFile);
+ if (!file.open(QIODevice::ReadOnly)) {
+ QMessageBox::critical(0, tr("Import error"), tr("Couldn't open private keyringfile: ") + privRingFile);
+ return false;
}
-
- // try to import public keys, if public checkbox is checked
- if (gnupgpPubKeyCheckBox->isChecked()) {
- QString pubRingFile = gnuPGHome+"/pubring.gpg";
- QFile file;
- file.setFileName(pubRingFile);
- if (!file.open(QIODevice::ReadOnly)) {
- QMessageBox::critical(0, tr("Import error"), tr("Couldn't open public keyringfile: ") + pubRingFile);
- return false;
- }
- QByteArray inBuffer = file.readAll();
-
- mKeyMgmt->importKeys(inBuffer);
+ QByteArray inBuffer = file.readAll();
+ mKeyMgmt->importKeys(inBuffer);
+ inBuffer.clear();
+ file.close();
+
+ // try to import public keys
+ QString pubRingFile = gnuPGHome+"/pubring.gpg";
+ file.setFileName(pubRingFile);
+ if (!file.open(QIODevice::ReadOnly)) {
+ QMessageBox::critical(0, tr("Import error"), tr("Couldn't open public keyringfile: ") + pubRingFile);
+ return false;
}
+ inBuffer = file.readAll();
+ mKeyMgmt->importKeys(inBuffer);
+ inBuffer.clear();
+ file.close();
return true;
}
@@ -344,22 +308,25 @@ ConclusionPage::ConclusionPage(QWidget *parent)
bottomLabel = new QLabel(tr("You're ready to encrypt and decrpt now."));
bottomLabel->setWordWrap(true);
- showWizardCheckBox = new QCheckBox(tr("Dont show the wizard again."));
- showWizardCheckBox->setChecked(Qt::Checked);
+ dontShowWizardCheckBox = new QCheckBox(tr("Dont show the wizard again."));
+ dontShowWizardCheckBox->setChecked(Qt::Checked);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(bottomLabel);
- layout->addWidget(showWizardCheckBox);
+ layout->addWidget(dontShowWizardCheckBox);
setLayout(layout);
setVisible(true);
}
int ConclusionPage::nextId() const
{
- if (showWizardCheckBox->isChecked())
+ QSettings settings;
+ qDebug() << "dont show" << dontShowWizardCheckBox->isChecked();
+ if (dontShowWizardCheckBox->isChecked())
{
- QSettings settings;
settings.setValue("wizard/showWizard", false);
+ } else {
+ settings.setValue("wizard/showWizard", true);
}
return -1;
}
diff --git a/wizard.h b/wizard.h
index 09ceb25..e04cdde 100644
--- a/wizard.h
+++ b/wizard.h
@@ -80,8 +80,8 @@ private:
KeyMgmt *mKeyMgmt;
QVBoxLayout *layout;
GpgME::GpgContext *mCtx;
- QCheckBox *gpg4usbPrivKeyCheckBox;
- QCheckBox *gpg4usbPubKeyCheckBox;
+ QCheckBox *gpg4usbKeyCheckBox;
+ QCheckBox *gpg4usbConfigCheckBox;
QPushButton *importFromGpg4usbButton;
};
@@ -112,8 +112,6 @@ private:
QLabel *gnupgLabel;
QVBoxLayout *layout;
GpgME::GpgContext *mCtx;
- QCheckBox *gnupgPrivKeyCheckBox;
- QCheckBox *gnupgpPubKeyCheckBox;
QPushButton *importFromGnupgButton;
};
@@ -146,7 +144,7 @@ public:
private:
QLabel *bottomLabel;
- QCheckBox *showWizardCheckBox;
+ QCheckBox *dontShowWizardCheckBox;
};
#endif