aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/keypair_details/KeySignDialog.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-05-25 19:12:11 +0000
committerSaturneric <[email protected]>2021-05-25 19:12:11 +0000
commit001db514d1b447892bfae71640bd58567cb7cbcf (patch)
tree4b990ed6966e1e33bb3888f254dc4a7812d1760a /src/ui/keypair_details/KeySignDialog.cpp
parentStreamline, expand and improve the interface of GpgContext. (diff)
downloadGpgFrontend-001db514d1b447892bfae71640bd58567cb7cbcf.tar.gz
GpgFrontend-001db514d1b447892bfae71640bd58567cb7cbcf.zip
Fix some problems caused by negligence.
Basically complete the function of signing the key. There are still problems with the refresh mechanism. Signed-off-by: Saturneric <[email protected]>
Diffstat (limited to '')
-rw-r--r--src/ui/keypair_details/KeySignDialog.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ui/keypair_details/KeySignDialog.cpp b/src/ui/keypair_details/KeySignDialog.cpp
index 5a9b9118..e9ac9476 100644
--- a/src/ui/keypair_details/KeySignDialog.cpp
+++ b/src/ui/keypair_details/KeySignDialog.cpp
@@ -5,7 +5,7 @@
#include "ui/keypair_details/KeySignDialog.h"
KeySignDialog::KeySignDialog(GpgME::GpgContext *ctx, const GpgKey &key, const QVector<UID> &uid, QWidget *parent) :
- mCtx(ctx), mUids(uid), QDialog(parent), mKey(key) {
+ mKey(key), mCtx(ctx), mUids(uid), QDialog(parent) {
mKeyList = new KeyList(ctx,
KeyListRow::ONLY_SECRET_KEY,
@@ -47,18 +47,30 @@ KeySignDialog::KeySignDialog(GpgME::GpgContext *ctx, const GpgKey &key, const QV
timeLayout->addWidget(nonExpireCheck, 0, 2);
layout->addLayout(timeLayout, 1, 0);
+ connect(signKeyButton, SIGNAL(clicked(bool)), this, SLOT(slotSignKey(bool)));
+
this->setLayout(layout);
this->setModal(true);
- this->setWindowTitle(tr("Sign For Key's UID"));
+ this->setWindowTitle(tr("Sign For Key's UID(s)"));
this->adjustSize();
}
-void KeySignDialog::slotSignKey() {
+void KeySignDialog::slotSignKey(bool clicked) {
+
QVector<GpgKey> keys;
mKeyList->getCheckedKeys(keys);
mCtx->setSigners(keys);
const auto expires = expiresEdit->dateTime();
- for(const auto &uid : mUids)
- mCtx->signKey(mKey, uid.uid, &expires);
+ for(const auto &uid : mUids) {
+ for(const auto &key : keys) {
+ if (!mCtx->signKey(mKey, uid.uid, &expires)) {
+ auto msg = QMessageBox();
+ msg.setText(QString("%1 <%2> failed to sign.").arg(key.name, key.email));
+ msg.exec();
+ }
+ }
+ }
+
+ this->close();
}