aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/VerifyKeyDetailBox.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-06-05 20:57:30 +0000
committerSaturneric <[email protected]>2021-06-05 20:57:30 +0000
commit9c09b5de5180632746d9fc7f75a3ed7f07b06292 (patch)
tree89c1e21762f04b4e383ff7f2f45c280b2c5e67ce /src/ui/widgets/VerifyKeyDetailBox.cpp
parentUpdate the verification function. (diff)
downloadGpgFrontend-9c09b5de5180632746d9fc7f75a3ed7f07b06292.tar.gz
GpgFrontend-9c09b5de5180632746d9fc7f75a3ed7f07b06292.zip
Adjust and improve the detailed interface of the verification information result.
Check whether the key can be signed before signing operation. Check whether the key is qualified before encrypting and signing operations. Modify part of the text explanation on the key details tab. Adjust the length and width of the key pair management interface. Add the actual function column to the list on the file operation page. Adjust the file operation page. For the function that displays the actual possession of the key in the key list by default. Add the function of displaying the actual possession of the key in the key details page. Adjust the code structure. Convert the label prompt below into a message board prompt. Signed-off-by: Saturneric <[email protected]>
Diffstat (limited to '')
-rw-r--r--src/ui/widgets/VerifyKeyDetailBox.cpp (renamed from src/ui/VerifyKeyDetailBox.cpp)56
1 files changed, 47 insertions, 9 deletions
diff --git a/src/ui/VerifyKeyDetailBox.cpp b/src/ui/widgets/VerifyKeyDetailBox.cpp
index c393f468..3091d672 100644
--- a/src/ui/VerifyKeyDetailBox.cpp
+++ b/src/ui/widgets/VerifyKeyDetailBox.cpp
@@ -22,7 +22,7 @@
*
*/
-#include "ui/VerifyKeyDetailBox.h"
+#include "ui/widgets/VerifyKeyDetailBox.h"
VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext *ctx, KeyList *keyList,
gpgme_signature_t signature) :
@@ -35,6 +35,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext *ctx,
switch (gpg_err_code(signature->status)) {
case GPG_ERR_NO_PUBKEY: {
+ this->setTitle("A Error Signature");
auto *importButton = new QPushButton(tr("Import from keyserver"));
connect(importButton, SIGNAL(clicked()), this, SLOT(slotImportFormKeyserver()));
@@ -52,49 +53,86 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext *ctx,
break;
}
case GPG_ERR_NO_ERROR: {
+ this->setTitle("A Signature:");
auto gird = createKeyInfoGrid(signature);
if(gird != nullptr) {
vbox->addLayout(gird);
+ } else {
+ vbox->addWidget(new QLabel(tr("Key Information is NOT Available")));
+ if(signature->fpr != nullptr) {
+ vbox->addWidget(new QLabel(tr("Fingerprint: ") + QString(signature->fpr)));
+ }
}
break;
}
case GPG_ERR_CERT_REVOKED: {
- vbox->addWidget(new QLabel(tr("Cert Revoked")));
+ this->setTitle("An Error Signature");
+ vbox->addWidget(new QLabel(tr("Status: Cert Revoked")));
auto gird = createKeyInfoGrid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
+ } else {
+ vbox->addWidget(new QLabel(tr("Key Information is NOT Available")));
+ if(signature->fpr != nullptr) {
+ vbox->addWidget(new QLabel(tr("Fingerprint: ") + QString(signature->fpr)));
+ }
}
break;
}
case GPG_ERR_SIG_EXPIRED: {
- vbox->addWidget(new QLabel(tr("Signature Expired")));
+ this->setTitle("An Error Signature");
+ vbox->addWidget(new QLabel(tr("Status: Signature Expired")));
auto gird = createKeyInfoGrid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
+ } else {
+ vbox->addWidget(new QLabel(tr("Key Information is NOT Available")));
+ if(signature->fpr != nullptr) {
+ vbox->addWidget(new QLabel(tr("Fingerprint: ") + QString(signature->fpr)));
+ }
}
break;
}
case GPG_ERR_KEY_EXPIRED: {
- vbox->addWidget(new QLabel(tr("Key Expired")));
+ this->setTitle("An Error Signature");
+ vbox->addWidget(new QLabel(tr("Status: Signature Expired")));
+ vbox->addWidget(new QLabel(tr("Status: Key Expired")));
auto gird = createKeyInfoGrid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
+ } else {
+ vbox->addWidget(new QLabel(tr("Key Information is NOT Available")));
+ if(signature->fpr != nullptr) {
+ vbox->addWidget(new QLabel(tr("Fingerprint: ") + QString(signature->fpr)));
+ }
}
break;
}
case GPG_ERR_GENERAL: {
- vbox->addWidget(new QLabel(tr("General Error")));
+ this->setTitle("An Error Signature");
+ vbox->addWidget(new QLabel(tr("Status: General Error")));
auto gird = createKeyInfoGrid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
+ } else {
+ vbox->addWidget(new QLabel(tr("Key Information is NOT Available")));
+ if(signature->fpr != nullptr) {
+ vbox->addWidget(new QLabel(tr("Fingerprint: ") + QString(signature->fpr)));
+ }
}
break;
}
default: {
- this->setTitle(tr("Error for key with id 0x") + fpr);
+ this->setTitle("An Error Signature");
+ this->setTitle(tr("Status: Unknown Error"));
auto gird = createKeyInfoGrid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
+ } else {
+ vbox->addWidget(new QLabel(tr("Key Information is NOT Available")));
+ if(signature->fpr != nullptr) {
+ vbox->addWidget(new QLabel(tr("Fingerprint: ") + QString(signature->fpr)));
+ }
}
break;
}
@@ -121,9 +159,9 @@ QGridLayout *VerifyKeyDetailBox::createKeyInfoGrid(gpgme_signature_t &signature)
GpgKey key = mCtx->getKeyByFpr(signature->fpr);
if(!key.good) return nullptr;
- grid->addWidget(new QLabel(tr("Name:")), 0, 0);
- grid->addWidget(new QLabel(tr("Email:")), 1, 0);
- grid->addWidget(new QLabel(tr("Fingerprint:")), 2, 0);
+ grid->addWidget(new QLabel(tr("Signer Name:")), 0, 0);
+ grid->addWidget(new QLabel(tr("Signer Email:")), 1, 0);
+ grid->addWidget(new QLabel(tr("Key's Fingerprint:")), 2, 0);
grid->addWidget(new QLabel(tr("Valid:")), 3, 0);
grid->addWidget(new QLabel(tr("Flags:")), 4, 0);