1
/********************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 2009 Jorge Mata <matamax123@gmail.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
*********************************************************************/
21
#include "slidetabs_config.h"
23
#include <kwineffects.h>
26
#include <kconfiggroup.h>
28
#include <QVBoxLayout>
33
KWIN_EFFECT_CONFIG_FACTORY
35
SlideTabsEffectConfigForm::SlideTabsEffectConfigForm(QWidget* parent) : QWidget(parent)
40
SlideTabsEffectConfig::SlideTabsEffectConfig(QWidget* parent, const QVariantList& args)
41
: KCModule(EffectFactory::componentData(), parent, args)
43
m_ui = new SlideTabsEffectConfigForm(this);
45
QVBoxLayout* layout = new QVBoxLayout(this);
47
layout->addWidget(m_ui);
49
connect(m_ui->grouping, SIGNAL(toggled(bool)), this, SLOT(changed()));
50
connect(m_ui->switching, SIGNAL(toggled(bool)), this, SLOT(changed()));
51
connect(m_ui->duration, SIGNAL(valueChanged(int)), this, SLOT(changed()));
56
void SlideTabsEffectConfig::save()
58
KConfigGroup conf = EffectsHandler::effectConfig("SlideTabs");
60
conf.writeEntry("SlideGrouping", m_ui->grouping->isChecked());
61
conf.writeEntry("SlideSwitching", m_ui->switching->isChecked());
62
conf.writeEntry("SlideDuration", m_ui->duration->value());
68
EffectsHandler::sendReloadMessage("slidetabs");
71
void SlideTabsEffectConfig::load()
74
KConfigGroup conf = EffectsHandler::effectConfig("SlideTabs");
76
bool switching = conf.readEntry("SlideSwitching", true);
77
bool grouping = conf.readEntry("SlideGrouping", true);
78
int duration = conf.readEntry("SlideDuration", 500);
79
m_ui->switching->setChecked(switching);
80
m_ui->grouping->setChecked(grouping);
81
m_ui->duration->setValue(duration);
85
void SlideTabsEffectConfig::defaults()
87
m_ui->grouping->setChecked(true);
88
m_ui->switching->setChecked(true);
89
m_ui->duration->setValue(500);
95
#include "slidetabs_config.moc"