diff options
author | Saturneric <[email protected]> | 2021-11-28 07:29:39 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-11-28 07:29:39 +0000 |
commit | c5918a7245b6124916799c0345026ef3ec02265e (patch) | |
tree | fa4ba76fc21570f88cd7c94f28f4a0d54e7051ca /src/ui/keygen/KeygenDialog.cpp | |
parent | Can be compiled with minimal UI support. (diff) | |
download | GpgFrontend-c5918a7245b6124916799c0345026ef3ec02265e.tar.gz GpgFrontend-c5918a7245b6124916799c0345026ef3ec02265e.zip |
Solve key generation and related update issues.
Diffstat (limited to 'src/ui/keygen/KeygenDialog.cpp')
-rw-r--r-- | src/ui/keygen/KeygenDialog.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/ui/keygen/KeygenDialog.cpp b/src/ui/keygen/KeygenDialog.cpp index 0786d644..a8bc6935 100644 --- a/src/ui/keygen/KeygenDialog.cpp +++ b/src/ui/keygen/KeygenDialog.cpp @@ -23,7 +23,9 @@ */ #include "ui/keygen/KeygenDialog.h" + #include "gpg/function/GpgKeyOpera.h" +#include "ui/SignalStation.h" #include "ui/WaitingDialog.h" namespace GpgFrontend::UI { @@ -34,6 +36,10 @@ KeyGenDialog::KeyGenDialog(QWidget* parent) : QDialog(parent) { this->setWindowTitle(tr("Generate Key")); this->setModal(true); + + connect(this, SIGNAL(KeyGenerated()), SignalStation::GetInstance(), + SIGNAL(KeyDatabaseRefresh())); + generateKeyDialog(); } @@ -86,7 +92,7 @@ void KeyGenDialog::slotKeyGenAccept() { */ genKeyInfo->setUserid( - QString("%1 (%3) <%2>") + QString("%1(%3)<%2>") .arg(nameEdit->text(), emailEdit->text(), commentEdit->text()) .toStdString()); @@ -115,11 +121,19 @@ void KeyGenDialog::slotKeyGenAccept() { dialog->close(); if (gpgme_err_code(error) == GPG_ERR_NO_ERROR) { - QMessageBox::information(this, tr("Success"), - tr("The new key pair has been generated.")); + auto* msg_box = new QMessageBox(nullptr); + msg_box->setAttribute(Qt::WA_DeleteOnClose); + msg_box->setStandardButtons(QMessageBox::Ok); + msg_box->setWindowTitle(tr("Success")); + msg_box->setText(tr("The new key pair has been generated.")); + msg_box->setModal(false); + msg_box->open(); + + emit KeyGenerated(); this->close(); - } else + } else { QMessageBox::critical(this, tr("Failure"), tr(gpgme_strerror(error))); + } } else { /** |