X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=c815d98f6e5ac511dc34dad86a0e70a70126e5cc;hb=aa7841638c6537034102da959cad8c36853bf280;hp=37ac416f8b03b34a4fa10eb7f0926750143576ed;hpb=9a6a8478bdd8c7c5bb4ff1fa3de9510863d65a97;p=quassel.git diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index 37ac416f..c815d98f 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -20,44 +20,29 @@ #include "settingspage.h" -SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) : QWidget(parent), - _category(category), _title(title) { +#include +#include - _changed = false; +SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) + : QWidget(parent), + _category(category), + _title(title), + _changed(false) +{ } -QString SettingsPage::category() const { - return _category; -} - -QString SettingsPage::title() const { - return _title; -} - -bool SettingsPage::hasDefaults() const { - return false; -} - -void SettingsPage::defaults() { - -} - -bool SettingsPage::hasChanged() const { - return _changed; -} - -bool SettingsPage::aboutToSave() { - return true; -} - -void SettingsPage::changed() { - changeState(true); -} - -void SettingsPage::changeState(bool hasChanged) { +void SettingsPage::setChangedState(bool hasChanged) { if(hasChanged != _changed) { _changed = hasChanged; emit changed(hasChanged); } } +void SettingsPage::load(QCheckBox *box, bool checked) { + box->setProperty("StoredValue", checked); + box->setChecked(checked); +} + +bool SettingsPage::hasChanged(QCheckBox *box) { + return box->property("StoredValue").toBool() == box->isChecked(); +}