projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introducing an edit mode to the bufferviews.
[quassel.git]
/
src
/
uisupport
/
settingspage.cpp
diff --git
a/src/uisupport/settingspage.cpp
b/src/uisupport/settingspage.cpp
index
8b8e423
..
9ee7f00
100644
(file)
--- a/
src/uisupport/settingspage.cpp
+++ b/
src/uisupport/settingspage.cpp
@@
-20,36
+20,50
@@
#include "settingspage.h"
#include "settingspage.h"
-SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) : QWidget(parent),
- _category(category), _title(title) {
+#include <QCheckBox>
+#include <QComboBox>
+#include <QSpinBox>
+#include <QVariant>
- _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;
+void SettingsPage::setChangedState(bool hasChanged) {
+ if(hasChanged != _changed) {
+ _changed = hasChanged;
+ emit changed(hasChanged);
+ }
}
}
-QString SettingsPage::title() const {
- return _title;
+void SettingsPage::load(QCheckBox *box, bool checked) {
+ box->setProperty("StoredValue", checked);
+ box->setChecked(checked);
}
}
-bool SettingsPage::hasChanged(
) const
{
- return
_changed
;
+bool SettingsPage::hasChanged(
QCheckBox *box)
{
+ return
box->property("StoredValue").toBool() == box->isChecked()
;
}
}
-bool SettingsPage::aboutToSave() {
- return true;
+
+void SettingsPage::load(QComboBox *box, int index) {
+ box->setProperty("StoredValue", index);
+ box->setCurrentIndex(index);
}
}
-
void SettingsPage::changed(
) {
-
changeState(true
);
+
bool SettingsPage::hasChanged(QComboBox *box
) {
+
return box->property("StoredValue").toInt() == box->currentIndex(
);
}
}
-void SettingsPage::changeState(bool hasChanged) {
- if(hasChanged != _changed) {
- _changed = hasChanged;
- emit changed(hasChanged);
- }
+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();
+}