Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
c72081d7
Verified
Commit
c72081d7
authored
Sep 15, 2022
by
Ingo Klöcker
Committed by
Ingo Klöcker
Sep 15, 2022
Browse files
Disable Certify action if key cannot be certified
GnuPG-bug-id: 6155
parent
6c387232
Pipeline
#232168
failed with stage
in 1 minute and 17 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/certificatedetailswidget.cpp
View file @
c72081d7
...
...
@@ -433,6 +433,7 @@ void CertificateDetailsWidget::Private::setupCommonProperties()
const
bool
isSMIME
=
key
.
protocol
()
==
GpgME
::
CMS
;
const
bool
isOwnKey
=
key
.
hasSecret
();
const
auto
isLocalKey
=
!
isRemoteKey
(
key
);
const
auto
keyCanBeCertified
=
Kleo
::
canBeCertified
(
key
);
// update visibility of UI elements
ui
.
userIDs
->
setVisible
(
isOpenPGP
);
...
...
@@ -477,7 +478,7 @@ void CertificateDetailsWidget::Private::setupCommonProperties()
const
auto
userCanSignUserIDs
=
userHasCertificationKey
();
ui
.
addUserIDBtn
->
setEnabled
(
canBeUsedForSecretKeyOperations
(
key
));
ui
.
setPrimaryUserIDBtn
->
setEnabled
(
false
);
// requires a selected user ID
ui
.
certifyBtn
->
setEnabled
(
userCanSignUserIDs
&&
isLocalKey
);
ui
.
certifyBtn
->
setEnabled
(
isLocalKey
&&
keyCanBeCertified
&&
userCanSignUserIDs
);
ui
.
webOfTrustBtn
->
setEnabled
(
isLocalKey
);
ui
.
revokeCertificationsBtn
->
setEnabled
(
userCanSignUserIDs
&&
isLocalKey
);
ui
.
revokeUserIDBtn
->
setEnabled
(
false
);
// requires a selected user ID
...
...
@@ -806,6 +807,7 @@ void CertificateDetailsWidget::Private::userIDTableContextMenuRequested(const QP
#endif
const
bool
canSignUserIDs
=
userHasCertificationKey
();
const
auto
isLocalKey
=
!
isRemoteKey
(
key
);
const
auto
keyCanBeCertified
=
Kleo
::
canBeCertified
(
key
);
auto
menu
=
new
QMenu
(
q
);
#ifdef QGPGME_SUPPORTS_SET_PRIMARY_UID
...
...
@@ -829,7 +831,7 @@ void CertificateDetailsWidget::Private::userIDTableContextMenuRequested(const QP
q
,
[
this
]()
{
certifyUserIDs
();
});
action
->
setEnabled
(
isLocalKey
&&
canSignUserIDs
);
action
->
setEnabled
(
isLocalKey
&&
keyCanBeCertified
&&
canSignUserIDs
);
}
if
(
Kleo
::
Commands
::
RevokeCertificationCommand
::
isSupported
())
{
const
auto
actionText
=
userIDs
.
empty
()
?
i18nc
(
"@action:inmenu"
,
"Revoke Certifications..."
)
...
...
src/dialogs/weboftrustwidget.cpp
View file @
c72081d7
...
...
@@ -193,10 +193,11 @@ public:
void
updateActions
()
{
const
auto
userCanSignUserIDs
=
userHasCertificationKey
();
const
auto
keyCanBeCertified
=
Kleo
::
canBeCertified
(
key
);
const
auto
userID
=
selectedUserID
();
const
auto
signature
=
selectedCertification
();
detailsAction
->
setEnabled
(
!
signature
.
isNull
());
certifyAction
->
setEnabled
(
userCanSignUserIDs
&&
(
!
userID
.
isNull
()
||
!
signature
.
isNull
()));
certifyAction
->
setEnabled
(
keyCanBeCertified
&&
userCanSignUserIDs
&&
(
!
userID
.
isNull
()
||
!
signature
.
isNull
()));
if
(
revokeAction
)
{
revokeAction
->
setToolTip
({});
if
(
!
signature
.
isNull
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment