aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/keypair_details/KeyPairDetailTab.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2021-08-23 12:20:22 +0000
committerGitHub <[email protected]>2021-08-23 12:20:22 +0000
commitcfc3f9545e713dc9378108b88d3dc97fd168a572 (patch)
treecb0ef59b60f1a0ebc70156fe1bb6a22c205497c3 /src/ui/keypair_details/KeyPairDetailTab.cpp
parentMerge pull request #15 from saturneric/develop (diff)
parentFix a discovered problem. (diff)
downloadGpgFrontend-cfc3f9545e713dc9378108b88d3dc97fd168a572.tar.gz
GpgFrontend-cfc3f9545e713dc9378108b88d3dc97fd168a572.zip
Merge pull request #22 from saturneric/develop
Diffstat (limited to '')
-rw-r--r--src/ui/keypair_details/KeyPairDetailTab.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/ui/keypair_details/KeyPairDetailTab.cpp b/src/ui/keypair_details/KeyPairDetailTab.cpp
index 9ca4e37e..c0a2df99 100644
--- a/src/ui/keypair_details/KeyPairDetailTab.cpp
+++ b/src/ui/keypair_details/KeyPairDetailTab.cpp
@@ -147,7 +147,6 @@ KeyPairDetailTab::KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey &mKey, Q
keyServerOperaButton->setStyleSheet("text-align:center;");
auto *revokeCertGenButton = new QPushButton(tr("Generate Revoke Certificate"));
- revokeCertGenButton->setDisabled(true);
connect(revokeCertGenButton, SIGNAL(clicked()), this, SLOT(slotGenRevokeCert()));
hBoxLayout->addWidget(keyServerOperaButton);
@@ -215,7 +214,11 @@ void KeyPairDetailTab::slotExportPrivateKey() {
return;
}
- auto &key = mCtx->getKeyById(*keyid);
+ auto key = mCtx->getKeyById(*keyid);
+ if (!key.good) {
+ QMessageBox::critical(nullptr, tr("Error"), tr("Key Not Found."));
+ return;
+ }
QString fileString = key.name + " " + key.email + "(" +
key.id + ")_secret.asc";
QString fileName = QFileDialog::getSaveFileName(this, tr("Export Key To File"), fileString,
@@ -342,15 +345,8 @@ void KeyPairDetailTab::slotGenRevokeCert() {
QStringLiteral("%1 (*.rev)").arg(
tr("Revocation Certificates")));
- auto process = mCtx->generateRevokeCert(mKey, mOutputFileName);
-
- auto *dialog = new WaitingDialog("Generating", this);
-
- while (process->state() == QProcess::Running) {
- QApplication::processEvents();
- }
-
- dialog->close();
+ if (!mOutputFileName.isEmpty())
+ mCtx->generateRevokeCert(mKey, mOutputFileName);
}