X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=9be56bd9f6aa871d3c9eba3146eac08d770162ec;hp=9e9551aeb52280c5e1b8de3dabec6084eb910599;hb=e8a39b4c3c92e193ab861a3fea84a261bb6fbd24;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index 9e9551ae..9be56bd9 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -25,6 +25,8 @@ #include #include +#include "fontselector.h" + #include "uisettings.h" SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) @@ -50,40 +52,53 @@ void SettingsPage::setChangedState(bool hasChanged_) void SettingsPage::load(QCheckBox *box, bool checked) { - box->setProperty("StoredValue", checked); + box->setProperty("storedValue", checked); box->setChecked(checked); } bool SettingsPage::hasChanged(QCheckBox *box) { - return box->property("StoredValue").toBool() != box->isChecked(); + return box->property("storedValue").toBool() != box->isChecked(); } void SettingsPage::load(QComboBox *box, int index) { - box->setProperty("StoredValue", index); + box->setProperty("storedValue", index); box->setCurrentIndex(index); } bool SettingsPage::hasChanged(QComboBox *box) { - return box->property("StoredValue").toInt() != box->currentIndex(); + return box->property("storedValue").toInt() != box->currentIndex(); } void SettingsPage::load(QSpinBox *box, int value) { - box->setProperty("StoredValue", value); + box->setProperty("storedValue", value); box->setValue(value); } bool SettingsPage::hasChanged(QSpinBox *box) { - return box->property("StoredValue").toInt() != box->value(); + return box->property("storedValue").toInt() != box->value(); +} + + +void SettingsPage::load(FontSelector *box, QFont value) +{ + box->setProperty("storedValue", value); + box->setSelectedFont(value); +} + + +bool SettingsPage::hasChanged(FontSelector *box) +{ + return box->property("storedValue").value() != box->selectedFont(); }