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
9a8722cb
Commit
9a8722cb
authored
Jul 13, 2022
by
Ingo Klöcker
Browse files
Use DeVSCompliance helper for setting icon and color for compliance
GnuPG-bug-id: 6073
parent
1d6b96f4
Pipeline
#204565
passed with stage
in 2 minutes and 38 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/crypto/gui/signencryptemailconflictdialog.cpp
View file @
9a8722cb
...
...
@@ -274,14 +274,7 @@ private:
auto
btn
=
ui
.
buttonBox
.
button
(
QDialogButtonBox
::
Ok
);
btn
->
setIcon
(
QIcon
::
fromTheme
(
de_vs
?
QStringLiteral
(
"security-high"
)
:
QStringLiteral
(
"security-medium"
)));
if
(
!
SystemInfo
::
isHighContrastModeActive
())
{
btn
->
setStyleSheet
(
QStringLiteral
(
"QPushButton { background-color: %1; }"
).
arg
(
de_vs
?
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
PositiveBackground
).
color
().
name
()
:
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
NegativeBackground
).
color
().
name
()));
}
DeVSCompliance
::
decorate
(
btn
,
de_vs
);
ui
.
complianceLB
.
setText
(
de_vs
?
i18nc
(
"%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant"
,
"%1 communication possible."
,
DeVSCompliance
::
name
(
true
))
...
...
src/crypto/gui/signencryptfileswizard.cpp
View file @
9a8722cb
...
...
@@ -41,6 +41,7 @@
#include
<QLabel>
#include
<QIcon>
#include
<QCheckBox>
#include
<QPushButton>
#include
<QStyle>
#include
<gpgme++/key.h>
...
...
@@ -442,19 +443,12 @@ private Q_SLOTS:
if
(
mParent
->
currentPage
()
!=
this
)
{
return
;
}
auto
btn
=
mParent
->
button
(
QWizard
::
CommitButton
);
auto
btn
=
qobject_cast
<
QPushButton
*>
(
mParent
->
button
(
QWizard
::
CommitButton
)
)
;
if
(
!
label
.
isEmpty
())
{
mParent
->
setButtonText
(
QWizard
::
CommitButton
,
label
);
if
(
DeVSCompliance
::
isActive
())
{
const
bool
de_vs
=
DeVSCompliance
::
isCompliant
()
&&
mWidget
->
isDeVsAndValid
();
btn
->
setIcon
(
QIcon
::
fromTheme
(
de_vs
?
QStringLiteral
(
"security-high"
)
:
QStringLiteral
(
"security-medium"
)));
if
(
!
SystemInfo
::
isHighContrastModeActive
())
{
btn
->
setStyleSheet
(
QStringLiteral
(
"QPushButton { background-color: %1; }"
).
arg
(
de_vs
?
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
PositiveBackground
).
color
().
name
()
:
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
NegativeBackground
).
color
().
name
()));
}
DeVSCompliance
::
decorate
(
btn
,
de_vs
);
mParent
->
setLabelText
(
de_vs
?
i18nc
(
"%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant"
,
"%1 communication possible."
,
DeVSCompliance
::
name
(
true
))
...
...
src/view/padwidget.cpp
View file @
9a8722cb
...
...
@@ -493,14 +493,7 @@ public:
if
(
DeVSCompliance
::
isActive
())
{
const
bool
de_vs
=
DeVSCompliance
::
isCompliant
()
&&
mSigEncWidget
->
isDeVsAndValid
();
mCryptBtn
->
setIcon
(
QIcon
::
fromTheme
(
de_vs
?
QStringLiteral
(
"security-high"
)
:
QStringLiteral
(
"security-medium"
)));
if
(
!
SystemInfo
::
isHighContrastModeActive
())
{
mCryptBtn
->
setStyleSheet
(
QStringLiteral
(
"QPushButton { background-color: %1; }"
).
arg
(
de_vs
?
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
PositiveBackground
).
color
().
name
()
:
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
NegativeBackground
).
color
().
name
()));
}
DeVSCompliance
::
decorate
(
mCryptBtn
,
de_vs
);
mAdditionalInfoLabel
->
setText
(
de_vs
?
i18nc
(
"%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant"
,
"%1 communication possible."
,
DeVSCompliance
::
name
(
true
))
...
...
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