Optimize certification trust level management.

A private key should be editable to Unknown or Ultimate levels only.
A public key should be editable to all levels except Ultimate.
Undefined level is excluded for both public and private keys.

The public WTreeTableNode may list private keys if the user does not manage
these private keys. Inform of this state in the tool tip. The certification
trust level is excluded for any change.
This commit is contained in:
SET
2020-11-06 21:42:50 +01:00
parent b408350933
commit c8b2f81bf8
9 changed files with 89 additions and 43 deletions

View File

@@ -31,13 +31,15 @@ public:
/**
* Shows a combobox with all trust levels
* @param keyNode
* @param keyHasSecret
*/
void OnOwnerTrustDoubleClicked(WTreeTableNode * keyNode);
void OnOwnerTrustDoubleClicked(WTreeTableNode * keyNode, bool keyHasSecret);
/**
* Saves any changes in trust level
* @param keyNode
* @param keyHasSecret
*/
void OnOwnerTrustBlurred(WTreeTableNode * keyNode);
void OnOwnerTrustBlurred(WTreeTableNode * keyNode, bool keyHasSecret);
/**
* If the fingerprint is that of a private key we manage, returns true.
* @param fpr
@@ -56,8 +58,15 @@ private:
K7Main * m_owner;
PopupCertifyUserId * m_popupUid;
WString m_targetKeyFpr;
void FillOwnerTrustCombo(WComboBox * cmb);
/**
* 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();
};