Commit aa59b873 authored by Ingo Klöcker's avatar 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
...@@ -388,28 +388,24 @@ SignEncryptFilesWizard::SignEncryptFilesWizard(QWidget *parent, Qt::WindowFlags ...@@ -388,28 +388,24 @@ SignEncryptFilesWizard::SignEncryptFilesWizard(QWidget *parent, Qt::WindowFlags
setPage(SigEncPageId, mSigEncPage); setPage(SigEncPageId, mSigEncPage);
setPage(ResultPageId, mResultPage); setPage(ResultPageId, mResultPage);
setOptions(QWizard::IndependentPages | setOptions(QWizard::IndependentPages |
(de_vs ? QWizard::HaveCustomButton1 : (QWizard::WizardOption) 0) | (de_vs ? QWizard::HaveCustomButton1 : QWizard::WizardOption(0)) |
QWizard::NoBackButtonOnLastPage | QWizard::NoBackButtonOnLastPage |
QWizard::NoBackButtonOnStartPage); QWizard::NoBackButtonOnStartPage);
if (de_vs) { if (de_vs) {
/* We use a custom button to display a label next to the /* We use a custom button to display a label next to the
buttons. */ buttons. */
mLabel = button(QWizard::CustomButton1); auto btn = button(QWizard::CustomButton1);
/* We style the button so that it looks and acts like a /* We style the button so that it looks and acts like a
label. */ label. */
mLabel->setStyleSheet(QStringLiteral("border: none")); btn->setStyleSheet(QStringLiteral("border: none"));
mLabel->setFocusPolicy(Qt::NoFocus); btn->setFocusPolicy(Qt::NoFocus);
} else {
mLabel = nullptr;
} }
} }
void SignEncryptFilesWizard::setLabelText(const QString &label) void SignEncryptFilesWizard::setLabelText(const QString &label)
{ {
if (mLabel) { setButtonText(QWizard::CustomButton1, label);
setButtonText(QWizard::CustomButton1, label);
}
} }
void SignEncryptFilesWizard::slotCurrentIdChanged(int id) void SignEncryptFilesWizard::slotCurrentIdChanged(int id)
......
...@@ -94,7 +94,6 @@ private Q_SLOTS: ...@@ -94,7 +94,6 @@ private Q_SLOTS:
private: private:
SigEncPage *mSigEncPage = nullptr; SigEncPage *mSigEncPage = nullptr;
ResultPage *mResultPage = nullptr; ResultPage *mResultPage = nullptr;
QAbstractButton *mLabel = nullptr;
bool mSigningUserMutable = true; bool mSigningUserMutable = true;
bool mEncryptionUserMutable = true; bool mEncryptionUserMutable = true;
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment