aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowUI.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2023-07-13 06:51:32 +0000
committerSaturneric <[email protected]>2023-07-13 06:51:32 +0000
commit7c96f052da1f73cbcd2f0671640d1019eaaa906a (patch)
tree814d98407a0a3bc8adb32f4b8065d8428f016eb9 /src/ui/main_window/MainWindowUI.cpp
parentfeat: add CacheManager to deal with cache (diff)
downloadGpgFrontend-7c96f052da1f73cbcd2f0671640d1019eaaa906a.tar.gz
GpgFrontend-7c96f052da1f73cbcd2f0671640d1019eaaa906a.zip
feat: support marking a key as favourite
Diffstat (limited to 'src/ui/main_window/MainWindowUI.cpp')
-rw-r--r--src/ui/main_window/MainWindowUI.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/ui/main_window/MainWindowUI.cpp b/src/ui/main_window/MainWindowUI.cpp
index 6e664988..77128ece 100644
--- a/src/ui/main_window/MainWindowUI.cpp
+++ b/src/ui/main_window/MainWindowUI.cpp
@@ -418,6 +418,21 @@ void MainWindow::create_actions() {
connect(show_key_details_act_, &QAction::triggered, this,
&MainWindow::slot_show_key_details);
+ add_key_2_favourtie_act_ = new QAction(_("Add To Favourite"), this);
+ add_key_2_favourtie_act_->setToolTip(_("Add this key to Favourite Table"));
+ add_key_2_favourtie_act_->setData(QVariant("add_key_2_favourite_action"));
+ connect(add_key_2_favourtie_act_, &QAction::triggered, this,
+ &MainWindow::slot_add_key_2_favourite);
+
+ remove_key_from_favourtie_act_ =
+ new QAction(_("Remove From Favourite"), this);
+ remove_key_from_favourtie_act_->setToolTip(
+ _("Remove this key from Favourite Table"));
+ remove_key_from_favourtie_act_->setData(
+ QVariant("remove_key_from_favourtie_action"));
+ connect(remove_key_from_favourtie_act_, &QAction::triggered, this,
+ &MainWindow::slot_remove_key_from_favourite);
+
/* Key-Shortcuts for Tab-Switchung-Action
*/
switch_tab_up_act_ = new QAction(this);
@@ -591,7 +606,7 @@ void MainWindow::create_dock_windows() {
addDockWidget(Qt::RightDockWidgetArea, key_list_dock_);
m_key_list_->AddListGroupTab(
- _("Default"), KeyListRow::SECRET_OR_PUBLIC_KEY,
+ _("Default"), "default", KeyListRow::SECRET_OR_PUBLIC_KEY,
KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
KeyListColumn::Usage | KeyListColumn::Validity,
[](const GpgKey& key) -> bool {
@@ -599,7 +614,15 @@ void MainWindow::create_dock_windows() {
});
m_key_list_->AddListGroupTab(
- _("Only Public Key"), KeyListRow::SECRET_OR_PUBLIC_KEY,
+ _("Favourite"), "favourite", KeyListRow::SECRET_OR_PUBLIC_KEY,
+ KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
+ KeyListColumn::Usage | KeyListColumn::Validity,
+ [](const GpgKey& key) -> bool {
+ return CommonUtils::GetInstance()->KeyExistsinFavouriteList(key);
+ });
+
+ m_key_list_->AddListGroupTab(
+ _("Only Public Key"), "only_public_key", KeyListRow::SECRET_OR_PUBLIC_KEY,
KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
KeyListColumn::Usage | KeyListColumn::Validity,
[](const GpgKey& key) -> bool {
@@ -608,7 +631,7 @@ void MainWindow::create_dock_windows() {
});
m_key_list_->AddListGroupTab(
- _("Has Private Key"), KeyListRow::SECRET_OR_PUBLIC_KEY,
+ _("Has Private Key"), "has_private_key", KeyListRow::SECRET_OR_PUBLIC_KEY,
KeyListColumn::TYPE | KeyListColumn::NAME | KeyListColumn::EmailAddress |
KeyListColumn::Usage | KeyListColumn::Validity,
[](const GpgKey& key) -> bool {