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
88a63502
Commit
88a63502
authored
Feb 24, 2021
by
Ingo Klöcker
Browse files
Show key details on double click on a key in either list
GnuPG-bug-id: 5175, 5239
parent
0f3b374b
Pipeline
#52030
passed with stage
in 17 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/editgroupdialog.cpp
View file @
88a63502
...
...
@@ -10,6 +10,7 @@
#include "editgroupdialog.h"
#include "commands/detailscommand.h"
#include "view/keytreeview.h"
#include <Libkleo/KeyListModel>
...
...
@@ -146,12 +147,16 @@ public:
q
,
[
addButton
]
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
)
{
addButton
->
setEnabled
(
!
selected
.
isEmpty
());
});
connect
(
ui
.
availableKeysList
->
view
(),
&
QAbstractItemView
::
doubleClicked
,
q
,
[
this
]
(
const
QModelIndex
&
index
)
{
showKeyDetails
(
index
);
});
connect
(
ui
.
groupKeysFilter
,
&
QLineEdit
::
textChanged
,
ui
.
groupKeysList
,
&
KeyTreeView
::
setStringFilter
);
connect
(
ui
.
groupKeysList
->
view
()
->
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
q
,
[
removeButton
]
(
const
QItemSelection
&
selected
,
const
QItemSelection
&
)
{
removeButton
->
setEnabled
(
!
selected
.
isEmpty
());
});
connect
(
ui
.
groupKeysList
->
view
(),
&
QAbstractItemView
::
doubleClicked
,
q
,
[
this
]
(
const
QModelIndex
&
index
)
{
showKeyDetails
(
index
);
});
connect
(
addButton
,
&
QPushButton
::
clicked
,
q
,
[
this
]
()
{
addKeysToGroup
();
});
connect
(
removeButton
,
&
QPushButton
::
clicked
,
q
,
[
this
]
()
{
removeKeysFromGroup
();
});
connect
(
ui
.
buttonBox
,
&
QDialogButtonBox
::
accepted
,
q
,
&
EditGroupDialog
::
accept
);
...
...
@@ -175,6 +180,7 @@ private:
{
KConfigGroup
configGroup
(
KSharedConfig
::
openConfig
(),
"EditGroupDialog"
);
configGroup
.
writeEntry
(
"Size"
,
q
->
size
());
KConfigGroup
availableKeysConfig
=
configGroup
.
group
(
"AvailableKeysView"
);
ui
.
availableKeysList
->
saveLayout
(
availableKeysConfig
);
...
...
@@ -200,6 +206,19 @@ private:
}
}
void
showKeyDetails
(
const
QModelIndex
&
index
)
{
if
(
!
index
.
isValid
())
{
return
;
}
const
GpgME
::
Key
key
=
index
.
model
()
->
data
(
index
,
KeyList
::
KeyRole
).
value
<
GpgME
::
Key
>
();
if
(
!
key
.
isNull
())
{
auto
cmd
=
new
DetailsCommand
(
key
,
nullptr
);
cmd
->
setParentWidget
(
q
);
cmd
->
start
();
}
}
void
addKeysToGroup
();
void
removeKeysFromGroup
();
};
...
...
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