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
554349e7
Commit
554349e7
authored
Aug 02, 2022
by
Ingo Klöcker
Browse files
Add buttons for invoking actions on selected user ID or certification
This makes the actions more discoverable. GnuPG-bug-id: 6102
parent
452adf99
Pipeline
#211723
passed with stage
in 2 minutes and 31 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/weboftrustdialog.cpp
View file @
554349e7
...
...
@@ -19,6 +19,7 @@
#include
<Libkleo/KeyHelpers>
#include
<QAction>
#include
<QDialogButtonBox>
#include
<QPushButton>
#include
<QVBoxLayout>
...
...
@@ -34,6 +35,22 @@
using
namespace
Kleo
;
namespace
{
void
addActionButton
(
QDialogButtonBox
*
buttonBox
,
QAction
*
action
)
{
if
(
!
action
)
{
return
;
}
auto
button
=
buttonBox
->
addButton
(
action
->
text
(),
QDialogButtonBox
::
ActionRole
);
button
->
setEnabled
(
action
->
isEnabled
());
QObject
::
connect
(
action
,
&
QAction
::
changed
,
button
,
[
action
,
button
]()
{
button
->
setEnabled
(
action
->
isEnabled
());
});
QObject
::
connect
(
button
,
&
QPushButton
::
clicked
,
action
,
&
QAction
::
trigger
);
}
}
WebOfTrustDialog
::
WebOfTrustDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
)
{
...
...
@@ -53,6 +70,10 @@ WebOfTrustDialog::WebOfTrustDialog(QWidget *parent)
auto
btn
=
bbox
->
addButton
(
QDialogButtonBox
::
Close
);
connect
(
btn
,
&
QPushButton
::
pressed
,
this
,
&
QDialog
::
accept
);
addActionButton
(
bbox
,
mWidget
->
detailsAction
());
addActionButton
(
bbox
,
mWidget
->
certifyAction
());
addActionButton
(
bbox
,
mWidget
->
revokeAction
());
mFetchKeysBtn
=
bbox
->
addButton
(
i18nc
(
"@action:button"
,
"Fetch Missing Keys"
),
QDialogButtonBox
::
ActionRole
);
mFetchKeysBtn
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Look up and import all keys that were used to certify the user IDs of this key"
));
...
...
src/dialogs/weboftrustwidget.cpp
View file @
554349e7
...
...
@@ -291,6 +291,21 @@ WebOfTrustWidget::WebOfTrustWidget(QWidget *parent)
WebOfTrustWidget
::~
WebOfTrustWidget
()
=
default
;
QAction
*
WebOfTrustWidget
::
detailsAction
()
const
{
return
d
->
detailsAction
;
}
QAction
*
WebOfTrustWidget
::
certifyAction
()
const
{
return
d
->
certifyAction
;
}
QAction
*
WebOfTrustWidget
::
revokeAction
()
const
{
return
d
->
revokeAction
;
}
GpgME
::
Key
WebOfTrustWidget
::
key
()
const
{
return
d
->
key
;
...
...
src/dialogs/weboftrustwidget.h
View file @
554349e7
...
...
@@ -24,6 +24,10 @@ public:
explicit
WebOfTrustWidget
(
QWidget
*
parent
=
nullptr
);
~
WebOfTrustWidget
()
override
;
QAction
*
detailsAction
()
const
;
QAction
*
certifyAction
()
const
;
QAction
*
revokeAction
()
const
;
void
setKey
(
const
GpgME
::
Key
&
key
);
GpgME
::
Key
key
()
const
;
...
...
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