diff options
author | Saturneric <[email protected]> | 2022-01-03 17:25:59 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-03 17:25:59 +0000 |
commit | c20c7b9bb81a09d54b288517092fe356bb808de4 (patch) | |
tree | 625db0ac06fdf95d5e886ab558e9d240f47730d1 /src/ui/widgets/KeyList.h | |
parent | <fixed, refactor>(ui): Enhanced sending email function. (diff) | |
download | GpgFrontend-c20c7b9bb81a09d54b288517092fe356bb808de4.tar.gz GpgFrontend-c20c7b9bb81a09d54b288517092fe356bb808de4.zip |
<feature, refactor>(core, ui): Key package generate.
1. refactor GpgKeyImportExporter to meet with key package generation.
2. add ExportKeyPackageDialog.
3. add Qt AES ability.
4. refactor Key List to provide menu ability control.
5. add check all and uncheck all ability to key list menu.
Diffstat (limited to '')
-rw-r--r-- | src/ui/widgets/KeyList.h | 22 |
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: |