summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui
Side-by-side diff
Diffstat (limited to 'microkde/kdeui') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/kcmodule.cpp16
-rw-r--r--microkde/kdeui/kcmodule.h11
2 files changed, 18 insertions, 9 deletions
diff --git a/microkde/kdeui/kcmodule.cpp b/microkde/kdeui/kcmodule.cpp
index 915cd0f..f646db3 100644
--- a/microkde/kdeui/kcmodule.cpp
+++ b/microkde/kdeui/kcmodule.cpp
@@ -32,24 +32,26 @@ public:
//US KInstance *_instance;
QString _rootOnlyMsg;
bool _useRootOnlyMsg;
bool _hasOwnInstance;
+ KPrefs* _prefs;
};
-KCModule::KCModule(QWidget *parent, const char *name, const QStringList &)
+KCModule::KCModule(KPrefs* prefs, QWidget *parent, const char *name, const QStringList &)
: QWidget(parent, name), _btn(Help|Default|Apply)
{
kdDebug() << "KCModule " << name << endl;
d = new KCModulePrivate;
d->_useRootOnlyMsg = true;
-/*US
+ d->_prefs = prefs;
+/*US
d->_instance = new KInstance(name);
if (name && strlen(name)) {
d->_instance = new KInstance(name);
KGlobal::locale()->insertCatalogue(name);
} else
d->_instance = new KInstance("kcmunnamed");
-*/
+*/
d->_hasOwnInstance = true;
//US KGlobal::setActiveInstance(this->instance());
}
@@ -70,9 +72,9 @@ KCModule::~KCModule()
{
/*US
if (d->_hasOwnInstance)
delete d->_instance;
-*/
+*/
delete d;
}
void KCModule::setRootOnlyMsg(const QString& msg)
@@ -93,8 +95,14 @@ void KCModule::setUseRootOnlyMsg(bool on)
bool KCModule::useRootOnlyMsg() const
{
return d->_useRootOnlyMsg;
}
+
+KPrefs* KCModule::getPreferences()
+{
+ return d->_prefs;
+}
+
/*US
KInstance *KCModule::instance() const
{
return d->_instance;
diff --git a/microkde/kdeui/kcmodule.h b/microkde/kdeui/kcmodule.h
index bc020bc..874958c 100644
--- a/microkde/kdeui/kcmodule.h
+++ b/microkde/kdeui/kcmodule.h
@@ -82,9 +82,9 @@ public:
* Base class for all KControlModules.
* Make sure you have a QStringList argument in your
* implementation.
*/
- KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() );
+ KCModule(KPrefs* prefs, QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() );
//US KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() );
/*
@@ -105,9 +105,9 @@ public:
* center, to undo all of his changes and restore the currently valid
* settings. NOTE that this is not called after the modules is loaded,
* so you probably want to call this method in the constructor.
*/
- virtual void load(KPrefs* prefs) {};
+ virtual void load() {};
/**
* Save the configuration data.
*
@@ -118,17 +118,17 @@ public:
* e.g. by restarting applications.
*
* save is called when the user clicks "Apply" or "Ok".
*/
- virtual void save(KPrefs* prefs) {};
+ virtual void save() {};
/**
* Sets the configuration to sensible default values.
*
* This method is called when the user clicks the "Default"
* button. It should set the display to useful values.
*/
- virtual void defaults(KPrefs* prefs) {};
+ virtual void defaults() {};
/**
* Set the configuration to system default values.
*
@@ -136,9 +136,9 @@ public:
* button. It should set the display to the system default values.
*
* NOTE: The default behaviour is to call defaults().
*/
- virtual void sysdefaults(KPrefs* prefs) { defaults(prefs); };
+ virtual void sysdefaults() { defaults(); };
/**
* Return a quick-help text.
*
@@ -192,8 +192,9 @@ public:
* @see KCModule::setUseRootOnlyMsg
*/
bool useRootOnlyMsg() const;
+ KPrefs* getPreferences();
//US KInstance *instance() const;
signals: