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
aa59b873
Commit
aa59b873
authored
Aug 16, 2021
by
Ingo Klöcker
Browse files
Simplify code displaying compliance label next to buttons
GnuPG-bug-id: 5545
parent
d87504e0
Pipeline
#75232
passed with stage
in 14 minutes and 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/crypto/gui/signencryptfileswizard.cpp
View file @
aa59b873
...
...
@@ -388,28 +388,24 @@ SignEncryptFilesWizard::SignEncryptFilesWizard(QWidget *parent, Qt::WindowFlags
setPage
(
SigEncPageId
,
mSigEncPage
);
setPage
(
ResultPageId
,
mResultPage
);
setOptions
(
QWizard
::
IndependentPages
|
(
de_vs
?
QWizard
::
HaveCustomButton1
:
(
QWizard
::
WizardOption
)
0
)
|
(
de_vs
?
QWizard
::
HaveCustomButton1
:
QWizard
::
WizardOption
(
0
)
)
|
QWizard
::
NoBackButtonOnLastPage
|
QWizard
::
NoBackButtonOnStartPage
);
if
(
de_vs
)
{
/* We use a custom button to display a label next to the
buttons. */
mLabel
=
button
(
QWizard
::
CustomButton1
);
auto
btn
=
button
(
QWizard
::
CustomButton1
);
/* We style the button so that it looks and acts like a
label. */
mLabel
->
setStyleSheet
(
QStringLiteral
(
"border: none"
));
mLabel
->
setFocusPolicy
(
Qt
::
NoFocus
);
}
else
{
mLabel
=
nullptr
;
btn
->
setStyleSheet
(
QStringLiteral
(
"border: none"
));
btn
->
setFocusPolicy
(
Qt
::
NoFocus
);
}
}
void
SignEncryptFilesWizard
::
setLabelText
(
const
QString
&
label
)
{
if
(
mLabel
)
{
setButtonText
(
QWizard
::
CustomButton1
,
label
);
}
setButtonText
(
QWizard
::
CustomButton1
,
label
);
}
void
SignEncryptFilesWizard
::
slotCurrentIdChanged
(
int
id
)
...
...
src/crypto/gui/signencryptfileswizard.h
View file @
aa59b873
...
...
@@ -94,7 +94,6 @@ private Q_SLOTS:
private:
SigEncPage
*
mSigEncPage
=
nullptr
;
ResultPage
*
mResultPage
=
nullptr
;
QAbstractButton
*
mLabel
=
nullptr
;
bool
mSigningUserMutable
=
true
;
bool
mEncryptionUserMutable
=
true
;
};
...
...
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