ported the KCModules

svn path=/trunk/KDE/kdebase/workspace/; revision=473152
This commit is contained in:
Stephan Kulow 2005-10-22 19:12:01 +00:00
parent 776dc6395e
commit 7fff57dbcf
8 changed files with 61 additions and 56 deletions

View file

@ -36,57 +36,55 @@
#include "main.h" #include "main.h"
static KInstance *_kcmkwm = 0;
inline KInstance *inst() {
if (_kcmkwm)
return _kcmkwm;
_kcmkwm = new KInstance("kcmkwm");
return _kcmkwm;
}
extern "C" extern "C"
{ {
KDE_EXPORT KCModule *create_kwinfocus(QWidget *parent, const char *name) KDE_EXPORT KCModule *create_kwinfocus(QWidget *parent, const char *name)
{ {
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalog("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true); KConfig *c = new KConfig("kwinrc", false, true);
return new KFocusConfig(true, c, parent, name); return new KFocusConfig(true, c, inst(), parent);
} }
KDE_EXPORT KCModule *create_kwinactions(QWidget *parent, const char *name) KDE_EXPORT KCModule *create_kwinactions(QWidget *parent, const char *name)
{ {
//CT there's need for decision: kwm or kwin? return new KActionsOptions( inst(), parent);
KGlobal::locale()->insertCatalog("kcmkwm");
return new KActionsOptions( parent, name);
} }
KDE_EXPORT KCModule *create_kwinmoving(QWidget *parent, const char *name) KDE_EXPORT KCModule *create_kwinmoving(QWidget *parent, const char *name)
{ {
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalog("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true); KConfig *c = new KConfig("kwinrc", false, true);
return new KMovingConfig(true, c, parent, name); return new KMovingConfig(true, c, inst(), parent);
} }
KDE_EXPORT KCModule *create_kwinadvanced(QWidget *parent, const char *name) KDE_EXPORT KCModule *create_kwinadvanced(QWidget *parent, const char *name)
{ {
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalog("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true); KConfig *c = new KConfig("kwinrc", false, true);
return new KAdvancedConfig(true, c, parent, name); return new KAdvancedConfig(true, c, inst(), parent);
} }
KDE_EXPORT KCModule *create_kwintranslucency(QWidget *parent, const char *name) KDE_EXPORT KCModule *create_kwintranslucency(QWidget *parent, const char *name)
{ {
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalog("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true); KConfig *c = new KConfig("kwinrc", false, true);
return new KTranslucencyConfig(true, c, parent, name); return new KTranslucencyConfig(true, c, inst(), parent);
} }
KDE_EXPORT KCModule *create_kwinoptions ( QWidget *parent, const char* name) KDE_EXPORT KCModule *create_kwinoptions ( QWidget *parent, const char* name)
{ {
//CT there's need for decision: kwm or kwin? return new KWinOptions( inst(), parent);
KGlobal::locale()->insertCatalog("kcmkwm");
return new KWinOptions( parent, name);
} }
} }
KWinOptions::KWinOptions(QWidget *parent, const char *name) KWinOptions::KWinOptions(KInstance *inst, QWidget *parent)
: KCModule(parent, name) : KCModule(inst, parent)
{ {
mConfig = new KConfig("kwinrc", false, true); mConfig = new KConfig("kwinrc", false, true);
@ -94,32 +92,38 @@ KWinOptions::KWinOptions(QWidget *parent, const char *name)
tab = new QTabWidget(this); tab = new QTabWidget(this);
layout->addWidget(tab); layout->addWidget(tab);
mFocus = new KFocusConfig(false, mConfig, this, "KWin Focus Config"); mFocus = new KFocusConfig(false, mConfig, inst, this);
mFocus->setObjectName("KWin Focus Config");
mFocus->layout()->setMargin( KDialog::marginHint() ); mFocus->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mFocus, i18n("&Focus")); tab->addTab(mFocus, i18n("&Focus"));
connect(mFocus, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mFocus, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions"); mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, inst, this);
mTitleBarActions->setObjectName("KWin TitleBar Actions");
mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); mTitleBarActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); tab->addTab(mTitleBarActions, i18n("&Titlebar Actions"));
connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin Window Actions"); mWindowActions = new KWindowActionsConfig(false, mConfig, inst, this);
mWindowActions->setObjectName("KWin Window Actions");
mWindowActions->layout()->setMargin( KDialog::marginHint() ); mWindowActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mWindowActions, i18n("Window Actio&ns")); tab->addTab(mWindowActions, i18n("Window Actio&ns"));
connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mMoving = new KMovingConfig(false, mConfig, this, "KWin Moving"); mMoving = new KMovingConfig(false, mConfig, inst, this);
mMoving->setObjectName("KWin Moving");
mMoving->layout()->setMargin( KDialog::marginHint() ); mMoving->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mMoving, i18n("&Moving")); tab->addTab(mMoving, i18n("&Moving"));
connect(mMoving, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mMoving, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mAdvanced = new KAdvancedConfig(false, mConfig, this, "KWin Advanced"); mAdvanced = new KAdvancedConfig(false, mConfig, inst, this);
mAdvanced->setObjectName("KWin Advanced");
mAdvanced->layout()->setMargin( KDialog::marginHint() ); mAdvanced->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mAdvanced, i18n("Ad&vanced")); tab->addTab(mAdvanced, i18n("Ad&vanced"));
connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mTranslucency = new KTranslucencyConfig(false, mConfig, this, "KWin Translucency"); mTranslucency = new KTranslucencyConfig(false, mConfig, inst, this);
mTranslucency->setObjectName("KWin Translucency");
mTranslucency->layout()->setMargin( KDialog::marginHint() ); mTranslucency->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTranslucency, i18n("&Translucency")); tab->addTab(mTranslucency, i18n("&Translucency"));
connect(mTranslucency, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mTranslucency, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
@ -203,8 +207,8 @@ void KWinOptions::moduleChanged(bool state)
} }
KActionsOptions::KActionsOptions(QWidget *parent, const char *name) KActionsOptions::KActionsOptions(KInstance *inst, QWidget *parent)
: KCModule(parent, name) : KCModule(inst, parent)
{ {
mConfig = new KConfig("kwinrc", false, true); mConfig = new KConfig("kwinrc", false, true);
@ -212,12 +216,14 @@ KActionsOptions::KActionsOptions(QWidget *parent, const char *name)
tab = new QTabWidget(this); tab = new QTabWidget(this);
layout->addWidget(tab); layout->addWidget(tab);
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions"); mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, inst, this);
mTitleBarActions->setObjectName("KWin TitleBar Actions");
mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); mTitleBarActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); tab->addTab(mTitleBarActions, i18n("&Titlebar Actions"));
connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin Window Actions"); mWindowActions = new KWindowActionsConfig(false, mConfig, inst, this);
mWindowActions->setObjectName("KWin Window Actions");
mWindowActions->layout()->setMargin( KDialog::marginHint() ); mWindowActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mWindowActions, i18n("Window Actio&ns")); tab->addTab(mWindowActions, i18n("Window Actio&ns"));
connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));

View file

@ -41,7 +41,7 @@ class KWinOptions : public KCModule
public: public:
KWinOptions(QWidget *parent, const char *name); KWinOptions(KInstance *inst, QWidget *parent);
virtual ~KWinOptions(); virtual ~KWinOptions();
void load(); void load();
@ -75,7 +75,7 @@ class KActionsOptions : public KCModule
public: public:
KActionsOptions(QWidget *parent, const char *name); KActionsOptions(KInstance *inst, QWidget *parent);
virtual ~KActionsOptions(); virtual ~KActionsOptions();
void load(); void load();

View file

@ -135,8 +135,8 @@ void KTitleBarActionsConfig::paletteChanged()
} }
KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *) KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget * parent)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{ {
QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3; QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3;
QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint()); QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
@ -587,8 +587,8 @@ void KTitleBarActionsConfig::defaults()
} }
KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *) KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget * parent)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{ {
QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW; QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW;
QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint()); QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());

View file

@ -54,7 +54,7 @@ class KTitleBarActionsConfig : public KCModule
public: public:
KTitleBarActionsConfig( bool _standAlone, KConfig *_config, QWidget *parent=0, const char* name=0 ); KTitleBarActionsConfig( bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent );
~KTitleBarActionsConfig( ); ~KTitleBarActionsConfig( );
void load(); void load();
@ -100,7 +100,7 @@ class KWindowActionsConfig : public KCModule
public: public:
KWindowActionsConfig( bool _standAlone, KConfig *_config, QWidget *parent=0, const char* name=0 ); KWindowActionsConfig( bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent );
~KWindowActionsConfig( ); ~KWindowActionsConfig( );
void load(); void load();

