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 /mainwindow.cpp | |
parent | 8c605f96e2cf0a4f620433423a04a285f2b01e95 (diff) |
working keygen
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r-- | mainwindow.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index e042b7e8..4ba874ca 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2,6 +2,7 @@ #include "ui_mainwindow.h" #include "dialog.h" #include "usersdialog.h" +#include "keygendialog.h" #include "util.h" #include <QClipboard> #include <QInputDialog> @@ -418,10 +419,15 @@ void MainWindow::readyRead(bool finished = false) { } output.replace(QRegExp("<"), "<"); output.replace(QRegExp(">"), ">"); - } - - if (error.size() > 0) { - output = "<font color=\"red\">" + error + "</font><br />" + output; + } else { + qDebug() << process->readAllStandardOutput(); + qDebug() << process->readAllStandardError(); + if (finished && 0 != keygen) { + qDebug() << "Keygen Done"; + keygen->close(); + keygen = 0; + // TODO some sanity checking ! + } } output.replace(QRegExp("((http|https|ftp)\\://[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\\-\\._\\?\\,\\'/\\\\+&%\\$#\\=~])*)"), "<a href=\"\\1\">\\1</a>"); @@ -982,16 +988,16 @@ QStringList MainWindow::getSecretKeys() /** * @brief Dialog::genKey * @param QString batch - * @return status */ -bool MainWindow::genKey(QString batch) +void MainWindow::genKey(QString batch, QDialog *keygenWindow) { + keygen = keygenWindow; ui->statusBar->showMessage(tr("Generating GPG key pair"), 60000); currentAction = GPG_INTERNAL; executeWrapper(gpgExecutable , "--gen-key --no-tty --batch", batch); - process->waitForFinished(600000); // ten minutes enough ? - if (process->exitStatus() != QProcess::NormalExit) { - return true; - } - return false; +// process->waitForFinished(600000); // ten minutes enough ? +// if (process->exitStatus() != QProcess::NormalExit) { +// return true; +// } +// return false; } |