aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ui/keypair_details/EditSubKeyDialog.cpp25
-rw-r--r--src/ui/keypair_details/EditSubKeyDialog.h30
-rw-r--r--src/ui/keypair_details/KeyDetailsDialog.cpp16
-rw-r--r--src/ui/keypair_details/KeyDetailsDialog.h2
-rw-r--r--src/ui/keypair_details/KeyNewUIDDialog.cpp57
-rw-r--r--src/ui/keypair_details/KeyNewUIDDialog.h41
-rw-r--r--src/ui/keypair_details/KeyPairDetailTab.cpp4
-rw-r--r--src/ui/keypair_details/KeyPairDetailTab.h61
-rw-r--r--src/ui/keypair_details/KeyPairOperaTab.cpp56
-rw-r--r--src/ui/keypair_details/KeyPairOperaTab.h68
-rw-r--r--src/ui/keypair_details/KeyPairSubkeyTab.cpp222
-rw-r--r--src/ui/keypair_details/KeyPairSubkeyTab.h118
-rw-r--r--src/ui/keypair_details/KeyPairUIDTab.cpp302
-rw-r--r--src/ui/keypair_details/KeyPairUIDTab.h198
-rw-r--r--src/ui/keypair_details/KeySetExpireDateDialog.cpp60
-rw-r--r--src/ui/keypair_details/KeySetExpireDateDialog.h43
-rw-r--r--src/ui/keypair_details/KeyUIDSignDialog.cpp75
-rw-r--r--src/ui/keypair_details/KeyUIDSignDialog.h37
18 files changed, 818 insertions, 597 deletions
diff --git a/src/ui/keypair_details/EditSubKeyDialog.cpp b/src/ui/keypair_details/EditSubKeyDialog.cpp
deleted file mode 100644
index 6c2e0ce1..00000000
--- a/src/ui/keypair_details/EditSubKeyDialog.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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
- * 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,
- * 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/>.
- *
- * The initial version of the source code is inherited from gpg4usb-team.
- * Their source code version also complies with GNU General Public License.
- *
- * The source code version of this software was modified and released
- * by Saturneric<[email protected]> starting on May 12, 2021.
- *
- */
-
-#include "ui/keypair_details/EditSubKeyDialog.h"
diff --git a/src/ui/keypair_details/EditSubKeyDialog.h b/src/ui/keypair_details/EditSubKeyDialog.h
deleted file mode 100644
index 51842405..00000000
--- a/src/ui/keypair_details/EditSubKeyDialog.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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
- * 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,
- * 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/>.
- *
- * The initial version of the source code is inherited from gpg4usb-team.
- * Their source code version also complies with GNU General Public License.
- *
- * The source code version of this software was modified and released
- * by Saturneric<[email protected]> starting on May 12, 2021.
- *
- */
-
-#ifndef GPGFRONTEND_EDITSUBKEY_H
-#define GPGFRONTEND_EDITSUBKEY_H
-
-class EditSubKeyDialog {};
-
-#endif // GPGFRONTEND_EDITSUBKEY_H
diff --git a/src/ui/keypair_details/KeyDetailsDialog.cpp b/src/ui/keypair_details/KeyDetailsDialog.cpp
index 4b4c0dba..4d5976ff 100644
--- a/src/ui/keypair_details/KeyDetailsDialog.cpp
+++ b/src/ui/keypair_details/KeyDetailsDialog.cpp
@@ -32,15 +32,17 @@
namespace GpgFrontend::UI {
KeyDetailsDialog::KeyDetailsDialog(const GpgKey& key, QWidget* parent)
: QDialog(parent) {
- tabWidget = new QTabWidget();
- tabWidget->addTab(new KeyPairDetailTab(key.GetId(), tabWidget), _("KeyPair"));
- tabWidget->addTab(new KeyPairUIDTab(key.GetId(), tabWidget), _("UIDs"));
- tabWidget->addTab(new KeyPairSubkeyTab(key.GetId(), tabWidget), _("Subkeys"));
- tabWidget->addTab(new KeyPairOperaTab(key.GetId(), tabWidget),
- _("Operations"));
+ tab_widget_ = new QTabWidget();
+ tab_widget_->addTab(new KeyPairDetailTab(key.GetId(), tab_widget_),
+ _("KeyPair"));
+ tab_widget_->addTab(new KeyPairUIDTab(key.GetId(), tab_widget_), _("UIDs"));
+ tab_widget_->addTab(new KeyPairSubkeyTab(key.GetId(), tab_widget_),
+ _("Subkeys"));
+ tab_widget_->addTab(new KeyPairOperaTab(key.GetId(), tab_widget_),
+ _("Operations"));
auto* mainLayout = new QVBoxLayout;
- mainLayout->addWidget(tabWidget);
+ mainLayout->addWidget(tab_widget_);
#ifdef MACOS
setAttribute(Qt::WA_LayoutUsesWidgetRect);
diff --git a/src/ui/keypair_details/KeyDetailsDialog.h b/src/ui/keypair_details/KeyDetailsDialog.h
index 72ae3f57..33ee3db9 100644
--- a/src/ui/keypair_details/KeyDetailsDialog.h
+++ b/src/ui/keypair_details/KeyDetailsDialog.h
@@ -37,7 +37,7 @@ class KeyDetailsDialog : public QDialog {
explicit KeyDetailsDialog(const GpgKey& key, QWidget* parent = nullptr);
private:
- QTabWidget* tabWidget{};
+ QTabWidget* tab_widget_{};
};
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyNewUIDDialog.cpp b/src/ui/keypair_details/KeyNewUIDDialog.cpp
index a4f2bd74..6779ecfb 100644
--- a/src/ui/keypair_details/KeyNewUIDDialog.cpp
+++ b/src/ui/keypair_details/KeyNewUIDDialog.cpp
@@ -30,62 +30,63 @@
namespace GpgFrontend::UI {
KeyNewUIDDialog::KeyNewUIDDialog(const KeyId& key_id, QWidget* parent)
- : QDialog(parent), mKey(GpgKeyGetter::GetInstance().GetKey(key_id)) {
- name = new QLineEdit();
- name->setMinimumWidth(240);
- email = new QLineEdit();
- email->setMinimumWidth(240);
- comment = new QLineEdit();
- comment->setMinimumWidth(240);
- createButton = new QPushButton("Create");
- errorLabel = new QLabel();
+ : QDialog(parent), m_key_(GpgKeyGetter::GetInstance().GetKey(key_id)) {
+ name_ = new QLineEdit();
+ name_->setMinimumWidth(240);
+ email_ = new QLineEdit();
+ email_->setMinimumWidth(240);
+ comment_ = new QLineEdit();
+ comment_->setMinimumWidth(240);
+ create_button_ = new QPushButton("Create");
+ error_label_ = new QLabel();
auto gridLayout = new QGridLayout();
gridLayout->addWidget(new QLabel(_("Name")), 0, 0);
gridLayout->addWidget(new QLabel(_("Email")), 1, 0);
gridLayout->addWidget(new QLabel(_("Comment")), 2, 0);
- gridLayout->addWidget(name, 0, 1);
- gridLayout->addWidget(email, 1, 1);
- gridLayout->addWidget(comment, 2, 1);
+ gridLayout->addWidget(name_, 0, 1);
+ gridLayout->addWidget(email_, 1, 1);
+ gridLayout->addWidget(comment_, 2, 1);
- gridLayout->addWidget(createButton, 3, 0, 1, 2);
+ gridLayout->addWidget(create_button_, 3, 0, 1, 2);
gridLayout->addWidget(
new QLabel(_("Notice: The New UID Created will be set as Primary.")), 4,
0, 1, 2);
- gridLayout->addWidget(errorLabel, 5, 0, 1, 2);
+ gridLayout->addWidget(error_label_, 5, 0, 1, 2);
- connect(createButton, SIGNAL(clicked(bool)), this, SLOT(slotCreateNewUID()));
+ connect(create_button_, SIGNAL(clicked(bool)), this,
+ SLOT(slot_create_new_uid()));
this->setLayout(gridLayout);
this->setWindowTitle(_("Create New UID"));
this->setAttribute(Qt::WA_DeleteOnClose, true);
this->setModal(true);
- connect(this, SIGNAL(signalUIDCreated()), SignalStation::GetInstance(),
+ connect(this, SIGNAL(SignalUIDCreated()), SignalStation::GetInstance(),
SIGNAL(KeyDatabaseRefresh()));
}
-void KeyNewUIDDialog::slotCreateNewUID() {
+void KeyNewUIDDialog::slot_create_new_uid() {
std::stringstream error_stream;
/**
* check for errors in keygen dialog input
*/
- if ((name->text()).size() < 5) {
+ if ((name_->text()).size() < 5) {
error_stream << " " << _("Name must contain at least five characters.")
<< std::endl;
}
- if (email->text().isEmpty() || !check_email_address(email->text())) {
+ if (email_->text().isEmpty() || !check_email_address(email_->text())) {
error_stream << " " << _("Please give a email address.") << std::endl;
}
auto error_string = error_stream.str();
if (error_string.empty()) {
- if (UIDOperator::GetInstance().AddUID(mKey, name->text().toStdString(),
- comment->text().toStdString(),
- email->text().toStdString())) {
+ if (UIDOperator::GetInstance().AddUID(m_key_, name_->text().toStdString(),
+ comment_->text().toStdString(),
+ email_->text().toStdString())) {
emit finished(1);
- emit signalUIDCreated();
+ emit SignalUIDCreated();
} else
emit finished(-1);
@@ -93,17 +94,17 @@ void KeyNewUIDDialog::slotCreateNewUID() {
/**
* create error message
*/
- errorLabel->setAutoFillBackground(true);
- QPalette error = errorLabel->palette();
+ error_label_->setAutoFillBackground(true);
+ QPalette error = error_label_->palette();
error.setColor(QPalette::Window, "#ff8080");
- errorLabel->setPalette(error);
- errorLabel->setText(error_string.c_str());
+ error_label_->setPalette(error);
+ error_label_->setText(error_string.c_str());
this->show();
}
}
bool KeyNewUIDDialog::check_email_address(const QString& str) {
- return re_email.match(str).hasMatch();
+ return re_email_.match(str).hasMatch();
}
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyNewUIDDialog.h b/src/ui/keypair_details/KeyNewUIDDialog.h
index 2e38a7f4..bc035ff3 100644
--- a/src/ui/keypair_details/KeyNewUIDDialog.h
+++ b/src/ui/keypair_details/KeyNewUIDDialog.h
@@ -33,30 +33,51 @@ class KeyNewUIDDialog : public QDialog {
Q_OBJECT
public:
+ /**
+ * @brief Construct a new Key New U I D Dialog object
+ *
+ * @param key
+ * @param parent
+ */
KeyNewUIDDialog(const KeyId& key, QWidget* parent = nullptr);
signals:
- void signalUIDCreated();
+ /**
+ * @brief
+ *
+ */
+ void SignalUIDCreated();
private slots:
- void slotCreateNewUID();
+ /**
+ * @brief
+ *
+ */
+ void slot_create_new_uid();
private:
- GpgKey mKey;
+ GpgKey m_key_; ///<
- QLineEdit* name{};
- QLineEdit* email{};
- QLineEdit* comment{};
+ QLineEdit* name_{}; ///<
+ QLineEdit* email_{}; ///<
+ QLineEdit* comment_{}; ///<
- QPushButton* createButton{};
+ QPushButton* create_button_{}; ///<
- QStringList errorMessages;
- QLabel* errorLabel{};
+ QStringList error_messages_; ///<
+ QLabel* error_label_{}; ///<
- QRegularExpression re_email{
+ QRegularExpression re_email_{
R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"};
+ /**
+ * @brief
+ *
+ * @param str
+ * @return true
+ * @return false
+ */
bool check_email_address(const QString& str);
};
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyPairDetailTab.cpp b/src/ui/keypair_details/KeyPairDetailTab.cpp
index ed71be0f..a13376b1 100644
--- a/src/ui/keypair_details/KeyPairDetailTab.cpp
+++ b/src/ui/keypair_details/KeyPairDetailTab.cpp
@@ -125,7 +125,7 @@ KeyPairDetailTab::KeyPairDetailTab(const std::string& key_id, QWidget* parent)
copyFingerprintButton->setFlat(true);
copyFingerprintButton->setToolTip(_("copy fingerprint to clipboard"));
connect(copyFingerprintButton, SIGNAL(clicked()), this,
- SLOT(slotCopyFingerprint()));
+ SLOT(slot_copy_fingerprint()));
hboxFP->addWidget(copyFingerprintButton);
hboxFP->addStretch();
@@ -158,7 +158,7 @@ KeyPairDetailTab::KeyPairDetailTab(const std::string& key_id, QWidget* parent)
setLayout(mvbox);
}
-void KeyPairDetailTab::slotCopyFingerprint() {
+void KeyPairDetailTab::slot_copy_fingerprint() {
QString fpr = fingerPrintVarLabel->text().trimmed().replace(" ", QString());
QClipboard* cb = QApplication::clipboard();
cb->setText(fpr);
diff --git a/src/ui/keypair_details/KeyPairDetailTab.h b/src/ui/keypair_details/KeyPairDetailTab.h
index 151d8fc7..83014361 100644
--- a/src/ui/keypair_details/KeyPairDetailTab.h
+++ b/src/ui/keypair_details/KeyPairDetailTab.h
@@ -41,42 +41,57 @@ class KeyPairDetailTab : public QWidget {
/**
* @details Copy the fingerprint to clipboard
*/
- void slotCopyFingerprint();
+ void slot_copy_fingerprint();
+ /**
+ * @brief
+ *
+ */
void slotRefreshKeyInfo();
+ /**
+ * @brief
+ *
+ */
void slotRefreshKey();
private:
- GpgKey key_;
-
- QGroupBox* ownerBox; /** Groupbox containing owner information */
- QGroupBox* keyBox; /** Groupbox containing key information */
- QGroupBox* fingerprintBox; /** Groupbox containing fingerprint information */
- QGroupBox* additionalUidBox; /** Groupbox containing information about
- additional uids */
-
- QLabel* nameVarLabel; /** Label containng the keys name */
- QLabel* emailVarLabel; /** Label containng the keys email */
- QLabel* commentVarLabel; /** Label containng the keys commment */
- QLabel* keySizeVarLabel; /** Label containng the keys keysize */
- QLabel* expireVarLabel; /** Label containng the keys expiration date */
- QLabel* createdVarLabel; /** Label containng the keys creation date */
- QLabel* lastUpdateVarLabel;
- QLabel* algorithmVarLabel; /** Label containng the keys algorithm */
- QLabel* keyidVarLabel; /** Label containng the keys keyid */
- QLabel* fingerPrintVarLabel; /** Label containng the keys fingerprint */
+ GpgKey key_; ///<
+
+ QGroupBox* ownerBox; ///< Groupbox containing owner information
+ QGroupBox* keyBox; ///< Groupbox containing key information
+ QGroupBox* fingerprintBox; ///< Groupbox containing fingerprint information
+ QGroupBox* additionalUidBox; ///< Groupbox containing information about
+ ///< additional uids
+
+ QLabel* nameVarLabel; ///< Label containng the keys name
+ QLabel* emailVarLabel; ///< Label containng the keys email
+ QLabel* commentVarLabel; ///< Label containng the keys commment
+ QLabel* keySizeVarLabel; ///< Label containng the keys keysize
+ QLabel* expireVarLabel; ///< Label containng the keys expiration date
+ QLabel* createdVarLabel; ///< Label containng the keys creation date
+ QLabel* lastUpdateVarLabel; ///<
+ QLabel* algorithmVarLabel; ///< Label containng the keys algorithm
+ QLabel* keyidVarLabel; ///< Label containng the keys keyid
+ QLabel* fingerPrintVarLabel; ///< Label containng the keys fingerprint
QLabel* usageVarLabel;
QLabel* actualUsageVarLabel;
QLabel* masterKeyExistVarLabel;
- QLabel* iconLabel;
- QLabel* expLabel;
+ QLabel* iconLabel; ///<
+ QLabel* expLabel; ///<
- QMenu* keyServerOperaMenu{};
- QMenu* secretKeyExportOperaMenu{};
+ QMenu* keyServerOperaMenu{}; ///<
+ QMenu* secretKeyExportOperaMenu{}; ///<
public:
+
+ /**
+ * @brief Construct a new Key Pair Detail Tab object
+ *
+ * @param key_id
+ * @param parent
+ */
explicit KeyPairDetailTab(const std::string& key_id,
QWidget* parent = nullptr);
};
diff --git a/src/ui/keypair_details/KeyPairOperaTab.cpp b/src/ui/keypair_details/KeyPairOperaTab.cpp
index d5fdec0e..3a92112e 100644
--- a/src/ui/keypair_details/KeyPairOperaTab.cpp
+++ b/src/ui/keypair_details/KeyPairOperaTab.cpp
@@ -36,7 +36,7 @@ namespace GpgFrontend::UI {
KeyPairOperaTab::KeyPairOperaTab(const std::string& key_id, QWidget* parent)
: QWidget(parent), m_key_(GpgKeyGetter::GetInstance().GetKey(key_id)) {
// Set Menu
- createOperaMenu();
+ CreateOperaMenu();
auto m_vbox = new QVBoxLayout(this);
auto* opera_key_box = new QGroupBox(_("General Operations"));
@@ -48,22 +48,22 @@ KeyPairOperaTab::KeyPairOperaTab(const std::string& key_id, QWidget* parent)
auto* export_public_button = new QPushButton(_("Export Public Key"));
export_h_box_layout->addWidget(export_public_button);
connect(export_public_button, SIGNAL(clicked()), this,
- SLOT(slotExportPublicKey()));
+ SLOT(slot_export_public_key()));
if (m_key_.IsPrivateKey()) {
auto* export_private_button = new QPushButton(_("Export Private Key"));
export_private_button->setStyleSheet("text-align:center;");
- export_private_button->setMenu(secretKeyExportOperaMenu);
+ export_private_button->setMenu(secret_key_export_opera_menu_);
export_h_box_layout->addWidget(export_private_button);
if (m_key_.IsHasMasterKey()) {
auto* edit_expires_button =
new QPushButton(_("Modify Expiration Datetime (Primary Key)"));
connect(edit_expires_button, SIGNAL(clicked()), this,
- SLOT(slotModifyEditDatetime()));
+ SLOT(slot_modify_edit_datetime()));
auto* edit_password_button = new QPushButton(_("Modify Password"));
connect(edit_password_button, SIGNAL(clicked()), this,
- SLOT(slotModifyPassword()));
+ SLOT(slot_modify_password()));
vbox_p_k->addWidget(edit_expires_button);
vbox_p_k->addWidget(edit_password_button);
@@ -74,20 +74,20 @@ KeyPairOperaTab::KeyPairOperaTab(const std::string& key_id, QWidget* parent)
auto* key_server_opera_button =
new QPushButton(_("Key Server Operation (Pubkey)"));
key_server_opera_button->setStyleSheet("text-align:center;");
- key_server_opera_button->setMenu(keyServerOperaMenu);
+ key_server_opera_button->setMenu(key_server_opera_menu_);
advance_h_box_layout->addWidget(key_server_opera_button);
if (m_key_.IsPrivateKey() && m_key_.IsHasMasterKey()) {
auto* revoke_cert_gen_button =
new QPushButton(_("Generate Revoke Certificate"));
connect(revoke_cert_gen_button, SIGNAL(clicked()), this,
- SLOT(slotGenRevokeCert()));
+ SLOT(slot_gen_revoke_cert()));
advance_h_box_layout->addWidget(revoke_cert_gen_button);
}
auto* modify_tofu_button = new QPushButton(_("Modify TOFU Policy"));
connect(modify_tofu_button, SIGNAL(clicked()), this,
- SLOT(slotModifyTOFUPolicy()));
+ SLOT(slot_modify_tofu_policy()));
vbox_p_k->addLayout(advance_h_box_layout);
opera_key_box->setLayout(vbox_p_k);
@@ -98,44 +98,44 @@ KeyPairOperaTab::KeyPairOperaTab(const std::string& key_id, QWidget* parent)
setLayout(m_vbox);
}
-void KeyPairOperaTab::createOperaMenu() {
- keyServerOperaMenu = new QMenu(this);
+void KeyPairOperaTab::CreateOperaMenu() {
+ key_server_opera_menu_ = new QMenu(this);
auto* uploadKeyPair = new QAction(_("Upload Key Pair to Key Server"), this);
connect(uploadKeyPair, SIGNAL(triggered()), this,
- SLOT(slotUploadKeyToServer()));
+ SLOT(slot_upload_key_to_server()));
if (!(m_key_.IsPrivateKey() && m_key_.IsHasMasterKey()))
uploadKeyPair->setDisabled(true);
auto* updateKeyPair = new QAction(_("Sync Key Pair From Key Server"), this);
connect(updateKeyPair, SIGNAL(triggered()), this,
- SLOT(slotUpdateKeyFromServer()));
+ SLOT(slot_update_key_from_server()));
// when a key has primary key, it should always upload to keyserver.
if (m_key_.IsHasMasterKey()) {
updateKeyPair->setDisabled(true);
}
- keyServerOperaMenu->addAction(uploadKeyPair);
- keyServerOperaMenu->addAction(updateKeyPair);
+ key_server_opera_menu_->addAction(uploadKeyPair);
+ key_server_opera_menu_->addAction(updateKeyPair);
- secretKeyExportOperaMenu = new QMenu(this);
+ secret_key_export_opera_menu_ = new QMenu(this);
auto* exportFullSecretKey = new QAction(_("Export Full Secret Key"), this);
connect(exportFullSecretKey, SIGNAL(triggered()), this,
- SLOT(slotExportPrivateKey()));
+ SLOT(slot_export_private_key()));
if (!m_key_.IsPrivateKey()) exportFullSecretKey->setDisabled(true);
auto* exportShortestSecretKey =
new QAction(_("Export Shortest Secret Key"), this);
connect(exportShortestSecretKey, SIGNAL(triggered()), this,
- SLOT(slotExportShortPrivateKey()));
+ SLOT(slot_export_short_private_key()));
- secretKeyExportOperaMenu->addAction(exportFullSecretKey);
- secretKeyExportOperaMenu->addAction(exportShortestSecretKey);
+ secret_key_export_opera_menu_->addAction(exportFullSecretKey);
+ secret_key_export_opera_menu_->addAction(exportShortestSecretKey);
}
-void KeyPairOperaTab::slotExportPublicKey() {
+void KeyPairOperaTab::slot_export_public_key() {
ByteArrayPtr keyArray = nullptr;
if (!GpgKeyImportExporter::GetInstance().ExportKey(m_key_, keyArray)) {
@@ -161,7 +161,7 @@ void KeyPairOperaTab::slotExportPublicKey() {
}
}
-void KeyPairOperaTab::slotExportShortPrivateKey() {
+void KeyPairOperaTab::slot_export_short_private_key() {
// Show a information box with explanation about private key
int ret = QMessageBox::information(
this, _("Exporting short private Key"),
@@ -205,7 +205,7 @@ void KeyPairOperaTab::slotExportShortPrivateKey() {
}
}
-void KeyPairOperaTab::slotExportPrivateKey() {
+void KeyPairOperaTab::slot_export_private_key() {
// Show a information box with explanation about private key
int ret = QMessageBox::information(
this, _("Exporting private Key"),
@@ -245,12 +245,12 @@ void KeyPairOperaTab::slotExportPrivateKey() {
}
}
-void KeyPairOperaTab::slotModifyEditDatetime() {
+void KeyPairOperaTab::slot_modify_edit_datetime() {
auto dialog = new KeySetExpireDateDialog(m_key_.GetId(), this);
dialog->show();
}
-void KeyPairOperaTab::slotUploadKeyToServer() {
+void KeyPairOperaTab::slot_upload_key_to_server() {
auto keys = std::make_unique<KeyIdArgsList>();
keys->push_back(m_key_.GetId());
auto* dialog = new KeyUploadDialog(keys, this);
@@ -258,7 +258,7 @@ void KeyPairOperaTab::slotUploadKeyToServer() {
dialog->slotUpload();
}
-void KeyPairOperaTab::slotUpdateKeyFromServer() {
+void KeyPairOperaTab::slot_update_key_from_server() {
auto keys = std::make_unique<KeyIdArgsList>();
keys->push_back(m_key_.GetId());
auto* dialog = new KeyServerImportDialog(this);
@@ -266,7 +266,7 @@ void KeyPairOperaTab::slotUpdateKeyFromServer() {
dialog->slotImport(keys);
}
-void KeyPairOperaTab::slotGenRevokeCert() {
+void KeyPairOperaTab::slot_gen_revoke_cert() {
auto literal = QString("%1 (*.rev)").arg(_("Revocation Certificates"));
QString m_output_file_name;
@@ -307,7 +307,7 @@ void KeyPairOperaTab::slotGenRevokeCert() {
});
}
-void KeyPairOperaTab::slotModifyPassword() {
+void KeyPairOperaTab::slot_modify_password() {
auto err = GpgKeyOpera::GetInstance().ModifyPassword(m_key_);
if (check_gpg_error_2_err_code(err) != GPG_ERR_NO_ERROR) {
QMessageBox::critical(this, _("Not Successful"),
@@ -315,7 +315,7 @@ void KeyPairOperaTab::slotModifyPassword() {
}
}
-void KeyPairOperaTab::slotModifyTOFUPolicy() {
+void KeyPairOperaTab::slot_modify_tofu_policy() {
QStringList items;
items << _("Policy Auto") << _("Policy Good") << _("Policy Bad")
<< _("Policy Ask") << _("Policy Unknown");
diff --git a/src/ui/keypair_details/KeyPairOperaTab.h b/src/ui/keypair_details/KeyPairOperaTab.h
index f8a5ded9..2b05a316 100644
--- a/src/ui/keypair_details/KeyPairOperaTab.h
+++ b/src/ui/keypair_details/KeyPairOperaTab.h
@@ -32,37 +32,79 @@ namespace GpgFrontend::UI {
class KeyPairOperaTab : public QWidget {
Q_OBJECT
public:
+ /**
+ * @brief Construct a new Key Pair Opera Tab object
+ *
+ * @param key_id
+ * @param parent
+ */
KeyPairOperaTab(const std::string& key_id, QWidget* parent);
- void createOperaMenu();
+ /**
+ * @brief Create a Opera Menu object
+ *
+ */
+ void CreateOperaMenu();
private slots:
/**
* @details Export the key to a file, which is chosen in a file dialog
*/
- void slotExportPrivateKey();
+ void slot_export_private_key();
- void slotExportShortPrivateKey();
+ /**
+ * @brief
+ *
+ */
+ void slot_export_short_private_key();
- void slotExportPublicKey();
+ /**
+ * @brief
+ *
+ */
+ void slot_export_public_key();
- void slotModifyEditDatetime();
+ /**
+ * @brief
+ *
+ */
+ void slot_modify_edit_datetime();
- void slotModifyPassword();
+ /**
+ * @brief
+ *
+ */
+ void slot_modify_password();
- void slotUploadKeyToServer();
+ /**
+ * @brief
+ *
+ */
+ void slot_upload_key_to_server();
- void slotUpdateKeyFromServer();
+ /**
+ * @brief
+ *
+ */
+ void slot_update_key_from_server();
- void slotGenRevokeCert();
+ /**
+ * @brief
+ *
+ */
+ void slot_gen_revoke_cert();
- void slotModifyTOFUPolicy();
+ /**
+ * @brief
+ *
+ */
+ void slot_modify_tofu_policy();
private:
- GpgKey m_key_;
- QMenu* keyServerOperaMenu{};
- QMenu* secretKeyExportOperaMenu{};
+ GpgKey m_key_; ///<
+ QMenu* key_server_opera_menu_{}; ///<
+ QMenu* secret_key_export_opera_menu_{}; ///<
};
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyPairSubkeyTab.cpp b/src/ui/keypair_details/KeyPairSubkeyTab.cpp
index 4cbe9b1a..c41e9aa8 100644
--- a/src/ui/keypair_details/KeyPairSubkeyTab.cpp
+++ b/src/ui/keypair_details/KeyPairSubkeyTab.cpp
@@ -34,11 +34,11 @@ KeyPairSubkeyTab::KeyPairSubkeyTab(const std::string& key_id, QWidget* parent)
LOG(INFO) << key_.GetEmail() << key_.IsPrivateKey() << key_.IsHasMasterKey()
<< key_.GetSubKeys()->front().IsPrivateKey();
- createSubkeyList();
- createSubkeyOperaMenu();
+ create_subkey_list();
+ create_subkey_opera_menu();
- listBox = new QGroupBox(_("Subkey List"));
- detailBox = new QGroupBox(_("Detail of Selected Subkey"));
+ list_box_ = new QGroupBox(_("Subkey List"));
+ detail_box_ = new QGroupBox(_("Detail of Selected Subkey"));
auto uidButtonsLayout = new QGridLayout();
@@ -53,7 +53,7 @@ KeyPairSubkeyTab::KeyPairSubkeyTab(const std::string& key_id, QWidget* parent)
auto* baseLayout = new QVBoxLayout();
auto subkeyListLayout = new QGridLayout();
- subkeyListLayout->addWidget(subkeyList, 0, 0);
+ subkeyListLayout->addWidget(subkey_list_, 0, 0);
subkeyListLayout->addLayout(uidButtonsLayout, 1, 0);
subkeyListLayout->setContentsMargins(0, 10, 0, 0);
@@ -76,120 +76,121 @@ KeyPairSubkeyTab::KeyPairSubkeyTab(const std::string& key_id, QWidget* parent)
subkeyDetailLayout->addWidget(new QLabel(QString(_("Fingerprint")) + ": "), 8,
0);
- keyidVarLabel = new QLabel(this);
- keySizeVarLabel = new QLabel(this);
- expireVarLabel = new QLabel(this);
- algorithmVarLabel = new QLabel(this);
- createdVarLabel = new QLabel(this);
- usageVarLabel = new QLabel(this);
- masterKeyExistVarLabel = new QLabel(this);
- fingerPrintVarLabel = new QLabel(this);
- cardKeyLabel = new QLabel(this);
-
- subkeyDetailLayout->addWidget(keyidVarLabel, 0, 1, 1, 1);
- subkeyDetailLayout->addWidget(keySizeVarLabel, 2, 1, 1, 2);
- subkeyDetailLayout->addWidget(expireVarLabel, 4, 1, 1, 2);
- subkeyDetailLayout->addWidget(algorithmVarLabel, 1, 1, 1, 2);
- subkeyDetailLayout->addWidget(createdVarLabel, 5, 1, 1, 2);
- subkeyDetailLayout->addWidget(usageVarLabel, 3, 1, 1, 2);
- subkeyDetailLayout->addWidget(masterKeyExistVarLabel, 6, 1, 1, 2);
- subkeyDetailLayout->addWidget(cardKeyLabel, 7, 1, 1, 2);
- subkeyDetailLayout->addWidget(fingerPrintVarLabel, 8, 1, 1, 2);
+ key_id_var_label_ = new QLabel(this);
+ key_size_var_label_ = new QLabel(this);
+ expire_var_label_ = new QLabel(this);
+ algorithm_var_label_ = new QLabel(this);
+ created_var_label_ = new QLabel(this);
+ usage_var_label_ = new QLabel(this);
+ master_key_exist_var_label_ = new QLabel(this);
+ fingerprint_var_label_ = new QLabel(this);
+ card_key_label_ = new QLabel(this);
+
+ subkeyDetailLayout->addWidget(key_id_var_label_, 0, 1, 1, 1);
+ subkeyDetailLayout->addWidget(key_size_var_label_, 2, 1, 1, 2);
+ subkeyDetailLayout->addWidget(expire_var_label_, 4, 1, 1, 2);
+ subkeyDetailLayout->addWidget(algorithm_var_label_, 1, 1, 1, 2);
+ subkeyDetailLayout->addWidget(created_var_label_, 5, 1, 1, 2);
+ subkeyDetailLayout->addWidget(usage_var_label_, 3, 1, 1, 2);
+ subkeyDetailLayout->addWidget(master_key_exist_var_label_, 6, 1, 1, 2);
+ subkeyDetailLayout->addWidget(card_key_label_, 7, 1, 1, 2);
+ subkeyDetailLayout->addWidget(fingerprint_var_label_, 8, 1, 1, 2);
auto* copyKeyIdButton = new QPushButton(_("Copy"));
copyKeyIdButton->setFlat(true);
subkeyDetailLayout->addWidget(copyKeyIdButton, 0, 2);
connect(copyKeyIdButton, &QPushButton::clicked, this, [=]() {
- QString fpr = keyidVarLabel->text().trimmed();
+ QString fpr = key_id_var_label_->text().trimmed();
QClipboard* cb = QApplication::clipboard();
cb->setText(fpr);
});
- listBox->setLayout(subkeyListLayout);
- listBox->setContentsMargins(0, 12, 0, 0);
- detailBox->setLayout(subkeyDetailLayout);
+ list_box_->setLayout(subkeyListLayout);
+ list_box_->setContentsMargins(0, 12, 0, 0);
+ detail_box_->setLayout(subkeyDetailLayout);
- baseLayout->addWidget(listBox);
- baseLayout->addWidget(detailBox);
+ baseLayout->addWidget(list_box_);
+ baseLayout->addWidget(detail_box_);
baseLayout->addStretch();
- connect(addSubkeyButton, SIGNAL(clicked(bool)), this, SLOT(slotAddSubkey()));
- connect(subkeyList, SIGNAL(itemSelectionChanged()), this,
- SLOT(slotRefreshSubkeyDetail()));
+ connect(addSubkeyButton, SIGNAL(clicked(bool)), this,
+ SLOT(slot_add_subkey()));
+ connect(subkey_list_, SIGNAL(itemSelectionChanged()), this,
+ SLOT(slot_refresh_subkey_detail()));
// key database refresh signal
connect(SignalStation::GetInstance(), SIGNAL(KeyDatabaseRefresh()), this,
- SLOT(slotRefreshKeyInfo()));
+ SLOT(slot_refresh_key_info()));
connect(SignalStation::GetInstance(), SIGNAL(KeyDatabaseRefresh()), this,
- SLOT(slotRefreshSubkeyList()));
+ SLOT(slot_refresh_subkey_list()));
baseLayout->setContentsMargins(0, 0, 0, 0);
setLayout(baseLayout);
setAttribute(Qt::WA_DeleteOnClose, true);
- slotRefreshSubkeyList();
+ slot_refresh_subkey_list();
}
-void KeyPairSubkeyTab::createSubkeyList() {
- subkeyList = new QTableWidget(this);
+void KeyPairSubkeyTab::create_subkey_list() {
+ subkey_list_ = new QTableWidget(this);
- subkeyList->setColumnCount(5);
- subkeyList->horizontalHeader()->setSectionResizeMode(
+ subkey_list_->setColumnCount(5);
+ subkey_list_->horizontalHeader()->setSectionResizeMode(
QHeaderView::ResizeToContents);
- subkeyList->verticalHeader()->hide();
- subkeyList->setShowGrid(false);
- subkeyList->setSelectionBehavior(QAbstractItemView::SelectRows);
+ subkey_list_->verticalHeader()->hide();
+ subkey_list_->setShowGrid(false);
+ subkey_list_->setSelectionBehavior(QAbstractItemView::SelectRows);
// tableitems not editable
- subkeyList->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ subkey_list_->setEditTriggers(QAbstractItemView::NoEditTriggers);
// no focus (rectangle around tableitems)
// may be it should focus on whole row
- subkeyList->setFocusPolicy(Qt::NoFocus);
- subkeyList->setAlternatingRowColors(true);
+ subkey_list_->setFocusPolicy(Qt::NoFocus);
+ subkey_list_->setAlternatingRowColors(true);
QStringList labels;
labels << _("Subkey ID") << _("Key Size") << _("Algo")
<< _("Create Date (UTC)") << _("Expire Date (UTC)");
- subkeyList->setHorizontalHeaderLabels(labels);
- subkeyList->horizontalHeader()->setStretchLastSection(false);
+ subkey_list_->setHorizontalHeaderLabels(labels);
+ subkey_list_->horizontalHeader()->setStretchLastSection(false);
}
-void KeyPairSubkeyTab::slotRefreshSubkeyList() {
+void KeyPairSubkeyTab::slot_refresh_subkey_list() {
LOG(INFO) << "Called";
int row = 0;
- subkeyList->setSelectionMode(QAbstractItemView::SingleSelection);
+ subkey_list_->setSelectionMode(QAbstractItemView::SingleSelection);
- this->buffered_subkeys.clear();
+ this->buffered_subkeys_.clear();
auto sub_keys = key_.GetSubKeys();
for (auto& sub_key : *sub_keys) {
if (sub_key.IsDisabled() || sub_key.IsRevoked()) continue;
- this->buffered_subkeys.push_back(std::move(sub_key));
+ this->buffered_subkeys_.push_back(std::move(sub_key));
}
- subkeyList->setRowCount(buffered_subkeys.size());
+ subkey_list_->setRowCount(buffered_subkeys_.size());
- for (const auto& subkeys : buffered_subkeys) {
+ for (const auto& subkeys : buffered_subkeys_) {
auto* tmp0 = new QTableWidgetItem(QString::fromStdString(subkeys.GetID()));
tmp0->setTextAlignment(Qt::AlignCenter);
- subkeyList->setItem(row, 0, tmp0);
+ subkey_list_->setItem(row, 0, tmp0);
auto* tmp1 = new QTableWidgetItem(QString::number(subkeys.GetKeyLength()));
tmp1->setTextAlignment(Qt::AlignCenter);
- subkeyList->setItem(row, 1, tmp1);
+ subkey_list_->setItem(row, 1, tmp1);
auto* tmp2 =
new QTableWidgetItem(QString::fromStdString(subkeys.GetPubkeyAlgo()));
tmp2->setTextAlignment(Qt::AlignCenter);
- subkeyList->setItem(row, 2, tmp2);
+ subkey_list_->setItem(row, 2, tmp2);
auto* tmp3 = new QTableWidgetItem(
QString::fromStdString(to_iso_string(subkeys.GetCreateTime())));
tmp3->setTextAlignment(Qt::AlignCenter);
- subkeyList->setItem(row, 3, tmp3);
+ subkey_list_->setItem(row, 3, tmp3);
auto* tmp4 = new QTableWidgetItem(
boost::posix_time::to_time_t(
@@ -197,53 +198,53 @@ void KeyPairSubkeyTab::slotRefreshSubkeyList() {
? _("Never Expire")
: QString::fromStdString(to_iso_string(subkeys.GetExpireTime())));
tmp4->setTextAlignment(Qt::AlignCenter);
- subkeyList->setItem(row, 4, tmp4);
+ subkey_list_->setItem(row, 4, tmp4);
if (!row) {
- for (auto i = 0; i < subkeyList->columnCount(); i++) {
- subkeyList->item(row, i)->setForeground(QColor(65, 105, 255));
+ for (auto i = 0; i < subkey_list_->columnCount(); i++) {
+ subkey_list_->item(row, i)->setForeground(QColor(65, 105, 255));
}
}
row++;
}
- if (subkeyList->rowCount() > 0) {
- subkeyList->selectRow(0);
+ if (subkey_list_->rowCount() > 0) {
+ subkey_list_->selectRow(0);
}
}
-void KeyPairSubkeyTab::slotAddSubkey() {
+void KeyPairSubkeyTab::slot_add_subkey() {
auto dialog = new SubkeyGenerateDialog(key_.GetId(), this);
dialog->show();
}
-void KeyPairSubkeyTab::slotRefreshSubkeyDetail() {
- auto& subkey = getSelectedSubkey();
+void KeyPairSubkeyTab::slot_refresh_subkey_detail() {
+ auto& subkey = get_selected_subkey();
- keyidVarLabel->setText(QString::fromStdString(subkey.GetID()));
- keySizeVarLabel->setText(QString::number(subkey.GetKeyLength()));
+ key_id_var_label_->setText(QString::fromStdString(subkey.GetID()));
+ key_size_var_label_->setText(QString::number(subkey.GetKeyLength()));
time_t subkey_time_t = boost::posix_time::to_time_t(
boost::posix_time::ptime(subkey.GetExpireTime()));
- expireVarLabel->setText(
+ expire_var_label_->setText(
subkey_time_t == 0 ? _("Never Expires")
: QLocale::system().toString(QDateTime::fromTime_t(
to_time_t(subkey.GetExpireTime()))));
if (subkey_time_t != 0 &&
subkey.GetExpireTime() < boost::posix_time::second_clock::local_time()) {
- auto paletteExpired = expireVarLabel->palette();
- paletteExpired.setColor(expireVarLabel->foregroundRole(), Qt::red);
- expireVarLabel->setPalette(paletteExpired);
+ auto paletteExpired = expire_var_label_->palette();
+ paletteExpired.setColor(expire_var_label_->foregroundRole(), Qt::red);
+ expire_var_label_->setPalette(paletteExpired);
} else {
- auto paletteValid = expireVarLabel->palette();
- paletteValid.setColor(expireVarLabel->foregroundRole(), Qt::darkGreen);
- expireVarLabel->setPalette(paletteValid);
+ auto paletteValid = expire_var_label_->palette();
+ paletteValid.setColor(expire_var_label_->foregroundRole(), Qt::darkGreen);
+ expire_var_label_->setPalette(paletteValid);
}
- algorithmVarLabel->setText(QString::fromStdString(subkey.GetPubkeyAlgo()));
- createdVarLabel->setText(QLocale::system().toString(
+ algorithm_var_label_->setText(QString::fromStdString(subkey.GetPubkeyAlgo()));
+ created_var_label_->setText(QLocale::system().toString(
QDateTime::fromTime_t(to_time_t(subkey.GetCreateTime()))));
std::stringstream usage_steam;
@@ -254,76 +255,79 @@ void KeyPairSubkeyTab::slotRefreshSubkeyDetail() {
if (subkey.IsHasSigningCapability()) usage_steam << _("Sign") << " ";
if (subkey.IsHasAuthenticationCapability()) usage_steam << _("Auth") << " ";
- usageVarLabel->setText(usage_steam.str().c_str());
+ usage_var_label_->setText(usage_steam.str().c_str());
// Show the situation that secret key not exists.
- masterKeyExistVarLabel->setText(subkey.IsSecretKey() ? _("Exists")
- : _("Not Exists"));
+ master_key_exist_var_label_->setText(subkey.IsSecretKey() ? _("Exists")
+ : _("Not Exists"));
// Show the situation if key in a smart card.
- cardKeyLabel->setText(subkey.IsCardKey() ? _("Yes") : _("No"));
+ card_key_label_->setText(subkey.IsCardKey() ? _("Yes") : _("No"));
if (!subkey.IsSecretKey()) {
- auto palette_expired = masterKeyExistVarLabel->palette();
- palette_expired.setColor(masterKeyExistVarLabel->foregroundRole(), Qt::red);
- masterKeyExistVarLabel->setPalette(palette_expired);
+ auto palette_expired = master_key_exist_var_label_->palette();
+ palette_expired.setColor(master_key_exist_var_label_->foregroundRole(),
+ Qt::red);
+ master_key_exist_var_label_->setPalette(palette_expired);
} else {
- auto palette_valid = masterKeyExistVarLabel->palette();
- palette_valid.setColor(masterKeyExistVarLabel->foregroundRole(),
+ auto palette_valid = master_key_exist_var_label_->palette();
+ palette_valid.setColor(master_key_exist_var_label_->foregroundRole(),
Qt::darkGreen);
- masterKeyExistVarLabel->setPalette(palette_valid);
+ master_key_exist_var_label_->setPalette(palette_valid);
}
if (!subkey.IsCardKey()) {
- auto palette_expired = cardKeyLabel->palette();
- palette_expired.setColor(cardKeyLabel->foregroundRole(), Qt::red);
- cardKeyLabel->setPalette(palette_expired);
+ auto palette_expired = card_key_label_->palette();
+ palette_expired.setColor(card_key_label_->foregroundRole(), Qt::red);
+ card_key_label_->setPalette(palette_expired);
} else {
- auto palette_valid = cardKeyLabel->palette();
- palette_valid.setColor(cardKeyLabel->foregroundRole(), Qt::darkGreen);
- cardKeyLabel->setPalette(palette_valid);
+ auto palette_valid = card_key_label_->palette();
+ palette_valid.setColor(card_key_label_->foregroundRole(), Qt::darkGreen);
+ card_key_label_->setPalette(palette_valid);
}
- fingerPrintVarLabel->setText(QString::fromStdString(subkey.GetFingerprint()));
+ fingerprint_var_label_->setText(
+ QString::fromStdString(subkey.GetFingerprint()));
}
-void KeyPairSubkeyTab::createSubkeyOperaMenu() {
- subkeyOperaMenu = new QMenu(this);
+void KeyPairSubkeyTab::create_subkey_opera_menu() {
+ subkey_opera_menu_ = new QMenu(this);
// auto *revokeSubkeyAct = new QAction(_("Revoke Subkey"));
auto* editSubkeyAct = new QAction(_("Edit Expire Date"));
- connect(editSubkeyAct, SIGNAL(triggered(bool)), this, SLOT(slotEditSubkey()));
+ connect(editSubkeyAct, SIGNAL(triggered(bool)), this,
+ SLOT(slot_edit_subkey()));
// subkeyOperaMenu->addAction(revokeSubkeyAct);
- subkeyOperaMenu->addAction(editSubkeyAct);
+ subkey_opera_menu_->addAction(editSubkeyAct);
}
-void KeyPairSubkeyTab::slotEditSubkey() {
- LOG(INFO) << "Fpr" << getSelectedSubkey().GetFingerprint();
+void KeyPairSubkeyTab::slot_edit_subkey() {
+ LOG(INFO) << "Fpr" << get_selected_subkey().GetFingerprint();
auto dialog = new KeySetExpireDateDialog(
- key_.GetId(), getSelectedSubkey().GetFingerprint(), this);
+ key_.GetId(), get_selected_subkey().GetFingerprint(), this);
dialog->show();
}
-void KeyPairSubkeyTab::slotRevokeSubkey() {}
+void KeyPairSubkeyTab::slot_revoke_subkey() {}
void KeyPairSubkeyTab::contextMenuEvent(QContextMenuEvent* event) {
- if (!subkeyList->selectedItems().isEmpty()) {
- subkeyOperaMenu->exec(event->globalPos());
+ if (!subkey_list_->selectedItems().isEmpty()) {
+ subkey_opera_menu_->exec(event->globalPos());
}
}
-const GpgSubKey& KeyPairSubkeyTab::getSelectedSubkey() {
+const GpgSubKey& KeyPairSubkeyTab::get_selected_subkey() {
int row = 0;
- for (int i = 0; i < subkeyList->rowCount(); i++) {
- if (subkeyList->item(row, 0)->isSelected()) break;
+ for (int i = 0; i < subkey_list_->rowCount(); i++) {
+ if (subkey_list_->item(row, 0)->isSelected()) break;
row++;
}
- return buffered_subkeys[row];
+ return buffered_subkeys_[row];
}
-void KeyPairSubkeyTab::slotRefreshKeyInfo() {
+void KeyPairSubkeyTab::slot_refresh_key_info() {
key_ = GpgKeyGetter::GetInstance().GetKey(key_.GetId());
}
diff --git a/src/ui/keypair_details/KeyPairSubkeyTab.h b/src/ui/keypair_details/KeyPairSubkeyTab.h
index f254fed0..ca334686 100644
--- a/src/ui/keypair_details/KeyPairSubkeyTab.h
+++ b/src/ui/keypair_details/KeyPairSubkeyTab.h
@@ -36,49 +36,97 @@ class KeyPairSubkeyTab : public QWidget {
Q_OBJECT
public:
+ /**
+ * @brief Construct a new Key Pair Subkey Tab object
+ *
+ * @param key
+ * @param parent
+ */
KeyPairSubkeyTab(const std::string& key, QWidget* parent);
private:
- void createSubkeyList();
-
- void createSubkeyOperaMenu();
-
- const GpgSubKey& getSelectedSubkey();
-
- GpgKey key_;
- QTableWidget* subkeyList{};
- std::vector<GpgSubKey> buffered_subkeys;
-
- QGroupBox* listBox;
- QGroupBox* detailBox;
-
- QMenu* subkeyOperaMenu{};
-
- QLabel* keySizeVarLabel; /** Label containing the keys key size */
- QLabel* expireVarLabel; /** Label containing the keys expiration date */
- QLabel* createdVarLabel; /** Label containing the keys creation date */
- QLabel* algorithmVarLabel; /** Label containing the keys algorithm */
- QLabel* keyidVarLabel; /** Label containing the keys keyid */
- QLabel* fingerPrintVarLabel; /** Label containing the keys fingerprint */
- QLabel* usageVarLabel;
- QLabel* masterKeyExistVarLabel;
- QLabel* cardKeyLabel;
+ /**
+ * @brief Create a subkey list object
+ *
+ */
+ void create_subkey_list();
+
+ /**
+ * @brief Create a subkey opera menu object
+ *
+ */
+ void create_subkey_opera_menu();
+
+ /**
+ * @brief Get the selected subkey object
+ *
+ * @return const GpgSubKey&
+ */
+ const GpgSubKey& get_selected_subkey();
+
+ GpgKey key_; ///<
+ QTableWidget* subkey_list_{}; ///<
+ std::vector<GpgSubKey> buffered_subkeys_; ///<
+
+ QGroupBox* list_box_; ///<
+ QGroupBox* detail_box_; ///<
+
+ QMenu* subkey_opera_menu_{}; ///<
+
+ QLabel* key_size_var_label_; ///< Label containing the keys key size
+ QLabel* expire_var_label_; ///< Label containing the keys expiration date
+ QLabel* created_var_label_; ///< Label containing the keys creation date
+ QLabel* algorithm_var_label_; ///< Label containing the keys algorithm
+ QLabel* key_id_var_label_; ///< Label containing the keys keyid
+ QLabel* fingerprint_var_label_; ///< Label containing the keys fingerprint
+ QLabel* usage_var_label_; ///<
+ QLabel* master_key_exist_var_label_; ///<
+ QLabel* card_key_label_; ///<
private slots:
- void slotAddSubkey();
-
- void slotRefreshSubkeyList();
-
- void slotRefreshSubkeyDetail();
-
- void slotEditSubkey();
-
- void slotRevokeSubkey();
-
- void slotRefreshKeyInfo();
+ /**
+ * @brief
+ *
+ */
+ void slot_add_subkey();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_subkey_list();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_subkey_detail();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_edit_subkey();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_revoke_subkey();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_key_info();
protected:
+ /**
+ * @brief
+ *
+ * @param event
+ */
void contextMenuEvent(QContextMenuEvent* event) override;
};
diff --git a/src/ui/keypair_details/KeyPairUIDTab.cpp b/src/ui/keypair_details/KeyPairUIDTab.cpp
index 903b93f8..cc5902dc 100644
--- a/src/ui/keypair_details/KeyPairUIDTab.cpp
+++ b/src/ui/keypair_details/KeyPairUIDTab.cpp
@@ -33,20 +33,20 @@
namespace GpgFrontend::UI {
KeyPairUIDTab::KeyPairUIDTab(const std::string& key_id, QWidget* parent)
- : QWidget(parent), mKey(GpgKeyGetter::GetInstance().GetKey(key_id)) {
- createUIDList();
- createSignList();
- createManageUIDMenu();
- createUIDPopupMenu();
- createSignPopupMenu();
+ : QWidget(parent), m_key_(GpgKeyGetter::GetInstance().GetKey(key_id)) {
+ create_uid_list();
+ create_sign_list();
+ create_manage_uid_menu();
+ create_uid_popup_menu();
+ create_sign_popup_menu();
auto uidButtonsLayout = new QGridLayout();
auto addUIDButton = new QPushButton(_("New UID"));
auto manageUIDButton = new QPushButton(_("UID Management"));
- if (mKey.IsHasMasterKey()) {
- manageUIDButton->setMenu(manageSelectedUIDMenu);
+ if (m_key_.IsHasMasterKey()) {
+ manageUIDButton->setMenu(manage_selected_uid_menu_);
} else {
manageUIDButton->setDisabled(true);
}
@@ -56,7 +56,7 @@ KeyPairUIDTab::KeyPairUIDTab(const std::string& key_id, QWidget* parent)
auto grid_layout = new QGridLayout();
- grid_layout->addWidget(uidList, 0, 0);
+ grid_layout->addWidget(uid_list_, 0, 0);
grid_layout->addLayout(uidButtonsLayout, 1, 0);
grid_layout->setContentsMargins(0, 10, 0, 0);
@@ -69,12 +69,12 @@ KeyPairUIDTab::KeyPairUIDTab(const std::string& key_id, QWidget* parent)
tofu_group_box->setLayout(tofu_vbox_layout);
tofu_group_box->setTitle(_("TOFU"));
#if !defined(RELEASE)
- tofuTabs = new QTabWidget(this);
- tofu_vbox_layout->addWidget(tofuTabs);
+ tofu_tabs_ = new QTabWidget(this);
+ tofu_vbox_layout->addWidget(tofu_tabs_);
#endif
auto sign_grid_layout = new QGridLayout();
- sign_grid_layout->addWidget(sigList, 0, 0);
+ sign_grid_layout->addWidget(sig_list_, 0, 0);
sign_grid_layout->setContentsMargins(0, 10, 0, 0);
auto sign_group_box = new QGroupBox();
@@ -91,191 +91,191 @@ KeyPairUIDTab::KeyPairUIDTab(const std::string& key_id, QWidget* parent)
vboxLayout->setContentsMargins(0, 0, 0, 0);
- connect(addUIDButton, SIGNAL(clicked(bool)), this, SLOT(slotAddUID()));
- connect(uidList, SIGNAL(itemSelectionChanged()), this,
- SLOT(slotRefreshTOFUInfo()));
- connect(uidList, SIGNAL(itemSelectionChanged()), this,
- SLOT(slotRefreshSigList()));
+ connect(addUIDButton, SIGNAL(clicked(bool)), this, SLOT(slot_add_uid()));
+ connect(uid_list_, SIGNAL(itemSelectionChanged()), this,
+ SLOT(slot_refresh_tofu_info()));
+ connect(uid_list_, SIGNAL(itemSelectionChanged()), this,
+ SLOT(slot_refresh_sig_list()));
// Key Database Refresh
connect(SignalStation::GetInstance(), SIGNAL(KeyDatabaseRefresh()), this,
- SLOT(slotRefreshKey()));
+ SLOT(slot_refresh_key()));
- connect(this, SIGNAL(signalUpdateUIDInfo()), SignalStation::GetInstance(),
+ connect(this, SIGNAL(SignalUpdateUIDInfo()), SignalStation::GetInstance(),
SIGNAL(KeyDatabaseRefresh()));
setLayout(vboxLayout);
setAttribute(Qt::WA_DeleteOnClose, true);
- slotRefreshUIDList();
+ slot_refresh_uid_list();
}
-void KeyPairUIDTab::createUIDList() {
- uidList = new QTableWidget(this);
- uidList->setColumnCount(4);
- uidList->horizontalHeader()->setSectionResizeMode(
+void KeyPairUIDTab::create_uid_list() {
+ uid_list_ = new QTableWidget(this);
+ uid_list_->setColumnCount(4);
+ uid_list_->horizontalHeader()->setSectionResizeMode(
QHeaderView::ResizeToContents);
- uidList->verticalHeader()->hide();
- uidList->setShowGrid(false);
- uidList->setSelectionBehavior(QAbstractItemView::SelectRows);
- uidList->setSelectionMode(QAbstractItemView::SingleSelection);
+ uid_list_->verticalHeader()->hide();
+ uid_list_->setShowGrid(false);
+ uid_list_->setSelectionBehavior(QAbstractItemView::SelectRows);
+ uid_list_->setSelectionMode(QAbstractItemView::SingleSelection);
// tableitems not editable
- uidList->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ uid_list_->setEditTriggers(QAbstractItemView::NoEditTriggers);
// no focus (rectangle around tableitems)
// may be it should focus on whole row
- uidList->setFocusPolicy(Qt::NoFocus);
- uidList->setAlternatingRowColors(true);
+ uid_list_->setFocusPolicy(Qt::NoFocus);
+ uid_list_->setAlternatingRowColors(true);
QStringList labels;
labels << _("Select") << _("Name") << _("Email") << _("Comment");
- uidList->setHorizontalHeaderLabels(labels);
- uidList->horizontalHeader()->setStretchLastSection(true);
+ uid_list_->setHorizontalHeaderLabels(labels);
+ uid_list_->horizontalHeader()->setStretchLastSection(true);
}
-void KeyPairUIDTab::createSignList() {
- sigList = new QTableWidget(this);
- sigList->setColumnCount(5);
- sigList->horizontalHeader()->setSectionResizeMode(
+void KeyPairUIDTab::create_sign_list() {
+ sig_list_ = new QTableWidget(this);
+ sig_list_->setColumnCount(5);
+ sig_list_->horizontalHeader()->setSectionResizeMode(
QHeaderView::ResizeToContents);
- sigList->verticalHeader()->hide();
- sigList->setShowGrid(false);
- sigList->setSelectionBehavior(QAbstractItemView::SelectRows);
+ sig_list_->verticalHeader()->hide();
+ sig_list_->setShowGrid(false);
+ sig_list_->setSelectionBehavior(QAbstractItemView::SelectRows);
// table items not editable
- sigList->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ sig_list_->setEditTriggers(QAbstractItemView::NoEditTriggers);
// no focus (rectangle around table items)
// may be it should focus on whole row
- sigList->setFocusPolicy(Qt::NoFocus);
- sigList->setAlternatingRowColors(true);
+ sig_list_->setFocusPolicy(Qt::NoFocus);
+ sig_list_->setAlternatingRowColors(true);
QStringList labels;
labels << _("Key ID") << _("Name") << _("Email") << _("Create Date (UTC)")
<< _("Expired Date (UTC)");
- sigList->setHorizontalHeaderLabels(labels);
- sigList->horizontalHeader()->setStretchLastSection(false);
+ sig_list_->setHorizontalHeaderLabels(labels);
+ sig_list_->horizontalHeader()->setStretchLastSection(false);
}
-void KeyPairUIDTab::slotRefreshUIDList() {
+void KeyPairUIDTab::slot_refresh_uid_list() {
int row = 0;
- uidList->setSelectionMode(QAbstractItemView::SingleSelection);
+ uid_list_->setSelectionMode(QAbstractItemView::SingleSelection);
- this->buffered_uids.clear();
+ this->buffered_uids_.clear();
- auto uids = mKey.GetUIDs();
+ auto uids = m_key_.GetUIDs();
for (auto& uid : *uids) {
if (uid.GetInvalid() || uid.GetRevoked()) {
continue;
}
- this->buffered_uids.push_back(std::move(uid));
+ this->buffered_uids_.push_back(std::move(uid));
}
- uidList->setRowCount(buffered_uids.size());
+ uid_list_->setRowCount(buffered_uids_.size());
- for (const auto& uid : buffered_uids) {
+ for (const auto& uid : buffered_uids_) {
auto* tmp0 = new QTableWidgetItem(QString::fromStdString(uid.GetUID()));
- uidList->setItem(row, 1, tmp0);
+ uid_list_->setItem(row, 1, tmp0);
auto* tmp1 = new QTableWidgetItem(QString::fromStdString(uid.GetUID()));
- uidList->setItem(row, 2, tmp1);
+ uid_list_->setItem(row, 2, tmp1);
auto* tmp2 = new QTableWidgetItem(QString::fromStdString(uid.GetUID()));
- uidList->setItem(row, 3, tmp2);
+ uid_list_->setItem(row, 3, tmp2);
auto* tmp3 = new QTableWidgetItem(QString::number(row));
tmp3->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled |
Qt::ItemIsSelectable);
tmp3->setTextAlignment(Qt::AlignCenter);
tmp3->setCheckState(Qt::Unchecked);
- uidList->setItem(row, 0, tmp3);
+ uid_list_->setItem(row, 0, tmp3);
if (!row) {
- for (auto i = 0; i < uidList->columnCount(); i++) {
- uidList->item(row, i)->setForeground(QColor(65, 105, 255));
+ for (auto i = 0; i < uid_list_->columnCount(); i++) {
+ uid_list_->item(row, i)->setForeground(QColor(65, 105, 255));
}
}
row++;
}
- if (uidList->rowCount() > 0) {
- uidList->selectRow(0);
+ if (uid_list_->rowCount() > 0) {
+ uid_list_->selectRow(0);
}
- slotRefreshSigList();
- slotRefreshTOFUInfo();
+ slot_refresh_sig_list();
+ slot_refresh_tofu_info();
}
-void KeyPairUIDTab::slotRefreshTOFUInfo() {
- if (this->tofuTabs == nullptr) return;
+void KeyPairUIDTab::slot_refresh_tofu_info() {
+ if (this->tofu_tabs_ == nullptr) return;
int uidRow = 0;
- tofuTabs->clear();
- for (const auto& uid : buffered_uids) {
+ tofu_tabs_->clear();
+ for (const auto& uid : buffered_uids_) {
// Only Show Selected UID Signatures
- if (!uidList->item(uidRow++, 0)->isSelected()) {
+ if (!uid_list_->item(uidRow++, 0)->isSelected()) {
continue;
}
auto tofu_infos = uid.GetTofuInfos();
LOG(INFO) << "tofu info size" << tofu_infos->size();
if (tofu_infos->empty()) {
- tofuTabs->hide();
+ tofu_tabs_->hide();
} else {
- tofuTabs->show();
+ tofu_tabs_->show();
}
int index = 1;
for (const auto& tofu_info : *tofu_infos) {
- tofuTabs->addTab(new TOFUInfoPage(tofu_info, this),
- QString(_("TOFU %1")).arg(index++));
+ tofu_tabs_->addTab(new TOFUInfoPage(tofu_info, this),
+ QString(_("TOFU %1")).arg(index++));
}
}
}
-void KeyPairUIDTab::slotRefreshSigList() {
+void KeyPairUIDTab::slot_refresh_sig_list() {
int uidRow = 0, sigRow = 0;
- for (const auto& uid : buffered_uids) {
+ for (const auto& uid : buffered_uids_) {
// Only Show Selected UID Signatures
- if (!uidList->item(uidRow++, 0)->isSelected()) {
+ if (!uid_list_->item(uidRow++, 0)->isSelected()) {
continue;
}
- buffered_signatures.clear();
+ buffered_signatures_.clear();
auto signatures = uid.GetSignatures();
for (auto& sig : *signatures) {
if (sig.IsInvalid() || sig.IsRevoked()) {
continue;
}
- buffered_signatures.push_back(std::move(sig));
+ buffered_signatures_.push_back(std::move(sig));
}
- sigList->setRowCount(buffered_signatures.size());
+ sig_list_->setRowCount(buffered_signatures_.size());
- for (const auto& sig : buffered_signatures) {
+ for (const auto& sig : buffered_signatures_) {
auto* tmp0 = new QTableWidgetItem(QString::fromStdString(sig.GetKeyID()));
- sigList->setItem(sigRow, 0, tmp0);
+ sig_list_->setItem(sigRow, 0, tmp0);
if (gpgme_err_code(sig.GetStatus()) == GPG_ERR_NO_PUBKEY) {
auto* tmp2 = new QTableWidgetItem("<Unknown>");
- sigList->setItem(sigRow, 1, tmp2);
+ sig_list_->setItem(sigRow, 1, tmp2);
auto* tmp3 = new QTableWidgetItem("<Unknown>");
- sigList->setItem(sigRow, 2, tmp3);
+ sig_list_->setItem(sigRow, 2, tmp3);
} else {
auto* tmp2 =
new QTableWidgetItem(QString::fromStdString(sig.GetName()));
- sigList->setItem(sigRow, 1, tmp2);
+ sig_list_->setItem(sigRow, 1, tmp2);
auto* tmp3 =
new QTableWidgetItem(QString::fromStdString(sig.GetEmail()));
- sigList->setItem(sigRow, 2, tmp3);
+ sig_list_->setItem(sigRow, 2, tmp3);
}
auto* tmp4 = new QTableWidgetItem(QLocale::system().toString(
QDateTime::fromTime_t(to_time_t(sig.GetCreateTime()))));
- sigList->setItem(sigRow, 3, tmp4);
+ sig_list_->setItem(sigRow, 3, tmp4);
auto* tmp5 = new QTableWidgetItem(
boost::posix_time::to_time_t(
@@ -284,7 +284,7 @@ void KeyPairUIDTab::slotRefreshSigList() {
: QLocale::system().toString(
QDateTime::fromTime_t(to_time_t(sig.GetExpireTime()))));
tmp5->setTextAlignment(Qt::AlignCenter);
- sigList->setItem(sigRow, 4, tmp5);
+ sig_list_->setItem(sigRow, 4, tmp5);
sigRow++;
}
@@ -293,8 +293,8 @@ void KeyPairUIDTab::slotRefreshSigList() {
}
}
-void KeyPairUIDTab::slotAddSign() {
- auto selected_uids = getUIDChecked();
+void KeyPairUIDTab::slot_add_sign() {
+ auto selected_uids = get_uid_checked();
if (selected_uids->empty()) {
QMessageBox::information(
@@ -304,43 +304,43 @@ void KeyPairUIDTab::slotAddSign() {
}
auto keySignDialog =
- new KeyUIDSignDialog(mKey, std::move(selected_uids), this);
+ new KeyUIDSignDialog(m_key_, std::move(selected_uids), this);
keySignDialog->show();
}
-UIDArgsListPtr KeyPairUIDTab::getUIDChecked() {
+UIDArgsListPtr KeyPairUIDTab::get_uid_checked() {
auto selected_uids = std::make_unique<UIDArgsList>();
- for (int i = 0; i < uidList->rowCount(); i++) {
- if (uidList->item(i, 0)->checkState() == Qt::Checked)
- selected_uids->push_back(buffered_uids[i].GetUID());
+ for (int i = 0; i < uid_list_->rowCount(); i++) {
+ if (uid_list_->item(i, 0)->checkState() == Qt::Checked)
+ selected_uids->push_back(buffered_uids_[i].GetUID());
}
return selected_uids;
}
-void KeyPairUIDTab::createManageUIDMenu() {
- manageSelectedUIDMenu = new QMenu(this);
+void KeyPairUIDTab::create_manage_uid_menu() {
+ manage_selected_uid_menu_ = new QMenu(this);
auto* signUIDAct = new QAction(_("Sign Selected UID(s)"), this);
- connect(signUIDAct, SIGNAL(triggered()), this, SLOT(slotAddSign()));
+ connect(signUIDAct, SIGNAL(triggered()), this, SLOT(slot_add_sign()));
auto* delUIDAct = new QAction(_("Delete Selected UID(s)"), this);
- connect(delUIDAct, SIGNAL(triggered()), this, SLOT(slotDelUID()));
+ connect(delUIDAct, SIGNAL(triggered()), this, SLOT(slot_del_uid()));
- if (mKey.IsHasMasterKey()) {
- manageSelectedUIDMenu->addAction(signUIDAct);
- manageSelectedUIDMenu->addAction(delUIDAct);
+ if (m_key_.IsHasMasterKey()) {
+ manage_selected_uid_menu_->addAction(signUIDAct);
+ manage_selected_uid_menu_->addAction(delUIDAct);
}
}
-void KeyPairUIDTab::slotAddUID() {
- auto keyNewUIDDialog = new KeyNewUIDDialog(mKey.GetId(), this);
+void KeyPairUIDTab::slot_add_uid() {
+ auto keyNewUIDDialog = new KeyNewUIDDialog(m_key_.GetId(), this);
connect(keyNewUIDDialog, SIGNAL(finished(int)), this,
- SLOT(slotAddUIDResult(int)));
+ SLOT(slot_add_uid_result(int)));
connect(keyNewUIDDialog, SIGNAL(finished(int)), keyNewUIDDialog,
SLOT(deleteLater()));
keyNewUIDDialog->show();
}
-void KeyPairUIDTab::slotAddUIDResult(int result) {
+void KeyPairUIDTab::slot_add_uid_result(int result) {
if (result == 1) {
QMessageBox::information(nullptr, _("Successful Operation"),
_("Successfully added a new UID."));
@@ -350,8 +350,8 @@ void KeyPairUIDTab::slotAddUIDResult(int result) {
}
}
-void KeyPairUIDTab::slotDelUID() {
- auto selected_uids = getUIDChecked();
+void KeyPairUIDTab::slot_del_uid() {
+ auto selected_uids = get_uid_checked();
if (selected_uids->empty()) {
QMessageBox::information(
@@ -377,20 +377,20 @@ void KeyPairUIDTab::slotDelUID() {
if (ret == QMessageBox::Yes) {
for (const auto& uid : *selected_uids) {
- LOG(INFO) << "KeyPairUIDTab::slotDelUID UID" << uid;
- if (!UIDOperator::GetInstance().RevUID(mKey, uid)) {
+ LOG(INFO) << "KeyPairUIDTab::slot_del_uid UID" << uid;
+ if (!UIDOperator::GetInstance().RevUID(m_key_, uid)) {
QMessageBox::critical(
nullptr, _("Operation Failed"),
QString(_("An error occurred during the delete %1 operation."))
.arg(uid.c_str()));
}
}
- emit signalUpdateUIDInfo();
+ emit SignalUpdateUIDInfo();
}
}
-void KeyPairUIDTab::slotSetPrimaryUID() {
- auto selected_uids = getUIDSelected();
+void KeyPairUIDTab::slot_set_primary_uid() {
+ auto selected_uids = get_uid_selected();
if (selected_uids->empty()) {
auto emptyUIDMsg = new QMessageBox();
@@ -413,59 +413,59 @@ void KeyPairUIDTab::slotSetPrimaryUID() {
QMessageBox::No | QMessageBox::Yes);
if (ret == QMessageBox::Yes) {
- if (!UIDOperator::GetInstance().SetPrimaryUID(mKey,
+ if (!UIDOperator::GetInstance().SetPrimaryUID(m_key_,
selected_uids->front())) {
QMessageBox::critical(nullptr, _("Operation Failed"),
_("An error occurred during the operation."));
} else {
- emit signalUpdateUIDInfo();
+ emit SignalUpdateUIDInfo();
}
}
}
-UIDArgsListPtr KeyPairUIDTab::getUIDSelected() {
+UIDArgsListPtr KeyPairUIDTab::get_uid_selected() {
auto uids = std::make_unique<UIDArgsList>();
- for (int i = 0; i < uidList->rowCount(); i++) {
- if (uidList->item(i, 0)->isSelected()) {
- uids->push_back(buffered_uids[i].GetUID());
+ for (int i = 0; i < uid_list_->rowCount(); i++) {
+ if (uid_list_->item(i, 0)->isSelected()) {
+ uids->push_back(buffered_uids_[i].GetUID());
}
}
return uids;
}
-SignIdArgsListPtr KeyPairUIDTab::getSignSelected() {
+SignIdArgsListPtr KeyPairUIDTab::get_sign_selected() {
auto signatures = std::make_unique<SignIdArgsList>();
- for (int i = 0; i < sigList->rowCount(); i++) {
- if (sigList->item(i, 0)->isSelected()) {
- auto& sign = buffered_signatures[i];
+ for (int i = 0; i < sig_list_->rowCount(); i++) {
+ if (sig_list_->item(i, 0)->isSelected()) {
+ auto& sign = buffered_signatures_[i];
signatures->push_back({sign.GetKeyID(), sign.GetUID()});
}
}
return signatures;
}
-void KeyPairUIDTab::createUIDPopupMenu() {
- uidPopupMenu = new QMenu(this);
+void KeyPairUIDTab::create_uid_popup_menu() {
+ uid_popup_menu_ = new QMenu(this);
auto* serPrimaryUIDAct = new QAction(_("Set As Primary"), this);
connect(serPrimaryUIDAct, SIGNAL(triggered()), this,
- SLOT(slotSetPrimaryUID()));
+ SLOT(slot_set_primary_uid()));
auto* signUIDAct = new QAction(_("Sign UID"), this);
- connect(signUIDAct, SIGNAL(triggered()), this, SLOT(slotAddSignSingle()));
+ connect(signUIDAct, SIGNAL(triggered()), this, SLOT(slot_add_sign_single()));
auto* delUIDAct = new QAction(_("Delete UID"), this);
- connect(delUIDAct, SIGNAL(triggered()), this, SLOT(slotDelUIDSingle()));
+ connect(delUIDAct, SIGNAL(triggered()), this, SLOT(slot_del_uid_single()));
- if (mKey.IsHasMasterKey()) {
- uidPopupMenu->addAction(serPrimaryUIDAct);
- uidPopupMenu->addAction(signUIDAct);
- uidPopupMenu->addAction(delUIDAct);
+ if (m_key_.IsHasMasterKey()) {
+ uid_popup_menu_->addAction(serPrimaryUIDAct);
+ uid_popup_menu_->addAction(signUIDAct);
+ uid_popup_menu_->addAction(delUIDAct);
}
}
void KeyPairUIDTab::contextMenuEvent(QContextMenuEvent* event) {
- if (uidList->selectedItems().length() > 0 &&
- sigList->selectedItems().isEmpty()) {
- uidPopupMenu->exec(event->globalPos());
+ if (uid_list_->selectedItems().length() > 0 &&
+ sig_list_->selectedItems().isEmpty()) {
+ uid_popup_menu_->exec(event->globalPos());
}
// if (!sigList->selectedItems().isEmpty()) {
@@ -473,8 +473,8 @@ void KeyPairUIDTab::contextMenuEvent(QContextMenuEvent* event) {
// }
}
-void KeyPairUIDTab::slotAddSignSingle() {
- auto selected_uids = getUIDSelected();
+void KeyPairUIDTab::slot_add_sign_single() {
+ auto selected_uids = get_uid_selected();
if (selected_uids->empty()) {
QMessageBox::information(
@@ -484,12 +484,12 @@ void KeyPairUIDTab::slotAddSignSingle() {
}
auto keySignDialog =
- new KeyUIDSignDialog(mKey, std::move(selected_uids), this);
+ new KeyUIDSignDialog(m_key_, std::move(selected_uids), this);
keySignDialog->show();
}
-void KeyPairUIDTab::slotDelUIDSingle() {
- auto selected_uids = getUIDSelected();
+void KeyPairUIDTab::slot_del_uid_single() {
+ auto selected_uids = get_uid_selected();
if (selected_uids->empty()) {
QMessageBox::information(
nullptr, _("Invalid Operation"),
@@ -512,26 +512,26 @@ void KeyPairUIDTab::slotDelUIDSingle() {
QMessageBox::No | QMessageBox::Yes);
if (ret == QMessageBox::Yes) {
- if (!UIDOperator::GetInstance().RevUID(mKey, selected_uids->front())) {
+ if (!UIDOperator::GetInstance().RevUID(m_key_, selected_uids->front())) {
QMessageBox::critical(nullptr, _("Operation Failed"),
_("An error occurred during the operation."));
} else {
- emit signalUpdateUIDInfo();
+ emit SignalUpdateUIDInfo();
}
}
}
-void KeyPairUIDTab::createSignPopupMenu() {
- signPopupMenu = new QMenu(this);
+void KeyPairUIDTab::create_sign_popup_menu() {
+ sign_popup_menu_ = new QMenu(this);
auto* delSignAct = new QAction(_("Delete(Revoke) Key Signature"), this);
- connect(delSignAct, SIGNAL(triggered()), this, SLOT(slotDelSign()));
+ connect(delSignAct, SIGNAL(triggered()), this, SLOT(slot_del_sign()));
- signPopupMenu->addAction(delSignAct);
+ sign_popup_menu_->addAction(delSignAct);
}
-void KeyPairUIDTab::slotDelSign() {
- auto selected_signs = getSignSelected();
+void KeyPairUIDTab::slot_del_sign() {
+ auto selected_signs = get_sign_selected();
if (selected_signs->empty()) {
QMessageBox::information(
nullptr, _("Invalid Operation"),
@@ -564,17 +564,17 @@ void KeyPairUIDTab::slotDelSign() {
QMessageBox::No | QMessageBox::Yes);
if (ret == QMessageBox::Yes) {
- if (!GpgKeyManager::GetInstance().RevSign(mKey, selected_signs)) {
+ if (!GpgKeyManager::GetInstance().RevSign(m_key_, selected_signs)) {
QMessageBox::critical(nullptr, _("Operation Failed"),
_("An error occurred during the operation."));
}
}
}
-void KeyPairUIDTab::slotRefreshKey() {
- this->mKey = GpgKeyGetter::GetInstance().GetKey(this->mKey.GetId());
- this->slotRefreshUIDList();
- this->slotRefreshTOFUInfo();
- this->slotRefreshSigList();
+void KeyPairUIDTab::slot_refresh_key() {
+ this->m_key_ = GpgKeyGetter::GetInstance().GetKey(this->m_key_.GetId());
+ this->slot_refresh_uid_list();
+ this->slot_refresh_tofu_info();
+ this->slot_refresh_sig_list();
}
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyPairUIDTab.h b/src/ui/keypair_details/KeyPairUIDTab.h
index 823935d4..00d46d95 100644
--- a/src/ui/keypair_details/KeyPairUIDTab.h
+++ b/src/ui/keypair_details/KeyPairUIDTab.h
@@ -36,65 +36,165 @@ class KeyPairUIDTab : public QWidget {
Q_OBJECT
public:
+ /**
+ * @brief Construct a new Key Pair U I D Tab object
+ *
+ * @param key_id
+ * @param parent
+ */
KeyPairUIDTab(const std::string& key_id, QWidget* parent);
signals:
- void signalUpdateUIDInfo();
- private:
- GpgKey mKey;
- QTableWidget* uidList{};
- QTableWidget* sigList{};
- QTabWidget* tofuTabs{};
- QMenu* manageSelectedUIDMenu{};
- QMenu* uidPopupMenu{};
- QMenu* signPopupMenu{};
- std::vector<GpgUID> buffered_uids;
- std::vector<GpgKeySignature> buffered_signatures;
-
- void createUIDList();
-
- void createSignList();
-
- void createManageUIDMenu();
-
- void createUIDPopupMenu();
+ /**
+ * @brief
+ *
+ */
+ void SignalUpdateUIDInfo();
- void createSignPopupMenu();
-
- UIDArgsListPtr getUIDChecked();
-
- UIDArgsListPtr getUIDSelected();
-
- SignIdArgsListPtr getSignSelected();
+ private:
+ GpgKey m_key_;
+ QTableWidget* uid_list_{}; ///<
+ QTableWidget* sig_list_{}; ///<
+ QTabWidget* tofu_tabs_{}; ///<
+ QMenu* manage_selected_uid_menu_{}; ///<
+ QMenu* uid_popup_menu_{}; ///<
+ QMenu* sign_popup_menu_{}; ///<
+ std::vector<GpgUID> buffered_uids_; ///<
+ std::vector<GpgKeySignature> buffered_signatures_; ///<
+
+ /**
+ * @brief Create a uid list object
+ *
+ */
+ void create_uid_list();
+
+ /**
+ * @brief Create a sign list object
+ *
+ */
+ void create_sign_list();
+
+ /**
+ * @brief Create a manage uid menu object
+ *
+ */
+ void create_manage_uid_menu();
+
+ /**
+ * @brief Create a uid popup menu object
+ *
+ */
+ void create_uid_popup_menu();
+
+ /**
+ * @brief Create a sign popup menu object
+ *
+ */
+ void create_sign_popup_menu();
+
+ /**
+ * @brief Get the uid checked object
+ *
+ * @return UIDArgsListPtr
+ */
+ UIDArgsListPtr get_uid_checked();
+
+ /**
+ * @brief Get the uid selected object
+ *
+ * @return UIDArgsListPtr
+ */
+ UIDArgsListPtr get_uid_selected();
+
+ /**
+ * @brief Get the sign selected object
+ *
+ * @return SignIdArgsListPtr
+ */
+ SignIdArgsListPtr get_sign_selected();
private slots:
- void slotRefreshUIDList();
-
- void slotRefreshTOFUInfo();
-
- void slotRefreshSigList();
-
- void slotAddSign();
-
- void slotAddSignSingle();
-
- void slotAddUID();
-
- void slotDelUID();
-
- void slotDelUIDSingle();
-
- void slotSetPrimaryUID();
-
- void slotDelSign();
-
- void slotRefreshKey();
-
- static void slotAddUIDResult(int result);
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_uid_list();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_tofu_info();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_sig_list();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_add_sign();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_add_sign_single();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_add_uid();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_del_uid();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_del_uid_single();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_set_primary_uid();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_del_sign();
+
+ /**
+ * @brief
+ *
+ */
+ void slot_refresh_key();
+
+ /**
+ * @brief
+ *
+ * @param result
+ */
+ static void slot_add_uid_result(int result);
protected:
+ /**
+ * @brief
+ *
+ * @param event
+ */
void contextMenuEvent(QContextMenuEvent* event) override;
};
diff --git a/src/ui/keypair_details/KeySetExpireDateDialog.cpp b/src/ui/keypair_details/KeySetExpireDateDialog.cpp
index 756916bb..29f1c1ae 100644
--- a/src/ui/keypair_details/KeySetExpireDateDialog.cpp
+++ b/src/ui/keypair_details/KeySetExpireDateDialog.cpp
@@ -37,8 +37,8 @@ namespace GpgFrontend::UI {
KeySetExpireDateDialog::KeySetExpireDateDialog(const KeyId& key_id,
QWidget* parent)
: QDialog(parent),
- ui(std::make_shared<Ui_ModifiedExpirationDateTime>()),
- mKey(GpgKeyGetter::GetInstance().GetKey(key_id)) {
+ ui_(std::make_shared<Ui_ModifiedExpirationDateTime>()),
+ m_key_(GpgKeyGetter::GetInstance().GetKey(key_id)) {
init();
}
@@ -46,26 +46,26 @@ KeySetExpireDateDialog::KeySetExpireDateDialog(const KeyId& key_id,
std::string subkey_fpr,
QWidget* parent)
: QDialog(parent),
- ui(std::make_shared<Ui_ModifiedExpirationDateTime>()),
- mKey(GpgKeyGetter::GetInstance().GetKey(key_id)),
- mSubkey(std::move(subkey_fpr)) {
+ ui_(std::make_shared<Ui_ModifiedExpirationDateTime>()),
+ m_key_(GpgKeyGetter::GetInstance().GetKey(key_id)),
+ m_subkey_(std::move(subkey_fpr)) {
init();
}
-void KeySetExpireDateDialog::slotConfirm() {
- LOG(INFO) << "Called" << ui->dateEdit->date().toString().toStdString()
- << ui->timeEdit->time().toString().toStdString();
- auto datetime = QDateTime(ui->dateEdit->date(), ui->timeEdit->time());
+void KeySetExpireDateDialog::slot_confirm() {
+ LOG(INFO) << "Called" << ui_->dateEdit->date().toString().toStdString()
+ << ui_->timeEdit->time().toString().toStdString();
+ auto datetime = QDateTime(ui_->dateEdit->date(), ui_->timeEdit->time());
std::unique_ptr<boost::posix_time::ptime> expires = nullptr;
- if (ui->noExpirationCheckBox->checkState() == Qt::Unchecked) {
+ if (ui_->noExpirationCheckBox->checkState() == Qt::Unchecked) {
expires = std::make_unique<boost::posix_time::ptime>(
boost::posix_time::from_time_t(datetime.toLocalTime().toTime_t()));
- LOG(INFO) << "keyid" << mKey.GetId() << mSubkey << *expires;
+ LOG(INFO) << "keyid" << m_key_.GetId() << m_subkey_ << *expires;
} else {
- LOG(INFO) << "keyid" << mKey.GetId() << mSubkey << "Non Expired";
+ LOG(INFO) << "keyid" << m_key_.GetId() << m_subkey_ << "Non Expired";
}
- auto err = GpgKeyOpera::GetInstance().SetExpire(mKey, mSubkey, expires);
+ auto err = GpgKeyOpera::GetInstance().SetExpire(m_key_, m_subkey_, expires);
if (check_gpg_error_2_err_code(err) == GPG_ERR_NO_ERROR) {
auto* msg_box = new QMessageBox(nullptr);
@@ -76,7 +76,7 @@ void KeySetExpireDateDialog::slotConfirm() {
msg_box->setModal(false);
msg_box->open();
- emit signalKeyExpireDateUpdated();
+ emit SignalKeyExpireDateUpdated();
} else {
QMessageBox::critical(this, _("Failure"), _(gpgme_strerror(err)));
@@ -86,7 +86,7 @@ void KeySetExpireDateDialog::slotConfirm() {
}
void KeySetExpireDateDialog::init() {
- ui->setupUi(this);
+ ui_->setupUi(this);
auto& settings = GlobalSettingStation::GetInstance().GetUISettings();
@@ -106,31 +106,31 @@ void KeySetExpireDateDialog::init() {
auto min_date_time = QDateTime::currentDateTime().addDays(7);
- ui->dateEdit->setMaximumDateTime(max_date_time);
- ui->dateEdit->setMinimumDateTime(min_date_time);
+ ui_->dateEdit->setMaximumDateTime(max_date_time);
+ ui_->dateEdit->setMinimumDateTime(min_date_time);
- ui->dateEdit->setDateTime(max_date_time);
- ui->timeEdit->setDateTime(max_date_time);
+ ui_->dateEdit->setDateTime(max_date_time);
+ ui_->timeEdit->setDateTime(max_date_time);
- connect(ui->noExpirationCheckBox, SIGNAL(stateChanged(int)), this,
- SLOT(slotNonExpiredChecked(int)));
- connect(ui->button_box_, &QDialogButtonBox::accepted, this,
- &KeySetExpireDateDialog::slotConfirm);
- connect(this, SIGNAL(signalKeyExpireDateUpdated()),
+ connect(ui_->noExpirationCheckBox, SIGNAL(stateChanged(int)), this,
+ SLOT(slot_non_expired_checked(int)));
+ connect(ui_->button_box_, &QDialogButtonBox::accepted, this,
+ &KeySetExpireDateDialog::slot_confirm);
+ connect(this, SIGNAL(SignalKeyExpireDateUpdated()),
SignalStation::GetInstance(), SIGNAL(KeyDatabaseRefresh()));
- ui->titleLabel->setText(_("Modified Expiration Date (Local Time)"));
- ui->label->setText(
+ ui_->titleLabel->setText(_("Modified Expiration Date (Local Time)"));
+ ui_->label->setText(
_("Tips: For the sake of security, the key is valid for up to two years. "
"If you are an expert user, please unlock it for a longer time in the "
"settings."));
- ui->noExpirationCheckBox->setText(_("No Expiration"));
+ ui_->noExpirationCheckBox->setText(_("No Expiration"));
this->setWindowTitle(_("Modified Expiration Date"));
}
-void KeySetExpireDateDialog::slotNonExpiredChecked(int state) {
- ui->dateEdit->setDisabled(state == Qt::Checked);
- ui->timeEdit->setDisabled(state == Qt::Checked);
+void KeySetExpireDateDialog::slot_non_expired_checked(int state) {
+ ui_->dateEdit->setDisabled(state == Qt::Checked);
+ ui_->timeEdit->setDisabled(state == Qt::Checked);
}
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeySetExpireDateDialog.h b/src/ui/keypair_details/KeySetExpireDateDialog.h
index d4386e43..3501794d 100644
--- a/src/ui/keypair_details/KeySetExpireDateDialog.h
+++ b/src/ui/keypair_details/KeySetExpireDateDialog.h
@@ -37,25 +37,56 @@ namespace GpgFrontend::UI {
class KeySetExpireDateDialog : public QDialog {
Q_OBJECT
public:
+ /**
+ * @brief Construct a new Key Set Expire Date Dialog object
+ *
+ * @param key_id
+ * @param parent
+ */
explicit KeySetExpireDateDialog(const KeyId& key_id,
QWidget* parent = nullptr);
+ /**
+ * @brief Construct a new Key Set Expire Date Dialog object
+ *
+ * @param key_id
+ * @param subkey_fpr
+ * @param parent
+ */
explicit KeySetExpireDateDialog(const KeyId& key_id, std::string subkey_fpr,
QWidget* parent = nullptr);
signals:
- void signalKeyExpireDateUpdated();
+ /**
+ * @brief
+ *
+ */
+ void SignalKeyExpireDateUpdated();
private:
+ /**
+ * @brief
+ *
+ */
void init();
- std::shared_ptr<Ui_ModifiedExpirationDateTime> ui;
- const GpgKey mKey;
- const SubkeyId mSubkey;
+ std::shared_ptr<Ui_ModifiedExpirationDateTime> ui_; ///<
+ const GpgKey m_key_; ///<
+ const SubkeyId m_subkey_; ///<
private slots:
- void slotConfirm();
- void slotNonExpiredChecked(int state);
+ /**
+ * @brief
+ *
+ */
+ void slot_confirm();
+
+ /**
+ * @brief
+ *
+ * @param state
+ */
+ void slot_non_expired_checked(int state);
};
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyUIDSignDialog.cpp b/src/ui/keypair_details/KeyUIDSignDialog.cpp
index fff38383..53f6c325 100644
--- a/src/ui/keypair_details/KeyUIDSignDialog.cpp
+++ b/src/ui/keypair_details/KeyUIDSignDialog.cpp
@@ -32,59 +32,60 @@ namespace GpgFrontend::UI {
KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid,
QWidget* parent)
- : QDialog(parent), mUids(std::move(uid)), mKey(key) {
- const auto key_id = mKey.GetId();
- mKeyList = new KeyList(KeyMenuAbility::NONE, this);
- mKeyList->addListGroupTab(_("Signers"), KeyListRow::ONLY_SECRET_KEY,
- KeyListColumn::NAME | KeyListColumn::EmailAddress,
- [key_id](const GpgKey& key) -> bool {
- if (key.IsDisabled() ||
- !key.IsHasCertificationCapability() ||
- !key.IsHasMasterKey() || key.IsExpired() ||
- key.IsRevoked() || key_id == key.GetId())
- return false;
- else
- return true;
- });
- mKeyList->slotRefresh();
-
- signKeyButton = new QPushButton("Sign");
+ : QDialog(parent), m_uids_(std::move(uid)), m_key_(key) {
+ const auto key_id = m_key_.GetId();
+ m_key_list_ = new KeyList(KeyMenuAbility::NONE, this);
+ m_key_list_->addListGroupTab(
+ _("Signers"), KeyListRow::ONLY_SECRET_KEY,
+ KeyListColumn::NAME | KeyListColumn::EmailAddress,
+ [key_id](const GpgKey& key) -> bool {
+ if (key.IsDisabled() || !key.IsHasCertificationCapability() ||
+ !key.IsHasMasterKey() || key.IsExpired() || key.IsRevoked() ||
+ key_id == key.GetId())
+ return false;
+ else
+ return true;
+ });
+ m_key_list_->slotRefresh();
+
+ sign_key_button_ = new QPushButton("Sign");
/**
* A DateTime after 5 Years is recommend.
*/
- expiresEdit = new QDateTimeEdit(QDateTime::currentDateTime().addYears(5));
- expiresEdit->setMinimumDateTime(QDateTime::currentDateTime());
+ expires_edit_ = new QDateTimeEdit(QDateTime::currentDateTime().addYears(5));
+ expires_edit_->setMinimumDateTime(QDateTime::currentDateTime());
/**
* Note further that the OpenPGP protocol uses 32 bit values for timestamps
* and thus can only encode dates up to the year 2106.
*/
- expiresEdit->setMaximumDate(QDate(2106, 1, 1));
+ expires_edit_->setMaximumDate(QDate(2106, 1, 1));
- nonExpireCheck = new QCheckBox("Non Expired");
- nonExpireCheck->setTristate(false);
+ non_expire_check_ = new QCheckBox("Non Expired");
+ non_expire_check_->setTristate(false);
- connect(nonExpireCheck, &QCheckBox::stateChanged, this,
+ connect(non_expire_check_, &QCheckBox::stateChanged, this,
[this](int state) -> void {
if (state == 0)
- expiresEdit->setDisabled(false);
+ expires_edit_->setDisabled(false);
else
- expiresEdit->setDisabled(true);
+ expires_edit_->setDisabled(true);
});
auto layout = new QGridLayout();
auto timeLayout = new QGridLayout();
- layout->addWidget(mKeyList, 0, 0);
- layout->addWidget(signKeyButton, 2, 0, Qt::AlignRight);
+ layout->addWidget(m_key_list_, 0, 0);
+ layout->addWidget(sign_key_button_, 2, 0, Qt::AlignRight);
timeLayout->addWidget(new QLabel(_("Expire Date")), 0, 0);
- timeLayout->addWidget(expiresEdit, 0, 1);
- timeLayout->addWidget(nonExpireCheck, 0, 2);
+ timeLayout->addWidget(expires_edit_, 0, 1);
+ timeLayout->addWidget(non_expire_check_, 0, 2);
layout->addLayout(timeLayout, 1, 0);
- connect(signKeyButton, SIGNAL(clicked(bool)), this, SLOT(slotSignKey(bool)));
+ connect(sign_key_button_, SIGNAL(clicked(bool)), this,
+ SLOT(slot_sign_key(bool)));
this->setLayout(layout);
this->setModal(true);
@@ -93,26 +94,26 @@ KeyUIDSignDialog::KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid,
setAttribute(Qt::WA_DeleteOnClose, true);
- connect(this, SIGNAL(signalKeyUIDSignUpdate()), SignalStation::GetInstance(),
+ connect(this, SIGNAL(SignalKeyUIDSignUpdate()), SignalStation::GetInstance(),
SIGNAL(KeyDatabaseRefresh()));
}
-void KeyUIDSignDialog::slotSignKey(bool clicked) {
+void KeyUIDSignDialog::slot_sign_key(bool clicked) {
LOG(INFO) << "Called";
// Set Signers
- auto key_ids = mKeyList->getChecked();
+ auto key_ids = m_key_list_->getChecked();
auto keys = GpgKeyGetter::GetInstance().GetKeys(key_ids);
LOG(INFO) << "Key Info Got";
auto expires = std::make_unique<boost::posix_time::ptime>(
- boost::posix_time::from_time_t(expiresEdit->dateTime().toTime_t()));
+ boost::posix_time::from_time_t(expires_edit_->dateTime().toTime_t()));
LOG(INFO) << "Sign Start";
- for (const auto& uid : *mUids) {
+ for (const auto& uid : *m_uids_) {
LOG(INFO) << "Sign UID" << uid;
// Sign For mKey
- if (!GpgKeyManager::GetInstance().SignKey(mKey, *keys, uid, expires)) {
+ if (!GpgKeyManager::GetInstance().SignKey(m_key_, *keys, uid, expires)) {
QMessageBox::critical(
nullptr, _("Unsuccessful Operation"),
QString(_("Signature operation failed for UID %1")).arg(uid.c_str()));
@@ -122,7 +123,7 @@ void KeyUIDSignDialog::slotSignKey(bool clicked) {
QMessageBox::information(nullptr, _("Operation Complete"),
_("The signature operation of the UID is complete"));
this->close();
- emit signalKeyUIDSignUpdate();
+ emit SignalKeyUIDSignUpdate();
}
} // namespace GpgFrontend::UI
diff --git a/src/ui/keypair_details/KeyUIDSignDialog.h b/src/ui/keypair_details/KeyUIDSignDialog.h
index 8a83977a..aedc023f 100644
--- a/src/ui/keypair_details/KeyUIDSignDialog.h
+++ b/src/ui/keypair_details/KeyUIDSignDialog.h
@@ -35,28 +35,39 @@ class KeyUIDSignDialog : public QDialog {
Q_OBJECT
public:
+ /**
+ * @brief Construct a new Key U I D Sign Dialog object
+ *
+ * @param key
+ * @param uid
+ * @param parent
+ */
explicit KeyUIDSignDialog(const GpgKey& key, UIDArgsListPtr uid,
QWidget* parent = nullptr);
signals:
- void signalKeyUIDSignUpdate();
+ /**
+ * @brief
+ *
+ */
+ void SignalKeyUIDSignUpdate();
private:
- KeyList* mKeyList;
+ KeyList* m_key_list_; ///<
+ QPushButton* sign_key_button_; ///<
+ QDateTimeEdit* expires_edit_; ///<
+ QCheckBox* non_expire_check_; ///<
+ UIDArgsListPtr m_uids_; ///<
- QPushButton* signKeyButton;
-
- QDateTimeEdit* expiresEdit;
-
- QCheckBox* nonExpireCheck;
-
- UIDArgsListPtr mUids;
-
- const GpgKey& mKey;
+ const GpgKey& m_key_; ///<
private slots:
-
- void slotSignKey(bool clicked);
+ /**
+ * @brief
+ *
+ * @param clicked
+ */
+ void slot_sign_key(bool clicked);
};
} // namespace GpgFrontend::UI