diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gpg/GpgContext.h | 46 | ||||
-rw-r--r-- | include/ui/keypair_details/EditSubKeyDialog.h | 14 | ||||
-rw-r--r-- | include/ui/keypair_details/KeyPairDetailTab.h | 8 | ||||
-rw-r--r-- | include/ui/keypair_details/KeyPairSubkeyTab.h | 10 | ||||
-rw-r--r-- | include/ui/keypair_details/KeySetExpireDateDialog.h | 33 |
5 files changed, 80 insertions, 31 deletions
diff --git a/include/gpg/GpgContext.h b/include/gpg/GpgContext.h index af390ff1..3d3f2ffa 100644 --- a/include/gpg/GpgContext.h +++ b/include/gpg/GpgContext.h @@ -43,35 +43,21 @@ typedef QLinkedList<GpgImportedKey> GpgImportedKeyList; class GpgImportInformation { public: - GpgImportInformation() { - considered = 0; - no_user_id = 0; - imported = 0; - imported_rsa = 0; - unchanged = 0; - new_user_ids = 0; - new_sub_keys = 0; - new_signatures = 0; - new_revocations = 0; - secret_read = 0; - secret_imported = 0; - secret_unchanged = 0; - not_imported = 0; - } - - int considered; - int no_user_id; - int imported; - int imported_rsa; - int unchanged; - int new_user_ids; - int new_sub_keys; - int new_signatures; - int new_revocations; - int secret_read; - int secret_imported; - int secret_unchanged; - int not_imported; + GpgImportInformation() = default; + + int considered = 0; + int no_user_id = 0; + int imported = 0; + int imported_rsa = 0; + int unchanged = 0; + int new_user_ids = 0; + int new_sub_keys = 0; + int new_signatures = 0; + int new_revocations = 0; + int secret_read = 0; + int secret_imported = 0; + int secret_unchanged = 0; + int not_imported = 0; GpgImportedKeyList importedKeys; }; @@ -124,6 +110,8 @@ namespace GpgME { bool setPrimaryUID(const GpgKey &key, const UID &uid); + bool setExpire(const GpgKey &key, const GpgSubKey *subkey, QDateTime *expires); + /** * @details If text contains PGP-message, put a linebreak before the message, * so that gpgme can decrypt correctly diff --git a/include/ui/keypair_details/EditSubKeyDialog.h b/include/ui/keypair_details/EditSubKeyDialog.h new file mode 100644 index 00000000..be926be7 --- /dev/null +++ b/include/ui/keypair_details/EditSubKeyDialog.h @@ -0,0 +1,14 @@ +// +// Created by eric on 2021/6/2. +// + +#ifndef GPGFRONTEND_EDITSUBKEY_H +#define GPGFRONTEND_EDITSUBKEY_H + + +class EditSubKeyDialog { + +}; + + +#endif //GPGFRONTEND_EDITSUBKEY_H diff --git a/include/ui/keypair_details/KeyPairDetailTab.h b/include/ui/keypair_details/KeyPairDetailTab.h index d6f1b4e1..6b3bc2f0 100644 --- a/include/ui/keypair_details/KeyPairDetailTab.h +++ b/include/ui/keypair_details/KeyPairDetailTab.h @@ -27,6 +27,7 @@ #include "GpgFrontend.h" #include "gpg/GpgContext.h" +#include "KeySetExpireDateDialog.h" class KeyPairDetailTab : public QWidget { Q_OBJECT @@ -50,11 +51,16 @@ private slots: */ void slotCopyFingerprint(); + void slotModifyEditDatetime(); + + void slotRefreshKeyInfo(); + private: QString *keyid; /** The id of the key the details should be shown for */ GpgME::GpgContext *mCtx; /** The current gpg-context */ + const GpgKey &mKey; QGroupBox *ownerBox; /** Groupbox containing owner information */ QGroupBox *keyBox; /** Groupbox containing key information */ @@ -73,7 +79,7 @@ private: QLabel *usageVarLabel; public: - explicit KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey& key, QWidget *parent = nullptr); + explicit KeyPairDetailTab(GpgME::GpgContext *ctx, const GpgKey& mKey, QWidget *parent = nullptr); }; diff --git a/include/ui/keypair_details/KeyPairSubkeyTab.h b/include/ui/keypair_details/KeyPairSubkeyTab.h index 45abe7a1..ae954968 100644 --- a/include/ui/keypair_details/KeyPairSubkeyTab.h +++ b/include/ui/keypair_details/KeyPairSubkeyTab.h @@ -39,7 +39,9 @@ public: private: - void creatSubkeyList(); + void createSubkeyList(); + + void createSubkeyOperaMenu(); GpgME::GpgContext *mCtx; const GpgKey &mKey; @@ -49,6 +51,8 @@ private: QGroupBox *listBox; QGroupBox *detailBox; + QMenu *subkeyOperaMenu; + QLabel *keySizeVarLabel; /** Label containng the keys keysize */ QLabel *expireVarLabel; /** Label containng the keys expiration date */ @@ -67,6 +71,10 @@ private slots: void slotRefreshSubkeyDetail(); + void slotEditSubkey(); + + void slotRevokeSubkey(); + }; diff --git a/include/ui/keypair_details/KeySetExpireDateDialog.h b/include/ui/keypair_details/KeySetExpireDateDialog.h new file mode 100644 index 00000000..d0206402 --- /dev/null +++ b/include/ui/keypair_details/KeySetExpireDateDialog.h @@ -0,0 +1,33 @@ +// +// Created by eric on 2021/6/3. +// + +#ifndef GPGFRONTEND_KEYSETEXPIREDATEDIALOG_H +#define GPGFRONTEND_KEYSETEXPIREDATEDIALOG_H + +#include "GpgFrontend.h" +#include "gpg/GpgContext.h" +#include "gpg/GpgKey.h" +#include "gpg/GpgSubKey.h" + +class KeySetExpireDateDialog : public QDialog { +Q_OBJECT +public: + explicit KeySetExpireDateDialog(GpgME::GpgContext *ctx, const GpgKey &key, const GpgSubKey *subkey, QWidget *parent = nullptr); + +private: + GpgME::GpgContext *mCtx; + const GpgKey &mKey; + const GpgSubKey *mSubkey; + + QDateTimeEdit *dateTimeEdit{}; + QPushButton *confirmButton{}; + QCheckBox *nonExpiredCheck{}; + +private slots: + void slotConfirm(); + void slotNonExpiredChecked(int state); +}; + + +#endif //GPGFRONTEND_KEYSETEXPIREDATEDIALOG_H |