1
/********************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 2010 Martin Gräßlin <kde@martin-graesslin.com>
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*********************************************************************/
20
#include "resize_config.h"
21
#include <kwineffects.h>
23
#include <kconfiggroup.h>
25
#include <QVBoxLayout>
30
KWIN_EFFECT_CONFIG_FACTORY
32
ResizeEffectConfigForm::ResizeEffectConfigForm(QWidget* parent) : QWidget(parent)
37
ResizeEffectConfig::ResizeEffectConfig(QWidget* parent, const QVariantList& args) :
38
KCModule(EffectFactory::componentData(), parent, args)
40
m_ui = new ResizeEffectConfigForm(this);
42
QVBoxLayout* layout = new QVBoxLayout(this);
44
layout->addWidget(m_ui);
46
connect(m_ui->scaleBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
47
connect(m_ui->outlineBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
52
void ResizeEffectConfig::load()
56
KConfigGroup conf = EffectsHandler::effectConfig("Resize");
57
m_ui->scaleBox->setChecked(conf.readEntry<bool>("TextureScale", true));
58
m_ui->outlineBox->setChecked(conf.readEntry<bool>("Outline" , false));
63
void ResizeEffectConfig::save()
65
KConfigGroup conf = EffectsHandler::effectConfig("Resize");
66
conf.writeEntry("TextureScale", m_ui->scaleBox->isChecked());
67
conf.writeEntry("Outline", m_ui->outlineBox->isChecked());
72
EffectsHandler::sendReloadMessage("resize");
75
void ResizeEffectConfig::defaults()
77
m_ui->scaleBox->setChecked(true);
78
m_ui->outlineBox->setChecked(false);
84
#include "resize_config.moc"