X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=c815d98f6e5ac511dc34dad86a0e70a70126e5cc;hp=8b8e423ad99f13ea215f2b72210381428e26d08d;hb=9cad7696cf0ef2f58c231c7b1eaaae0c16d0273d;hpb=21d8d7f0a79eeeb541664aa80ce481fdbfc41f09 diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index 8b8e423a..c815d98f 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -20,36 +20,29 @@ #include "settingspage.h" -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::hasChanged() const { - return _changed; +#include +#include + +SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) + : QWidget(parent), + _category(category), + _title(title), + _changed(false) +{ } -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(); +}