View file

@ -104,8 +104,8 @@ KFocusConfig::~KFocusConfig ()
} }
// removed the LCD display over the slider - this is not good GUI design :) RNolden 051701 // removed the LCD display over the slider - this is not good GUI design :) RNolden 051701
KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *) KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget * parent)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{ {
QString wtstr; QString wtstr;
QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint()); QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint());
@ -510,8 +510,8 @@ KAdvancedConfig::~KAdvancedConfig ()
delete config; delete config;
} }
KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, QWidget *parent, const char *) KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{ {
QString wtstr; QString wtstr;
QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint()); QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint());
@ -768,8 +768,8 @@ KMovingConfig::~KMovingConfig ()
delete config; delete config;
} }
KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, QWidget *parent, const char *) KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{ {
QString wtstr; QString wtstr;
QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint()); QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint());
@ -1200,8 +1200,8 @@ KTranslucencyConfig::~KTranslucencyConfig ()
kompmgr->detach(); kompmgr->detach();
} }
KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QWidget *parent, const char *) KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent)
: KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) : KCModule(inst, parent), config(_config), standAlone(_standAlone)
{ {
kompmgr = 0L; kompmgr = 0L;
resetKompmgr_ = FALSE; resetKompmgr_ = FALSE;

View file

@ -72,7 +72,7 @@ class KFocusConfig : public KCModule
{ {
Q_OBJECT Q_OBJECT
public: public:
KFocusConfig( bool _standAlone, KConfig *_config, QWidget *parent=0, const char* name=0 ); KFocusConfig( bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent );
~KFocusConfig(); ~KFocusConfig();
void load(); void load();
@ -127,7 +127,7 @@ class KMovingConfig : public KCModule
{ {
Q_OBJECT Q_OBJECT
public: public:
KMovingConfig( bool _standAlone, KConfig *config, QWidget *parent=0, const char* name=0 ); KMovingConfig( bool _standAlone, KConfig *config, KInstance *inst, QWidget *parent );
~KMovingConfig(); ~KMovingConfig();
void load(); void load();
@ -182,7 +182,7 @@ class KAdvancedConfig : public KCModule
{ {
Q_OBJECT Q_OBJECT
public: public:
KAdvancedConfig( bool _standAlone, KConfig *config, QWidget *parent=0, const char* name=0 ); KAdvancedConfig( bool _standAlone, KConfig *config, KInstance *inst, QWidget *parent );
~KAdvancedConfig(); ~KAdvancedConfig();
void load(); void load();
@ -235,7 +235,7 @@ class KTranslucencyConfig : public KCModule
{ {
Q_OBJECT Q_OBJECT
public: public:
KTranslucencyConfig( bool _standAlone, KConfig *config, QWidget *parent=0, const char* name=0 ); KTranslucencyConfig( bool _standAlone, KConfig *config, KInstance *inst, QWidget *parent);
~KTranslucencyConfig(); ~KTranslucencyConfig();
void load(); void load();

View file

@ -32,16 +32,15 @@
extern "C" extern "C"
KDE_EXPORT KCModule *create_kwinrules( QWidget *parent, const char *name ) KDE_EXPORT KCModule *create_kwinrules( QWidget *parent, const char *name )
{ {
//CT there's need for decision: kwm or kwin? KInstance *inst = new KInstance("kcmkwinrules");
KGlobal::locale()->insertCatalog( "kcmkwinrules" ); return new KWinInternal::KCMRules( inst, parent );
return new KWinInternal::KCMRules( parent, name );
} }
namespace KWinInternal namespace KWinInternal
{ {
KCMRules::KCMRules( QWidget *parent, const char *name ) KCMRules::KCMRules( KInstance *inst, QWidget *parent )
: KCModule( parent, name ) : KCModule( inst, parent )
, config( "kwinrulesrc" ) , config( "kwinrulesrc" )
{ {
QVBoxLayout *layout = new QVBoxLayout( this ); QVBoxLayout *layout = new QVBoxLayout( this );

View file

@ -36,7 +36,7 @@ class KCMRules
{ {
Q_OBJECT Q_OBJECT
public: public:
KCMRules( QWidget *parent, const char *name ); KCMRules( KInstance *inst, QWidget *parent );
virtual void load(); virtual void load();
virtual void save(); virtual void save();
virtual void defaults(); virtual void defaults();