X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fqtui%2Fsettingsdlg.cpp;h=a249c79bb18f3a2e927c3d789e474cbcda06cc1d;hb=a23256347cc47605dd0660127052846427bc998d;hp=035993b9e6723ac1181ddc2d4927bfb79149834f;hpb=43159be08b173c4c1c973eb3ea26cdaae191fc2f;p=quassel.git diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index 035993b9..a249c79b 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -67,7 +67,7 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp) { pages[QString("%1$%2").arg(sp->category(), sp->title())] = sp; sp->load(); // TESTING - selectPage(sp->category(), sp->title()); + // selectPage(sp->category(), sp->title()); } void SettingsDlg::selectPage(const QString &cat, const QString &title) { @@ -113,7 +113,6 @@ void SettingsDlg::itemSelected() { void SettingsDlg::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()); @@ -122,7 +121,9 @@ void SettingsDlg::setButtonStates() { void SettingsDlg::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();