X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.cpp;h=ed48f0793821ab45a98fb642d75a1be74fe6c693;hp=98f412336da05850c0aecdb2d7c330b0fe06d9bf;hb=3a3e844f9fcfd12235a0086af75ecd503b621ef4;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index 98f41233..ed48f079 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "settingspage.h" @@ -24,13 +24,16 @@ #include #include #include +#include + +#include "fontselector.h" #include "uisettings.h" -SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) +SettingsPage::SettingsPage(QString category, QString title, QWidget *parent) : QWidget(parent), - _category(category), - _title(title), + _category(std::move(category)), + _title(std::move(title)), _changed(false), _autoWidgetsChanged(false) { @@ -50,40 +53,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(); }