Used the trip back from CeBIT to prepare everything for a huge
[quassel.git] / src / qtui / settingsdlg.cpp
index 035993b..a249c79 100644 (file)
@@ -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();