aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/KeyMgmt.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-29 19:29:56 +0000
committersaturneric <[email protected]>2024-07-29 19:29:56 +0000
commitfa90ec4b5315b9e70a44a9625c143ce253f0e885 (patch)
tree8ffa82e33522de03974d6d0289aa831b4fd6ebdf /src/ui/main_window/KeyMgmt.cpp
parentfix: correct urls at appdata.xml (diff)
parentMerge branch 'develop' of github.com:saturneric/GpgFrontend into develop (diff)
downloadGpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.tar.gz
GpgFrontend-fa90ec4b5315b9e70a44a9625c143ce253f0e885.zip
Merge branch 'develop'
Diffstat (limited to 'src/ui/main_window/KeyMgmt.cpp')
-rw-r--r--src/ui/main_window/KeyMgmt.cpp48
1 files changed, 20 insertions, 28 deletions
diff --git a/src/ui/main_window/KeyMgmt.cpp b/src/ui/main_window/KeyMgmt.cpp
index afc6129c..09746140 100644
--- a/src/ui/main_window/KeyMgmt.cpp
+++ b/src/ui/main_window/KeyMgmt.cpp
@@ -52,55 +52,48 @@ namespace GpgFrontend::UI {
KeyMgmt::KeyMgmt(QWidget* parent)
: GeneralMainWindow("key_management", parent) {
/* the list of Keys available*/
- key_list_ = new KeyList(KeyMenuAbility::ALL, this);
+ key_list_ = new KeyList(KeyMenuAbility::kALL, GpgKeyTableColumn::kALL, this);
key_list_->AddListGroupTab(tr("All"), "all",
- KeyListRow::SECRET_OR_PUBLIC_KEY);
+ GpgKeyTableDisplayMode::kPUBLIC_KEY |
+ GpgKeyTableDisplayMode::kPRIVATE_KEY);
key_list_->AddListGroupTab(
tr("Only Public Key"), "only_public_key",
- KeyListRow::SECRET_OR_PUBLIC_KEY,
- KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
- KeyListColumn::Usage | KeyListColumn::Validity,
- [](const GpgKey& key, const KeyTable&) -> bool {
+ GpgKeyTableDisplayMode::kPUBLIC_KEY, [](const GpgKey& key) -> bool {
return !key.IsPrivateKey() &&
!(key.IsRevoked() || key.IsDisabled() || key.IsExpired());
});
key_list_->AddListGroupTab(
tr("Has Private Key"), "has_private_key",
- KeyListRow::SECRET_OR_PUBLIC_KEY,
- KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
- KeyListColumn::Usage | KeyListColumn::Validity,
- [](const GpgKey& key, const KeyTable&) -> bool {
+ GpgKeyTableDisplayMode::kPRIVATE_KEY, [](const GpgKey& key) -> bool {
return key.IsPrivateKey() &&
!(key.IsRevoked() || key.IsDisabled() || key.IsExpired());
});
key_list_->AddListGroupTab(
- tr("No Primary Key"), "no_primary_key", KeyListRow::SECRET_OR_PUBLIC_KEY,
- KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
- KeyListColumn::Usage | KeyListColumn::Validity,
- [](const GpgKey& key, const KeyTable&) -> bool {
+ tr("No Primary Key"), "no_primary_key",
+ GpgKeyTableDisplayMode::kPUBLIC_KEY |
+ GpgKeyTableDisplayMode::kPRIVATE_KEY,
+ [](const GpgKey& key) -> bool {
return !key.IsHasMasterKey() &&
!(key.IsRevoked() || key.IsDisabled() || key.IsExpired());
});
key_list_->AddListGroupTab(
- tr("Revoked"), "revoked", KeyListRow::SECRET_OR_PUBLIC_KEY,
- KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
- KeyListColumn::Usage | KeyListColumn::Validity,
- [](const GpgKey& key, const KeyTable&) -> bool {
- return key.IsRevoked();
- });
+ tr("Revoked"), "revoked",
+ GpgKeyTableDisplayMode::kPUBLIC_KEY |
+ GpgKeyTableDisplayMode::kPRIVATE_KEY,
+
+ [](const GpgKey& key) -> bool { return key.IsRevoked(); });
key_list_->AddListGroupTab(
- tr("Expired"), "expired", KeyListRow::SECRET_OR_PUBLIC_KEY,
- KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
- KeyListColumn::Usage | KeyListColumn::Validity,
- [](const GpgKey& key, const KeyTable&) -> bool {
- return key.IsExpired();
- });
+ tr("Expired"), "expired",
+ GpgKeyTableDisplayMode::kPUBLIC_KEY |
+ GpgKeyTableDisplayMode::kPRIVATE_KEY,
+
+ [](const GpgKey& key) -> bool { return key.IsExpired(); });
setCentralWidget(key_list_);
key_list_->SetDoubleClickedAction(
@@ -420,7 +413,7 @@ void KeyMgmt::SlotExportKeyToClipboard() {
}
if (data_obj == nullptr || !data_obj->Check<GFBuffer>()) {
- GF_CORE_LOG_ERROR("data object checking failed");
+ qCWarning(ui, "data object checking failed");
QMessageBox::critical(this, tr("Error"),
tr("Unknown error occurred"));
return;
@@ -579,7 +572,6 @@ void KeyMgmt::SlotImportKeyPackage() {
return;
}
- GF_UI_LOG_INFO("importing key package: {}", key_package_file_name);
CommonUtils::WaitForOpera(
this, tr("Importing"), [=](const OperaWaitingHd& op_hd) {
KeyPackageOperator::ImportKeyPackage(