From 1c3c073ef8ddc370d5dcb953627bd9b8e145a67b Mon Sep 17 00:00:00 2001 From: SET Date: Sat, 14 Nov 2020 11:32:49 +0100 Subject: [PATCH] Reorganize KeyEdit class. Make KeyEdit callable by K7Main only. Does not need to used by other classes. --- KeyEdit.h | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/KeyEdit.h b/KeyEdit.h index ac4ad8d..4f68625 100644 --- a/KeyEdit.h +++ b/KeyEdit.h @@ -23,12 +23,38 @@ class K7Main; /** * Some key editing functionalities are or will be implemented here. For now, * only owner trust level and key certification are implemented. + * Is a pseudo-extension of K7Main. Both classes are friends to each other, and + * everything is private here. + * Does not manage keyring. */ class KeyEdit : public WObject { + friend class K7Main; public: + +private: KeyEdit(K7Main * owner); virtual ~KeyEdit(); + + K7Main * m_owner; + PopupCertifyUserId * m_popupUid; + WString m_targetUidValidityKeyFpr; + + PopupExpiryTime * m_popupExpiryTime; + WString m_expiryEditedKeyFpr; + + /** + * Unknown is common. + * \n If keyHasSecret is true, show only Ultimate level. + * \n Else, show everything except Ultimate. + * \n Undefined is not included. + * @param cmb + * @param keyHasSecret + */ + void FillOwnerTrustCombo(WComboBox * cmb, bool keyHasSecret); + void CertifyKey(); + void SetExpiryTime(); + /** * Shows a combobox with all trust levels * @param keyNode @@ -55,24 +81,6 @@ public: */ void OnExpiryClicked(WTreeTableNode * subkeyNode, const WString& keyFpr); -private: - K7Main * m_owner; - PopupCertifyUserId * m_popupUid; - WString m_targetUidValidityKeyFpr; - - PopupExpiryTime * m_popupExpiryTime; - WString m_expiryEditedKeyFpr; - /** - * Unknown is common. - * \n If keyHasSecret is true, show only Ultimate level. - * \n Else, show everything except Ultimate. - * \n Undefined is not included. - * @param cmb - * @param keyHasSecret - */ - void FillOwnerTrustCombo(WComboBox * cmb, bool keyHasSecret); - void CertifyKey(); - void SetExpiryTime(); }; #endif /* KEYEDIT_H */