kcm.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "kcm.h"
00020
00021 #include <kglobal.h>
00022 #include <qlayout.h>
00023 #include <klocale.h>
00024 #include <kapplication.h>
00025 #include <dcopclient.h>
00026 #include <kaboutdata.h>
00027
00028 #include "ruleslist.h"
00029
00030 extern "C"
00031 KDE_EXPORT KCModule *create_kwinrules( QWidget *parent, const char *name )
00032 {
00033
00034 KGlobal::locale()->insertCatalogue( "kcmkwinrules" );
00035 return new KWinInternal::KCMRules( parent, name );
00036 }
00037
00038 namespace KWinInternal
00039 {
00040
00041 KCMRules::KCMRules( QWidget *parent, const char *name )
00042 : KCModule( parent, name )
00043 , config( "kwinrulesrc" )
00044 {
00045 QVBoxLayout *layout = new QVBoxLayout( this );
00046 widget = new KCMRulesList( this );
00047 layout->addWidget( widget );
00048 connect( widget, SIGNAL( changed( bool )), SLOT( moduleChanged( bool )));
00049 KAboutData *about = new KAboutData(I18N_NOOP( "kcmkwinrules" ),
00050 I18N_NOOP( "Window-Specific Settings Configuration Module" ),
00051 0, 0, KAboutData::License_GPL, I18N_NOOP( "(c) 2004 KWin and KControl Authors" ));
00052 about->addAuthor("Lubos Lunak",0,"l.lunak@kde.org");
00053 setAboutData(about);
00054 }
00055
00056 void KCMRules::load()
00057 {
00058 config.reparseConfiguration();
00059 widget->load();
00060 emit KCModule::changed( false );
00061 }
00062
00063 void KCMRules::save()
00064 {
00065 widget->save();
00066 emit KCModule::changed( false );
00067
00068 config.sync();
00069 if( !kapp->dcopClient()->isAttached())
00070 kapp->dcopClient()->attach();
00071 kapp->dcopClient()->send("kwin*", "", "reconfigure()", "");
00072 }
00073
00074 void KCMRules::defaults()
00075 {
00076 widget->defaults();
00077 }
00078
00079 QString KCMRules::quickHelp() const
00080 {
00081 return i18n("<h1>Window-specific Settings</h1> Here you can customize window settings specifically only"
00082 " for some windows."
00083 " <p>Please note that this configuration will not take effect if you do not use"
00084 " KWin as your window manager. If you do use a different window manager, please refer to its documentation"
00085 " for how to customize window behavior.");
00086 }
00087
00088 void KCMRules::moduleChanged( bool state )
00089 {
00090 emit KCModule::changed( state );
00091 }
00092
00093 }
00094
00095
00096 #if 0
00097 I18N_NOOP("Remember settings separately for every window")
00098 I18N_NOOP("Show internal settings for remembering")
00099 I18N_NOOP("Internal setting for remembering")
00100 #endif
00101
00102
00103 #include "kcm.moc"
This file is part of the documentation for kwin Library Version 3.4.0.