Add missing files from the previous commit.
svn path=/trunk/KDE/kdebase/workspace/; revision=1102775
This commit is contained in:
parent
087f1a6fef
commit
f96b3645d5
4 changed files with 225 additions and 0 deletions
76
effects/blur/blur_config.cpp
Normal file
76
effects/blur/blur_config.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright © 2010 Fredrik Höglund <fredrik@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. if not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "blur_config.h"
|
||||
|
||||
#include <kwineffects.h>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
KWIN_EFFECT_CONFIG_FACTORY
|
||||
|
||||
BlurEffectConfig::BlurEffectConfig(QWidget *parent, const QVariantList &args)
|
||||
: KCModule(EffectFactory::componentData(), parent, args)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(ui.slider, SIGNAL(valueChanged(int)), SLOT(valueChanged(int)));
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
BlurEffectConfig::~BlurEffectConfig()
|
||||
{
|
||||
}
|
||||
|
||||
void BlurEffectConfig::load()
|
||||
{
|
||||
KCModule::load();
|
||||
KConfigGroup cg = EffectsHandler::effectConfig("Blur");
|
||||
ui.slider->setValue(cg.readEntry("BlurRadius", 12) / 2);
|
||||
emit changed(false);
|
||||
}
|
||||
|
||||
void BlurEffectConfig::save()
|
||||
{
|
||||
KCModule::save();
|
||||
|
||||
KConfigGroup cg = EffectsHandler::effectConfig("Blur");
|
||||
cg.writeEntry("BlurRadius", ui.slider->value() * 2);
|
||||
cg.sync();
|
||||
|
||||
emit changed(false);
|
||||
EffectsHandler::sendReloadMessage("blur");
|
||||
}
|
||||
|
||||
void BlurEffectConfig::defaults()
|
||||
{
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
void BlurEffectConfig::valueChanged(int value)
|
||||
{
|
||||
Q_UNUSED(value)
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#include "blur_config.moc"
|
||||
|
10
effects/blur/blur_config.desktop
Normal file
10
effects/blur/blur_config.desktop
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
X-KDE-ServiceTypes=KCModule
|
||||
|
||||
X-KDE-Library=kcm_kwin4_effect_builtins
|
||||
X-KDE-ParentComponents=kwin4_effect_blur
|
||||
X-KDE-PluginKeyword=blur
|
||||
|
||||
Name=Blur
|
||||
|
51
effects/blur/blur_config.h
Normal file
51
effects/blur/blur_config.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright © 2010 Fredrik Höglund <fredrik@kde.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. if not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef BLUR_CONFIG_H
|
||||
#define BLUR_CONFIG_H
|
||||
|
||||
#include <KCModule>
|
||||
#include "ui_blur_config.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class BlurEffectConfig : public KCModule
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BlurEffectConfig(QWidget *parent = 0, const QVariantList& args = QVariantList());
|
||||
~BlurEffectConfig();
|
||||
|
||||
void save();
|
||||
void load();
|
||||
void defaults();
|
||||
|
||||
private slots:
|
||||
void valueChanged(int value);
|
||||
|
||||
private:
|
||||
::Ui::BlurEffectConfig ui;
|
||||
};
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
#endif
|
||||
|
88
effects/blur/blur_config.ui
Normal file
88
effects/blur/blur_config.ui
Normal file
|
@ -0,0 +1,88 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BlurEffectConfig</class>
|
||||
<widget class="QWidget" name="BlurEffectConfig">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>206</width>
|
||||
<height>72</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Strength of the effect:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Light</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="slider">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBelow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Strong</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in a new issue