aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/SignersPicker.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2022-07-23 14:54:51 +0000
committerGitHub <[email protected]>2022-07-23 14:54:51 +0000
commitb244320b2d228189767aa6d59febceb6b64527fb (patch)
tree179d34e2a3e84231fad72c4bbe9f74673d0b74d0 /src/ui/dialog/SignersPicker.cpp
parentMerge pull request #68 from saturneric/develop-2.0.8 (diff)
parentfeat(project): add rpm package support (diff)
downloadGpgFrontend-2.0.9.tar.gz
GpgFrontend-2.0.9.zip
Merge pull request #70 from saturneric/dev/2.0.8/saturnericv2.0.9
Develop 2.0.9.1
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