Skip to content
GitLab
Menu
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
1df94075
Commit
1df94075
authored
Feb 18, 2021
by
Ingo Klöcker
Browse files
Show comment for groups read from the configuration of gpg
GnuPG-bug-id: 5175, 5239
parent
cd691f05
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/groupdetailsdialog.cpp
View file @
1df94075
...
...
@@ -43,6 +43,7 @@ class GroupDetailsDialog::Private
struct
{
QLabel
*
groupNameLabel
=
nullptr
;
QLabel
*
groupCommentLabel
=
nullptr
;
KeyTreeView
*
treeView
=
nullptr
;
QDialogButtonBox
*
buttonBox
=
nullptr
;
}
ui
;
...
...
@@ -58,6 +59,11 @@ public:
ui
.
groupNameLabel
->
setWordWrap
(
true
);
mainLayout
->
addWidget
(
ui
.
groupNameLabel
);
ui
.
groupCommentLabel
=
new
QLabel
();
ui
.
groupCommentLabel
->
setWordWrap
(
true
);
ui
.
groupCommentLabel
->
setVisible
(
false
);
mainLayout
->
addWidget
(
ui
.
groupCommentLabel
);
ui
.
treeView
=
new
KeyTreeView
(
q
);
ui
.
treeView
->
view
()
->
setRootIsDecorated
(
false
);
ui
.
treeView
->
view
()
->
setSelectionMode
(
QAbstractItemView
::
SingleSelection
);
...
...
@@ -126,10 +132,25 @@ GroupDetailsDialog::~GroupDetailsDialog()
{
}
namespace
{
QString
groupComment
(
const
KeyGroup
&
group
)
{
switch
(
group
.
source
())
{
case
KeyGroup
::
GnuPGConfig
:
return
i18n
(
"Note: This group is defined in the configuration files of gpg."
);
default:
return
QString
();
}
}
}
void
GroupDetailsDialog
::
setGroup
(
const
KeyGroup
&
group
)
{
d
->
group
=
group
;
d
->
ui
.
groupNameLabel
->
setText
(
group
.
name
());
d
->
ui
.
groupCommentLabel
->
setText
(
groupComment
(
group
));
d
->
ui
.
groupCommentLabel
->
setVisible
(
!
d
->
ui
.
groupCommentLabel
->
text
().
isEmpty
());
const
KeyGroup
::
Keys
&
keys
=
group
.
keys
();
d
->
ui
.
treeView
->
setKeys
(
std
::
vector
<
GpgME
::
Key
>
(
keys
.
cbegin
(),
keys
.
cend
()));
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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