/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
: QWidget(parent),
_category(category),
_title(title),
- _changed(false)
+ _changed(false),
+ _autoWidgetsChanged(false)
{
}
}
bool SettingsPage::hasChanged(QCheckBox *box) {
- return box->property("StoredValue").toBool() == box->isChecked();
+ return box->property("StoredValue").toBool() != box->isChecked();
}
}
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) {
}
bool SettingsPage::hasChanged(QSpinBox *box) {
- return box->property("StoredValue").toInt() == box->value();
+ return box->property("StoredValue").toInt() != box->value();
}
/*** Auto child widget handling ***/
findAutoWidgets(this, &_autoWidgets);
foreach(QObject *widget, _autoWidgets) {
- if(widget->inherits("QAbstractButton"))
+ if(widget->inherits("QAbstractButton") || widget->inherits("QGroupBox"))
connect(widget, SIGNAL(toggled(bool)), SLOT(autoWidgetHasChanged()));
else if(widget->inherits("QLineEdit") || widget->inherits("QTextEdit"))
connect(widget, SIGNAL(textChanged(const QString &)), SLOT(autoWidgetHasChanged()));
QByteArray SettingsPage::autoWidgetPropertyName(QObject *widget) const {
QByteArray prop;
- if(widget->inherits("QAbstractButton"))
+ if(widget->inherits("QAbstractButton") || widget->inherits("QGroupBox"))
prop = "checked";
else if(widget->inherits("QLineEdit") || widget->inherits("QTextEdit"))
prop = "text";