X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingsdlg.cpp;h=b02e7117a3be2ff48ddae593b7b646858cac374d;hb=ba9d9d766830eab8cc238c60a69f67c8b527aa7e;hp=1e8a59b1e28fa175bccf75b5a91ad9d4f9a308b1;hpb=9a6a8478bdd8c7c5bb4ff1fa3de9510863d65a97;p=quassel.git diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index 1e8a59b1..b02e7117 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -65,8 +65,9 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp) { QTreeWidgetItem *item = new QTreeWidgetItem(cat, QStringList(sp->title())); treeItems[sp] = item; 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) { @@ -90,7 +91,7 @@ void SettingsDlg::selectPage(const QString &cat, const QString &title) { if(sp != currentPage()) { ui.pageTitle->setText(sp->title()); ui.settingsStack->setCurrentWidget(sp); - ui.settingsStack->setMinimumSize(sp->sizeHint()); // we don't want our page shrinked, use scrollbars instead... + ui.settingsStack->setMinimumSize(sp->minimumSizeHint()); // we don't want our page shrinked, use scrollbars instead... _currentPage = sp; } ui.settingsTree->setCurrentItem(treeItems[sp]); @@ -112,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()); @@ -169,7 +169,7 @@ void SettingsDlg::loadDefaults() { if(!currentPage()) return; int ret = QMessageBox::question(this, tr("Restore Defaults"), tr("Do you like to restore the default values for this page?"), QMessageBox::RestoreDefaults|QMessageBox::Cancel, QMessageBox::Cancel); - if(ret == QMessageBox::Yes) { + if(ret == QMessageBox::RestoreDefaults) { currentPage()->defaults(); } }