Commit d87504e0 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Fix wrong button text when opening wizard

QWizard (re)sets the button texts to the default texts when switching
pages unless custom button texts have been set. To prevent our button
texts from being overwritten we need to set custom button texts with
QWizard::setButtonText() instead of setting the text of the button
directly.

GnuPG-bug-id: 5545
parent 3c8a08ce
......@@ -281,7 +281,7 @@ private Q_SLOTS:
{
auto btn = mParent->button(QWizard::CommitButton);
if (!label.isEmpty()) {
btn->setText(label);
mParent->setButtonText(QWizard::CommitButton, label);
if (Kleo::gpgComplianceP("de-vs")) {
bool de_vs = mWidget->isDeVsAndValid();
btn->setIcon(QIcon::fromTheme(de_vs
......@@ -297,7 +297,7 @@ private Q_SLOTS:
"%1 communication not possible.", Formatting::deVsString()));
}
} else {
btn->setText(i18n("Next"));
mParent->setButtonText(QWizard::CommitButton, i18n("Next"));
btn->setIcon(QIcon());
btn->setStyleSheet(QString());
}
......@@ -405,10 +405,10 @@ SignEncryptFilesWizard::SignEncryptFilesWizard(QWidget *parent, Qt::WindowFlags
}
}
void SignEncryptFilesWizard::setLabelText(const QString &label) const
void SignEncryptFilesWizard::setLabelText(const QString &label)
{
if (mLabel) {
mLabel->setText(label);
setButtonText(QWizard::CustomButton1, label);
}
}
......
......@@ -79,7 +79,7 @@ public:
std::vector<GpgME::Key> resolvedSigners() const;
bool encryptSymmetric() const;
void setLabelText(const QString &label) const;
void setLabelText(const QString &label);
protected:
void readConfig();
......
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