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
libkleo
Commits
329e727d
Commit
329e727d
authored
Jul 28, 2022
by
Ingo Klöcker
Browse files
Format key ID and provide improved representation for screen readers
GnuPG-bug-id: 6103
parent
ecd8293d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ui/keylistview.cpp
View file @
329e727d
...
...
@@ -407,6 +407,10 @@ void KeyListViewItem::setKey(const GpgME::Key &key)
const
int
numCols
=
lv
?
lv
->
columnCount
()
:
0
;
for
(
int
i
=
0
;
i
<
numCols
;
++
i
)
{
setText
(
i
,
cs
->
text
(
key
,
i
));
const
auto
accessibleText
=
cs
->
accessibleText
(
key
,
i
);
if
(
!
accessibleText
.
isEmpty
())
{
setData
(
i
,
Qt
::
AccessibleTextRole
,
accessibleText
);
}
setToolTip
(
i
,
cs
->
toolTip
(
key
,
i
));
const
QIcon
icon
=
cs
->
icon
(
key
,
i
);
if
(
!
icon
.
isNull
())
{
...
...
src/ui/keylistview.h
View file @
329e727d
...
...
@@ -95,6 +95,7 @@ public:
}
virtual
QString
text
(
const
GpgME
::
Key
&
key
,
int
column
)
const
=
0
;
virtual
QString
accessibleText
(
const
GpgME
::
Key
&
key
,
int
column
)
const
=
0
;
virtual
QString
toolTip
(
const
GpgME
::
Key
&
key
,
int
column
)
const
;
virtual
QIcon
icon
(
const
GpgME
::
Key
&
,
int
)
const
{
...
...
src/ui/keyselectiondialog.cpp
View file @
329e727d
...
...
@@ -19,6 +19,7 @@
#include
"progressdialog.h"
#include
<libkleo/dn.h>
#include
<libkleo/formatting.h>
#include
<kleo_ui_debug.h>
...
...
@@ -164,6 +165,7 @@ public:
int
width
(
int
col
,
const
QFontMetrics
&
fm
)
const
override
;
QString
text
(
const
GpgME
::
Key
&
key
,
int
col
)
const
override
;
QString
accessibleText
(
const
GpgME
::
Key
&
key
,
int
column
)
const
override
;
QString
toolTip
(
const
GpgME
::
Key
&
key
,
int
col
)
const
override
;
QIcon
icon
(
const
GpgME
::
Key
&
key
,
int
col
)
const
override
;
...
...
@@ -220,7 +222,7 @@ QString ColumnStrategy::text(const GpgME::Key &key, int col) const
switch
(
col
)
{
case
0
:
{
if
(
key
.
shortKeyID
())
{
return
QString
::
fromUtf8
(
key
.
shortKeyID
());
return
Formatting
::
prettyID
(
key
.
shortKeyID
());
}
else
{
return
xi18n
(
"<placeholder>unknown</placeholder>"
);
}
...
...
@@ -238,6 +240,19 @@ QString ColumnStrategy::text(const GpgME::Key &key, int col) const
}
}
QString
ColumnStrategy
::
accessibleText
(
const
GpgME
::
Key
&
key
,
int
col
)
const
{
switch
(
col
)
{
case
0
:
{
if
(
key
.
shortKeyID
())
{
return
Formatting
::
accessibleHexID
(
key
.
shortKeyID
());
}
}
default:
return
{};
}
}
QString
ColumnStrategy
::
toolTip
(
const
GpgME
::
Key
&
key
,
int
)
const
{
const
char
*
uid
=
key
.
userID
(
0
).
id
();
...
...
tests/test_keylister.cpp
View file @
329e727d
...
...
@@ -41,6 +41,7 @@ public:
QString
title
(
int
col
)
const
override
;
QString
toolTip
(
const
GpgME
::
Key
&
key
,
int
col
)
const
override
;
QString
text
(
const
GpgME
::
Key
&
key
,
int
col
)
const
override
;
QString
accessibleText
(
const
GpgME
::
Key
&
key
,
int
col
)
const
override
;
};
QString
TestColumnStrategy
::
title
(
int
col
)
const
...
...
@@ -90,6 +91,11 @@ QString TestColumnStrategy::text(const GpgME::Key &key, int col) const
return
QString
();
}
}
QString
TestColumnStrategy
::
accessibleText
(
const
GpgME
::
Key
&
,
int
)
const
{
return
{};
}
}
CertListView
::
CertListView
(
QWidget
*
parent
,
Qt
::
WindowFlags
f
)
...
...
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