aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-29 13:19:06 +0000
committersaturneric <[email protected]>2025-04-29 13:19:06 +0000
commit6106b66c879ecbdf5dec6dd8b63db383efca0844 (patch)
tree19327805289c783ec2a07449746170d614082e56
parentfix: filename of export key is not correct (diff)
downloadGpgFrontend-6106b66c879ecbdf5dec6dd8b63db383efca0844.tar.gz
GpgFrontend-6106b66c879ecbdf5dec6dd8b63db383efca0844.zip
fix: add to favorite function not works properly
Diffstat (limited to '')
-rw-r--r--src/ui/GpgFrontendApplication.cpp2
-rw-r--r--src/ui/main_window/KeyMgmt.cpp8
-rw-r--r--src/ui/main_window/MainWindow.cpp11
3 files changed, 12 insertions, 9 deletions
diff --git a/src/ui/GpgFrontendApplication.cpp b/src/ui/GpgFrontendApplication.cpp
index 271c8e57..5f896fd5 100644
--- a/src/ui/GpgFrontendApplication.cpp
+++ b/src/ui/GpgFrontendApplication.cpp
@@ -72,7 +72,7 @@ bool GpgFrontendApplication::notify(QObject *receiver, QEvent *event) {
try {
return QApplication::notify(receiver, event);
} catch (const std::exception &ex) {
- FLOG_W("exception was caught in notify: {}", ex.what());
+ FLOG_W("exception was caught in notify: %s", ex.what());
QMessageBox::information(
nullptr, tr("Standard Exception Thrown"),
tr("Oops, an standard exception was thrown "
diff --git a/src/ui/main_window/KeyMgmt.cpp b/src/ui/main_window/KeyMgmt.cpp
index f9364ecf..8c384ebb 100644
--- a/src/ui/main_window/KeyMgmt.cpp
+++ b/src/ui/main_window/KeyMgmt.cpp
@@ -622,10 +622,10 @@ void KeyMgmt::slot_popup_menu_by_key_list(QContextMenuEvent* event,
if (keys.isEmpty()) return;
auto key = keys.front();
- generate_subkey_act_->setDisabled(key->KeyType() !=
- GpgAbstractKeyType::kGPG_KEY);
- set_owner_trust_of_key_act_->setDisabled(key->KeyType() !=
- GpgAbstractKeyType::kGPG_KEY);
+ generate_subkey_act_->setVisible(
+ key->KeyType() == GpgAbstractKeyType::kGPG_KEY && key->IsPrivateKey());
+ set_owner_trust_of_key_act_->setVisible(key->KeyType() ==
+ GpgAbstractKeyType::kGPG_KEY);
popup_menu_->exec(event->globalPos());
}
diff --git a/src/ui/main_window/MainWindow.cpp b/src/ui/main_window/MainWindow.cpp
index e2c4f1e3..76830691 100644
--- a/src/ui/main_window/MainWindow.cpp
+++ b/src/ui/main_window/MainWindow.cpp
@@ -305,12 +305,15 @@ void MainWindow::slot_popup_menu_by_key_list(QContextMenuEvent* event,
if (event == nullptr || key_table == nullptr) return;
const auto key_table_name = key_table->objectName();
+
+ LOG_D() << "current key table object name: " << key_table_name;
+
if (key_table_name == "favourite") {
- remove_key_from_favourtie_act_->setDisabled(true);
- add_key_2_favourite_act_->setDisabled(false);
+ remove_key_from_favourtie_act_->setVisible(true);
+ add_key_2_favourite_act_->setVisible(false);
} else {
- remove_key_from_favourtie_act_->setDisabled(false);
- add_key_2_favourite_act_->setDisabled(true);
+ remove_key_from_favourtie_act_->setVisible(false);
+ add_key_2_favourite_act_->setVisible(true);
}
popup_menu_->popup(event->globalPos());