X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspagedlg.cpp;h=2c817a96c7bccad8901d4255d06d877190fcc805;hp=7d36cf5f2f629c26bf3f869b6fa95e41541a8359;hb=bd1a18355495899b5ce3003599a67e1ea7ca01cc;hpb=f18d7db990cb23c87fa3586e19b2f8aa5509a66c diff --git a/src/qtui/settingspagedlg.cpp b/src/qtui/settingspagedlg.cpp index 7d36cf5f..2c817a96 100644 --- a/src/qtui/settingspagedlg.cpp +++ b/src/qtui/settingspagedlg.cpp @@ -44,7 +44,6 @@ SettingsPage *SettingsPageDlg::currentPage() const { void SettingsPageDlg::setButtonStates() { SettingsPage *sp = currentPage(); - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(sp && sp->hasChanged()); ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(sp && sp->hasChanged()); ui.buttonBox->button(QDialogButtonBox::Reset)->setEnabled(sp && sp->hasChanged()); ui.buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(sp && sp->hasDefaults()); @@ -53,7 +52,9 @@ void SettingsPageDlg::setButtonStates() { void SettingsPageDlg::buttonClicked(QAbstractButton *button) { switch(ui.buttonBox->standardButton(button)) { case QDialogButtonBox::Ok: - if(applyChanges()) accept(); + if(currentPage() && currentPage()->hasChanged()) { + if(applyChanges()) accept(); + } else accept(); break; case QDialogButtonBox::Apply: applyChanges();