diff options
Diffstat (limited to 'src/ui/dialog/SignersPicker.cpp')
-rw-r--r-- | src/ui/dialog/SignersPicker.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/ui/dialog/SignersPicker.cpp b/src/ui/dialog/SignersPicker.cpp index 8969618e..378a58c7 100644 --- a/src/ui/dialog/SignersPicker.cpp +++ b/src/ui/dialog/SignersPicker.cpp @@ -1,7 +1,7 @@ -/* - * Copyright (c) 2022. Saturneric +/** + * Copyright (C) 2021 Saturneric <[email protected]> * - * 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 @@ -20,21 +20,23 @@ * the gpg4usb project, which is under GPL-3.0-or-later. * * All the source code of GpgFrontend was modified and released by - * Saturneric<[email protected]> starting on May 12, 2021. + * Saturneric <[email protected]> starting on May 12, 2021. * * SPDX-License-Identifier: GPL-3.0-or-later + * */ #include "SignersPicker.h" +#include "core/GpgModel.h" #include "ui/widgets/KeyList.h" namespace GpgFrontend::UI { SignersPicker::SignersPicker(QWidget* parent) : GeneralDialog(typeid(SignersPicker).name(), parent) { - auto confirm_button = new QPushButton(_("Confirm")); - auto cancel_button = new QPushButton(_("Cancel")); + auto* confirm_button = new QPushButton(tr("Confirm")); + auto* cancel_button = new QPushButton(tr("Cancel")); connect(confirm_button, &QPushButton::clicked, [=]() { this->accepted_ = true; }); @@ -42,9 +44,9 @@ SignersPicker::SignersPicker(QWidget* parent) connect(cancel_button, &QPushButton::clicked, this, &QDialog::reject); /*Setup KeyList*/ - key_list_ = new KeyList(false, this); + key_list_ = new KeyList(0U, this); key_list_->AddListGroupTab( - _("Signers"), "signers", KeyListRow::ONLY_SECRET_KEY, + tr("Signers"), "signers", KeyListRow::ONLY_SECRET_KEY, KeyListColumn::NAME | KeyListColumn::EmailAddress | KeyListColumn::Usage, [](const GpgKey& key, const KeyTable&) -> bool { return key.IsHasActualSigningCapability(); @@ -52,13 +54,13 @@ SignersPicker::SignersPicker(QWidget* parent) key_list_->SlotRefresh(); auto* vbox2 = new QVBoxLayout(); - vbox2->addWidget(new QLabel(QString(_("Select Signer(s)")) + ": ")); + vbox2->addWidget(new QLabel(tr("Select Signer(s)") + ": ")); vbox2->addWidget(key_list_); vbox2->addWidget(new QLabel( QString( - _("Please select one or more private keys you use for signing.")) + + tr("Please select one or more private keys you use for signing.")) + "\n" + - _("If no key is selected, the default key will be used for signing."))); + tr("If no key is selected, the default key will be used for signing."))); vbox2->addWidget(confirm_button); vbox2->addWidget(cancel_button); vbox2->addStretch(0); @@ -68,15 +70,17 @@ SignersPicker::SignersPicker(QWidget* parent) Qt::CustomizeWindowHint); this->setModal(true); - this->setWindowTitle("Signers Picker"); + this->setWindowTitle(tr("Signers Picker")); this->setMinimumWidth(480); + + movePosition2CenterOfParent(); this->show(); } -GpgFrontend::KeyIdArgsListPtr SignersPicker::GetCheckedSigners() { +auto SignersPicker::GetCheckedSigners() -> GpgFrontend::KeyIdArgsListPtr { return key_list_->GetPrivateChecked(); } -bool SignersPicker::GetStatus() const { return this->accepted_; } +auto SignersPicker::GetStatus() const -> bool { return this->accepted_; } } // namespace GpgFrontend::UI |