add more spacing
[personal-kdebase.git] / workspace / kwin / kcmkwin / kwinrules / kcm.cpp
blob832f1cb5a1ea252fbdeb52997ffd2b5d51fa1c3a
1 /*
2 * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "kcm.h"
21 #include <kglobal.h>
22 #include <QLayout>
23 //Added by qt3to4:
24 #include <QVBoxLayout>
25 #include <klocale.h>
26 #include <kapplication.h>
27 #include <kaboutdata.h>
28 #include <QtDBus/QtDBus>
30 #include "ruleslist.h"
31 #include <KPluginFactory>
32 #include <KPluginLoader>
34 K_PLUGIN_FACTORY(KCMRulesFactory,
35 registerPlugin<KWin::KCMRules>();
37 K_EXPORT_PLUGIN(KCMRulesFactory("kcmkwinrules"))
39 namespace KWin
42 KCMRules::KCMRules( QWidget *parent, const QVariantList & )
43 : KCModule( KCMRulesFactory::componentData(), parent )
44 , config( "kwinrulesrc" )
46 QVBoxLayout *layout = new QVBoxLayout( this );
47 layout->setMargin(0);
49 widget = new KCMRulesList( this );
50 layout->addWidget( widget );
51 connect( widget, SIGNAL( changed( bool )), SLOT( moduleChanged( bool )));
52 KAboutData *about = new KAboutData(I18N_NOOP( "kcmkwinrules" ), 0,
53 ki18n( "Window-Specific Settings Configuration Module" ),
54 0, KLocalizedString(), KAboutData::License_GPL, ki18n( "(c) 2004 KWin and KControl Authors" ));
55 about->addAuthor(ki18n("Lubos Lunak"),KLocalizedString(),"l.lunak@kde.org");
56 setAboutData(about);
59 void KCMRules::load()
61 config.reparseConfiguration();
62 widget->load();
63 emit KCModule::changed( false );
66 void KCMRules::save()
68 widget->save();
69 emit KCModule::changed( false );
70 // Send signal to kwin
71 config.sync();
72 // Send signal to all kwin instances
73 QDBusMessage message =
74 QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
75 QDBusConnection::sessionBus().send(message);
79 void KCMRules::defaults()
81 widget->defaults();
84 QString KCMRules::quickHelp() const
86 return i18n("<p><h1>Window-specific Settings</h1> Here you can customize window settings specifically only"
87 " for some windows.</p>"
88 " <p>Please note that this configuration will not take effect if you do not use"
89 " KWin as your window manager. If you do use a different window manager, please refer to its documentation"
90 " for how to customize window behavior.</p>");
93 void KCMRules::moduleChanged( bool state )
95 emit KCModule::changed( state );
100 // i18n freeze :-/
101 #if 0
102 I18N_NOOP("Remember settings separately for every window")
103 I18N_NOOP("Show internal settings for remembering")
104 I18N_NOOP("Internal setting for remembering")
105 #endif
108 #include "kcm.moc"