2
JuffEd - An advanced text editor
3
Copyright 2007-2009 Mikhail Murzin
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
version 2 as published by the Free Software Foundation.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
#include "SettingsCheckItem.h"
21
#include <QtGui/QCheckBox>
23
SettingsCheckItem::SettingsCheckItem(const QString& section, const QString& key,
29
// default_ = Settings::defaultValue(section, key);
32
connect(cb, SIGNAL(toggled(bool)), SLOT(onChecked(bool)));
35
void SettingsCheckItem::readValue() {
36
curValue_ = Settings::boolValue(section_, key_);
37
checkBox_->setChecked(curValue_);
40
void SettingsCheckItem::writeValue() {
41
if ( checkBox_->isChecked() != curValue_ ) {
42
curValue_ = checkBox_->isChecked();
43
Settings::setValue(section_, key_, curValue_);
48
void SettingsCheckItem::onChecked(bool checked) {
49
if ( checked != curValue_ )