diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-05-26 02:49:51 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2015-05-26 02:49:51 +0200 |
commit | 825c9eb7b546c51fcb6e3c4dee2250a7d15c6208 (patch) | |
tree | 61bdc38512b1d4e897aa8441a6a7b37c3f3562a1 /keygendialog.cpp | |
parent | 8c605f96e2cf0a4f620433423a04a285f2b01e95 (diff) |
working keygen
Diffstat (limited to 'keygendialog.cpp')
-rw-r--r-- | keygendialog.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/keygendialog.cpp b/keygendialog.cpp index 744b80b9..a04ed77d 100644 --- a/keygendialog.cpp +++ b/keygendialog.cpp @@ -69,6 +69,9 @@ void KeygenDialog::replace(QString key, QString value) QStringList lines = expert.split(QRegExp("[\r\n]"),QString::SkipEmptyParts); foreach (QString line, lines) { line.replace(QRegExp(key+":.*"), key + ": " + value); + if (key == "Passphrase") { + line.replace("%no-protection", "Passphrase: " + value); + } clear.append(line); } ui->plainTextEdit->setPlainText(clear.join("\n")); @@ -91,7 +94,6 @@ void KeygenDialog::no_protection(bool enable) } } else { if (line.indexOf("Passphrase") == 0) { - clear.append(line); line = "%no-protection"; } } @@ -116,23 +118,15 @@ void KeygenDialog::done(int r) ui->plainTextEdit->setEnabled(false); // some kind of animation or at-least explanation needed here // people don't like wating :D - bool status = dialog->genKey(ui->plainTextEdit->toPlainText()); - if(status) - { - QDialog::done(r); - return; - } - else - { - QMessageBox::critical(this, tr("GPG gen-key error"), - tr("Something went wrong, I guess")); - ui->widget->setEnabled(true); - ui->buttonBox->setEnabled(true); - ui->checkBox->setEnabled(true); - on_checkBox_stateChanged(ui->checkBox->isChecked()); - // something went wrong, explain things? - return; - } + dialog->genKey(ui->plainTextEdit->toPlainText(), this); +// QMessageBox::critical(this, tr("GPG gen-key error"), +// tr("Something went wrong, I guess")); +// ui->widget->setEnabled(true); +// ui->buttonBox->setEnabled(true); +// ui->checkBox->setEnabled(true); +// on_checkBox_stateChanged(ui->checkBox->isChecked()); +// // something went wrong, explain things? +// return; } else // cancel, close or exc was pressed { |