1
/********************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 2009 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 "cubeslide_config.h"
21
#include <kwineffects.h>
23
#include <kconfiggroup.h>
24
#include <QVBoxLayout>
29
KWIN_EFFECT_CONFIG_FACTORY
31
CubeSlideEffectConfigForm::CubeSlideEffectConfigForm(QWidget* parent) : QWidget(parent)
36
CubeSlideEffectConfig::CubeSlideEffectConfig(QWidget* parent, const QVariantList& args) :
37
KCModule(EffectFactory::componentData(), parent, args)
39
m_ui = new CubeSlideEffectConfigForm(this);
41
QVBoxLayout* layout = new QVBoxLayout(this);
43
layout->addWidget(m_ui);
45
connect(m_ui->rotationDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(changed()));
46
connect(m_ui->dontSlidePanelsBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
47
connect(m_ui->dontSlideStickyWindowsBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
48
connect(m_ui->usePagerBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
49
connect(m_ui->windowsMovingBox, SIGNAL(stateChanged(int)), SLOT(changed()));
54
void CubeSlideEffectConfig::load()
58
KConfigGroup conf = EffectsHandler::effectConfig("CubeSlide");
60
int duration = conf.readEntry("RotationDuration", 0);
61
bool dontSlidePanels = conf.readEntry("DontSlidePanels", true);
62
bool dontSlideStickyWindows = conf.readEntry("DontSlideStickyWindows", false);
63
bool usePager = conf.readEntry("UsePagerLayout", true);
65
m_ui->rotationDurationSpin->setValue(duration);
66
m_ui->dontSlidePanelsBox->setChecked(dontSlidePanels);
67
m_ui->dontSlideStickyWindowsBox->setChecked(dontSlideStickyWindows);
68
m_ui->usePagerBox->setChecked(usePager);
69
m_ui->windowsMovingBox->setChecked(conf.readEntry("UseWindowMoving", false));
74
void CubeSlideEffectConfig::save()
76
KConfigGroup conf = EffectsHandler::effectConfig("CubeSlide");
78
conf.writeEntry("RotationDuration", m_ui->rotationDurationSpin->value());
79
conf.writeEntry("DontSlidePanels", m_ui->dontSlidePanelsBox->isChecked());
80
conf.writeEntry("DontSlideStickyWindows", m_ui->dontSlideStickyWindowsBox->isChecked());
81
conf.writeEntry("UsePagerLayout", m_ui->usePagerBox->isChecked());
82
conf.writeEntry("UseWindowMoving", m_ui->windowsMovingBox->isChecked());
87
EffectsHandler::sendReloadMessage("cubeslide");
90
void CubeSlideEffectConfig::defaults()
92
m_ui->rotationDurationSpin->setValue(0);
93
m_ui->dontSlidePanelsBox->setChecked(true);
94
m_ui->dontSlideStickyWindowsBox->setChecked(false);
95
m_ui->usePagerBox->setChecked(true);
96
m_ui->windowsMovingBox->setChecked(false);
102
#include "cubeslide_config.moc"