X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=9ee7f00f6c9769f88f0689bf4158bcd88bb368f9;hp=c815d98f6e5ac511dc34dad86a0e70a70126e5cc;hb=5992edbbfa5a6e4a3c72b07c6f08a464f87dd432;hpb=335e1e55ee8df69b37b1b4d839950ced9ac08cc4 diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index c815d98f..9ee7f00f 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -21,6 +21,8 @@ #include "settingspage.h" #include +#include +#include #include SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) @@ -46,3 +48,22 @@ void SettingsPage::load(QCheckBox *box, bool checked) { bool SettingsPage::hasChanged(QCheckBox *box) { return box->property("StoredValue").toBool() == box->isChecked(); } + + +void SettingsPage::load(QComboBox *box, int index) { + box->setProperty("StoredValue", index); + box->setCurrentIndex(index); +} + +bool SettingsPage::hasChanged(QComboBox *box) { + return box->property("StoredValue").toInt() == box->currentIndex(); +} + +void SettingsPage::load(QSpinBox *box, int value) { + box->setProperty("StoredValue", value); + box->setValue(value); +} + +bool SettingsPage::hasChanged(QSpinBox *box) { + return box->property("StoredValue").toInt() == box->value(); +}