Changeset View
Changeset View
Standalone View
Standalone View
effects/scale/scale_config.cpp
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright (C) 2018 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
6 | | ||||
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. | ||||
11 | | ||||
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. | ||||
16 | | ||||
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 | | ||||
21 | #include "scale_config.h" | ||||
22 | | ||||
23 | // KConfigSkeleton | ||||
24 | #include "scaleconfig.h" | ||||
25 | #include <config-kwin.h> | ||||
26 | | ||||
27 | #include <kwineffects_interface.h> | ||||
28 | #include <KAboutData> | ||||
29 | #include <KPluginFactory> | ||||
30 | | ||||
31 | K_PLUGIN_FACTORY_WITH_JSON(ScaleEffectConfigFactory, | ||||
32 | "scale_config.json", | ||||
33 | registerPlugin<KWin::ScaleEffectConfig>();) | ||||
34 | | ||||
35 | namespace KWin | ||||
36 | { | ||||
37 | | ||||
38 | ScaleEffectConfig::ScaleEffectConfig(QWidget *parent, const QVariantList &args) | ||||
39 | : KCModule(KAboutData::pluginData(QStringLiteral("scale")), parent, args) | ||||
40 | { | ||||
41 | ui.setupUi(this); | ||||
42 | ScaleConfig::instance(KWIN_CONFIG); | ||||
43 | addConfig(ScaleConfig::self(), this); | ||||
44 | load(); | ||||
45 | } | ||||
46 | | ||||
47 | ScaleEffectConfig::~ScaleEffectConfig() | ||||
48 | { | ||||
49 | } | ||||
50 | | ||||
51 | void ScaleEffectConfig::save() | ||||
52 | { | ||||
53 | KCModule::save(); | ||||
54 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | ||||
55 | QStringLiteral("/Effects"), | ||||
56 | QDBusConnection::sessionBus()); | ||||
57 | interface.reconfigureEffect(QStringLiteral("scale")); | ||||
58 | } | ||||
59 | | ||||
60 | } // namespace KWin | ||||
61 | | ||||
62 | #include "scale_config.moc" |