aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/VerifyDetailsDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/VerifyDetailsDialog.cpp')
-rw-r--r--src/ui/VerifyDetailsDialog.cpp93
1 files changed, 51 insertions, 42 deletions
diff --git a/src/ui/VerifyDetailsDialog.cpp b/src/ui/VerifyDetailsDialog.cpp
index 3462ad69..f06c31a4 100644
--- a/src/ui/VerifyDetailsDialog.cpp
+++ b/src/ui/VerifyDetailsDialog.cpp
@@ -24,60 +24,69 @@
#include "ui/VerifyDetailsDialog.h"
-VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgFrontend::GpgContext *ctx, KeyList *keyList, gpg_error_t error,
- gpgme_verify_result_t result) :
- QDialog(parent), mCtx(ctx), mKeyList(keyList), sign(result->signatures), error(error) {
+namespace GpgFrontend::UI {
+VerifyDetailsDialog::VerifyDetailsDialog(QWidget* parent,
+ KeyList* keyList,
+ GpgError error,
+ GpgVerifyResult result)
+ : QDialog(parent),
+ mKeyList(keyList),
+ mResult(std::move(result)),
+ error(error) {
+ this->setWindowTitle(tr("Signature Details"));
- this->setWindowTitle(tr("Signature Details"));
+ mainLayout = new QHBoxLayout();
+ this->setLayout(mainLayout);
- connect(mCtx, SIGNAL(signalKeyInfoChanged()), this, SLOT(slotRefresh()));
- mainLayout = new QHBoxLayout();
- this->setLayout(mainLayout);
+ slotRefresh();
- slotRefresh();
-
- this->exec();
+ this->exec();
}
void VerifyDetailsDialog::slotRefresh() {
+ mVbox = new QWidget();
+ auto* mVboxLayout = new QVBoxLayout(mVbox);
+ mainLayout->addWidget(mVbox);
- mVbox = new QWidget();
- auto *mVboxLayout = new QVBoxLayout(mVbox);
- mainLayout->addWidget(mVbox);
+ // Button Box for close button
+ buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
- // Button Box for close button
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
+ mVboxLayout->addWidget(new QLabel(tr("Status: ") + gpgme_strerror(error)));
- mVboxLayout->addWidget(new QLabel(tr("Status: ") + gpgme_strerror(error)));
+ auto sign = mResult->signatures;
- if (sign == nullptr) {
- mVboxLayout->addWidget(new QLabel(tr("No valid input found")));
- mVboxLayout->addWidget(buttonBox);
- return;
- }
+ if (sign == nullptr) {
+ mVboxLayout->addWidget(new QLabel(tr("No valid input found")));
+ mVboxLayout->addWidget(buttonBox);
+ return;
+ }
- // Get timestamp of signature of current text
- QDateTime timestamp;
- timestamp.setTime_t(sign->timestamp);
+ // Get timestamp of signature of current text
+ QDateTime timestamp;
+ timestamp.setTime_t(sign->timestamp);
- // Set the title widget depending on sign status
- if (gpg_err_code(sign->status) == GPG_ERR_BAD_SIGNATURE) {
- mVboxLayout->addWidget(new QLabel(tr("Error Validating signature")));
- } else if (mInputSignature != nullptr) {
- mVboxLayout->addWidget(new QLabel(
- tr("File was signed on %1 <br/> It Contains:<br/><br/>").arg(QLocale::system().toString(timestamp))));
- } else {
- mVboxLayout->addWidget(new QLabel(tr("Signed on %1 <br/> It Contains:<br /><br/>").arg(
- QLocale::system().toString(timestamp))));
- }
- // Add informationbox for every single key
- while (sign) {
- auto *sbox = new VerifyKeyDetailBox(this, mCtx, mKeyList, sign);
- sign = sign->next;
- mVboxLayout->addWidget(sbox);
- }
+ // Set the title widget depending on sign status
+ if (gpg_err_code(sign->status) == GPG_ERR_BAD_SIGNATURE) {
+ mVboxLayout->addWidget(new QLabel(tr("Error Validating signature")));
+ } else if (mInputSignature != nullptr) {
+ mVboxLayout->addWidget(
+ new QLabel(tr("File was signed on %1 <br/> It Contains:<br/><br/>")
+ .arg(QLocale::system().toString(timestamp))));
+ } else {
+ mVboxLayout->addWidget(
+ new QLabel(tr("Signed on %1 <br/> It Contains:<br /><br/>")
+ .arg(QLocale::system().toString(timestamp))));
+ }
+ // Add information box for every single key
+ while (sign) {
+ auto* sign_box = new VerifyKeyDetailBox(this, mKeyList, sign);
+ sign = sign->next;
+ mVboxLayout->addWidget(sign_box);
+ }
- mVboxLayout->addWidget(buttonBox);
+ mVboxLayout->addWidget(buttonBox);
}
+
+} // namespace GpgFrontend::UI \ No newline at end of file