making the requester type configurable
[quassel.git] / src / uisupport / settingspage.cpp
index c815d98..9ee7f00 100644 (file)
@@ -21,6 +21,8 @@
 #include "settingspage.h"
 
 #include <QCheckBox>
 #include "settingspage.h"
 
 #include <QCheckBox>
+#include <QComboBox>
+#include <QSpinBox>
 #include <QVariant>
 
 SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent)
 #include <QVariant>
 
 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();
 }
 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();
+}