aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/SignersPicker.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-07-22 18:54:52 +0000
committerSaturneric <[email protected]>2022-07-22 18:56:08 +0000
commitff73042072c1937c8ee20cabab3f16cf38d588b1 (patch)
treef269b6178a5318cbf1c7945bbcd6d7a0736d104f /src/ui/dialog/SignersPicker.cpp
parentrefactor(ui): adjust file structure (diff)
downloadGpgFrontend-ff73042072c1937c8ee20cabab3f16cf38d588b1.tar.gz
GpgFrontend-ff73042072c1937c8ee20cabab3f16cf38d588b1.zip
fix(ui): fix signer picker and other issues
1. signer picker can cancel its operation now 2. fix window title of "Export As Key Package"
Diffstat (limited to '')
-rw-r--r--src/ui/dialog/SignersPicker.cpp (renamed from src/ui/widgets/SignersPicker.cpp)23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/ui/widgets/SignersPicker.cpp b/src/ui/dialog/SignersPicker.cpp
index 75f6b2ba..a670e514 100644
--- a/src/ui/widgets/SignersPicker.cpp
+++ b/src/ui/dialog/SignersPicker.cpp
@@ -1,7 +1,7 @@
-/**
- * Copyright (C) 2021 Saturneric
+/*
+ * Copyright (c) 2022. Saturneric
*
- * This file is part of GpgFrontend.
+ * This file is part of GpgFrontend.
*
* GpgFrontend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,18 +23,24 @@
* Saturneric<[email protected]> starting on May 12, 2021.
*
* SPDX-License-Identifier: GPL-3.0-or-later
- *
*/
-#include "ui/widgets/SignersPicker.h"
+#include "SignersPicker.h"
#include "ui/widgets/KeyList.h"
namespace GpgFrontend::UI {
-SignersPicker::SignersPicker(QWidget* parent) : QDialog(parent) {
+SignersPicker::SignersPicker(QWidget* parent)
+ : GeneralDialog(typeid(SignersPicker).name(), parent) {
auto confirm_button = new QPushButton(_("Confirm"));
- connect(confirm_button, &QPushButton::clicked, this, &SignersPicker::accept);
+ auto cancel_button = new QPushButton(_("Cancel"));
+
+ connect(confirm_button, &QPushButton::clicked, [=]() {
+ this->accepted_ = true;
+ });
+ connect(confirm_button, &QPushButton::clicked, this, &QDialog::accept);
+ connect(cancel_button, &QPushButton::clicked, this, &QDialog::reject);
/*Setup KeyList*/
key_list_ = new KeyList(false, this);
@@ -55,6 +61,7 @@ SignersPicker::SignersPicker(QWidget* parent) : QDialog(parent) {
"\n" +
_("If no key is selected, the default key will be used for signing.")));
vbox2->addWidget(confirm_button);
+ vbox2->addWidget(cancel_button);
vbox2->addStretch(0);
setLayout(vbox2);
@@ -71,4 +78,6 @@ GpgFrontend::KeyIdArgsListPtr SignersPicker::GetCheckedSigners() {
return key_list_->GetPrivateChecked();
}
+bool SignersPicker::GetStatus() const { return this->accepted_; }
+
} // namespace GpgFrontend::UI