2
* Copyright © 2010 Andreas Demmer <ademmer@opensuse.org>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
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 GNU
12
* General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; see the file COPYING. if not, write to
16
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#include "dashboard_config.h"
21
#include <kwineffects.h>
26
KWIN_EFFECT_CONFIG_FACTORY
28
DashboardEffectConfig::DashboardEffectConfig(QWidget *parent, const QVariantList &args)
29
: KCModule(EffectFactory::componentData(), parent, args)
33
connect(ui.brightness, SIGNAL(valueChanged(int)), SLOT(changed()));
34
connect(ui.saturation, SIGNAL(valueChanged(int)), SLOT(changed()));
35
connect(ui.duration, SIGNAL(valueChanged(int)), SLOT(changed()));
36
connect(ui.blur, SIGNAL(stateChanged(int)), SLOT(changed()));
41
DashboardEffectConfig::~DashboardEffectConfig()
45
void DashboardEffectConfig::load()
48
KConfigGroup config = EffectsHandler::effectConfig("Dashboard");
50
const int brightness = config.readEntry<int>("Brightness", 50);
51
ui.brightness->setValue(brightness);
53
const int saturation = config.readEntry<int>("Saturation", 50);
54
ui.saturation->setValue(saturation);
56
const int duration = config.readEntry("Duration", 500);
57
ui.duration->setValue(duration);
59
bool blur = config.readEntry("Blur", false);
60
ui.blur->setChecked(blur);
65
void DashboardEffectConfig::save()
69
KConfigGroup config = EffectsHandler::effectConfig("Dashboard");
71
config.writeEntry("Brightness", ui.brightness->value());
72
config.writeEntry("Saturation", ui.saturation->value());
73
config.writeEntry("Duration", ui.duration->value());
74
config.writeEntry("Blur", ui.blur->isChecked());
79
EffectsHandler::sendReloadMessage("dashboard");
82
void DashboardEffectConfig::defaults()
84
ui.brightness->setValue(50);
85
ui.saturation->setValue(50);
86
ui.duration->setValue(500);
87
ui.blur->setChecked(false);