aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/VerifyKeyDetailBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widgets/VerifyKeyDetailBox.cpp')
-rw-r--r--src/ui/widgets/VerifyKeyDetailBox.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/ui/widgets/VerifyKeyDetailBox.cpp b/src/ui/widgets/VerifyKeyDetailBox.cpp
index 5e4d06d0..4c936f4f 100644
--- a/src/ui/widgets/VerifyKeyDetailBox.cpp
+++ b/src/ui/widgets/VerifyKeyDetailBox.cpp
@@ -1,4 +1,6 @@
/**
+ * Copyright (C) 2021 Saturneric
+ *
* This file is part of GpgFrontend.
*
* GpgFrontend is free software: you can redistribute it and/or modify
@@ -6,41 +8,43 @@
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Foobar is distributed in the hope that it will be useful,
+ * GpgFrontend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Foobar. If not, see <https://www.gnu.org/licenses/>.
+ * along with GpgFrontend. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The initial version of the source code is inherited from
+ * the gpg4usb project, which is under GPL-3.0-or-later.
*
- * The initial version of the source code is inherited from gpg4usb-team.
- * Their source code version also complies with GNU General Public License.
+ * All the source code of GpgFrontend was modified and released by
+ * Saturneric<[email protected]> starting on May 12, 2021.
*
- * The source code version of this software was modified and released
- * by Saturneric<[email protected]> starting on May 12, 2021.
+ * SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "ui/widgets/VerifyKeyDetailBox.h"
-#include "gpg/function/GpgKeyGetter.h"
+#include "core/function/gpg/GpgKeyGetter.h"
namespace GpgFrontend::UI {
VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
QWidget* parent)
- : QGroupBox(parent), fpr(signature.GetFingerprint()) {
+ : QGroupBox(parent), fpr_(signature.GetFingerprint()) {
auto* vbox = new QVBoxLayout();
switch (gpg_err_code(signature.GetStatus())) {
case GPG_ERR_NO_PUBKEY: {
this->setTitle("A Error Signature");
auto* importButton = new QPushButton(_("Import from keyserver"));
- connect(importButton, SIGNAL(clicked()), this,
- SLOT(slotImportFormKeyserver()));
+ connect(importButton,&QPushButton::clicked, this,
+ &VerifyKeyDetailBox::slot_import_form_key_server);
- this->setTitle(QString(_("Key not present with id 0x")) + fpr.c_str());
+ this->setTitle(QString(_("Key not present with id 0x")) + fpr_.c_str());
auto grid = new QGridLayout();
@@ -55,7 +59,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
}
case GPG_ERR_NO_ERROR: {
this->setTitle(QString(_("A Signature")) + ":");
- auto gird = createKeyInfoGrid(signature);
+ auto gird = create_key_info_grid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
} else {
@@ -71,7 +75,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
this->setTitle("An Error Signature");
vbox->addWidget(
new QLabel(QString(_("Status")) + ":" + _("Cert Revoked")));
- auto gird = createKeyInfoGrid(signature);
+ auto gird = create_key_info_grid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
} else {
@@ -87,7 +91,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
this->setTitle("An Error Signature");
vbox->addWidget(
new QLabel(QString(_("Status")) + ":" + _("Signature Expired")));
- auto gird = createKeyInfoGrid(signature);
+ auto gird = create_key_info_grid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
} else {
@@ -105,7 +109,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
new QLabel(QString(_("Status")) + ":" + _("Key Expired")));
vbox->addWidget(
new QLabel(QString(_("Status")) + ":" + _("Key Expired")));
- auto gird = createKeyInfoGrid(signature);
+ auto gird = create_key_info_grid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
} else {
@@ -121,7 +125,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
this->setTitle("An Error Signature");
vbox->addWidget(
new QLabel(QString(_("Status")) + ":" + _("General Error")));
- auto gird = createKeyInfoGrid(signature);
+ auto gird = create_key_info_grid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
} else {
@@ -136,7 +140,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
default: {
this->setTitle("An Error Signature");
this->setTitle(QString(_("Status")) + ":" + _("Unknown Error "));
- auto gird = createKeyInfoGrid(signature);
+ auto gird = create_key_info_grid(signature);
if (gird != nullptr) {
vbox->addLayout(gird);
} else {
@@ -152,17 +156,17 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(const GpgSignature& signature,
this->setLayout(vbox);
}
-void VerifyKeyDetailBox::slotImportFormKeyserver() {
+void VerifyKeyDetailBox::slot_import_form_key_server() {
auto* importDialog = new KeyServerImportDialog(false, this);
auto key_ids = std::make_unique<KeyIdArgsList>();
- key_ids->push_back(fpr);
- importDialog->slotImport(key_ids);
+ key_ids->push_back(fpr_);
+ importDialog->SlotImport(key_ids);
}
-QGridLayout* VerifyKeyDetailBox::createKeyInfoGrid(
+QGridLayout* VerifyKeyDetailBox::create_key_info_grid(
const GpgSignature& signature) {
auto grid = new QGridLayout();
- GpgKey key = GpgKeyGetter::GetInstance().GetKey(fpr);
+ GpgKey key = GpgKeyGetter::GetInstance().GetKey(fpr_);
if (!key.IsGood()) return nullptr;
grid->addWidget(new QLabel(QString(_("Signer Name")) + ":"), 0, 0);
@@ -173,7 +177,7 @@ QGridLayout* VerifyKeyDetailBox::createKeyInfoGrid(
grid->addWidget(new QLabel(QString::fromStdString(key.GetName())), 0, 1);
grid->addWidget(new QLabel(QString::fromStdString(key.GetEmail())), 1, 1);
- grid->addWidget(new QLabel(beautify_fingerprint(fpr).c_str()), 2, 1);
+ grid->addWidget(new QLabel(beautify_fingerprint(fpr_).c_str()), 2, 1);
if (signature.GetSummary() & GPGME_SIGSUM_VALID) {
grid->addWidget(new QLabel(_("Fully Valid")), 3, 1);