aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/KeyList.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widgets/KeyList.h')
-rw-r--r--src/ui/widgets/KeyList.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ui/widgets/KeyList.h b/src/ui/widgets/KeyList.h
index 8d6fb600..4b41decd 100644
--- a/src/ui/widgets/KeyList.h
+++ b/src/ui/widgets/KeyList.h
@@ -53,6 +53,17 @@ struct KeyListColumn {
static constexpr InfoType FingerPrint = 1 << 5;
};
+struct KeyMenuAbility {
+ using AbilityType = unsigned int;
+
+ static constexpr AbilityType ALL = ~0;
+ static constexpr AbilityType NONE = 0;
+ static constexpr AbilityType REFRESH = 1 << 0;
+ static constexpr AbilityType SYNC_PUBLIC_KEY = 1 << 1;
+ static constexpr AbilityType UNCHECK_ALL = 1 << 3;
+ static constexpr AbilityType CHECK_ALL = 1 << 5;
+};
+
struct KeyTable {
QTableWidget* key_list;
KeyListRow::KeyType select_type;
@@ -76,6 +87,10 @@ struct KeyTable {
KeyIdArgsListPtr& GetChecked();
+ void UncheckALL() const;
+
+ void CheckALL() const;
+
void SetChecked(KeyIdArgsListPtr key_ids);
};
@@ -83,7 +98,8 @@ class KeyList : public QWidget {
Q_OBJECT
public:
- explicit KeyList(bool menu, QWidget* parent = nullptr);
+ explicit KeyList(KeyMenuAbility::AbilityType menu_ability,
+ QWidget* parent = nullptr);
void addListGroupTab(
const QString& name,
@@ -124,6 +140,8 @@ class KeyList : public QWidget {
private:
void init();
void importKeys(const QByteArray& inBuffer);
+ void slotUncheckALL();
+ void slotCheckALL();
static int key_list_id;
int _m_key_list_id;
@@ -135,7 +153,7 @@ class KeyList : public QWidget {
QMenu* popupMenu{};
GpgFrontend::KeyLinkListPtr _buffered_keys_list;
std::function<void(const GpgKey&, QWidget*)> mAction = nullptr;
- bool menu_status = false;
+ KeyMenuAbility::AbilityType menu_ability_ = KeyMenuAbility::ALL;
private slots: