From c9d570427f3d5bead7bee1301514a2d4b82836ea Mon Sep 17 00:00:00 2001 From: ulf69 Date: Tue, 10 Aug 2004 01:34:22 +0000 Subject: enhancements to configure external apps like email and phones through a generalized interface --- (limited to 'microkde/kdeui') 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 @@ -33,22 +33,24 @@ public: 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()); } @@ -71,7 +73,7 @@ KCModule::~KCModule() /*US if (d->_hasOwnInstance) delete d->_instance; -*/ +*/ delete d; } @@ -94,6 +96,12 @@ bool KCModule::useRootOnlyMsg() const { return d->_useRootOnlyMsg; } + +KPrefs* KCModule::getPreferences() +{ + return d->_prefs; +} + /*US KInstance *KCModule::instance() const { 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 @@ -83,7 +83,7 @@ public: * 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() ); @@ -106,7 +106,7 @@ public: * 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. @@ -119,7 +119,7 @@ public: * * 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. @@ -127,7 +127,7 @@ public: * 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. @@ -137,7 +137,7 @@ public: * * NOTE: The default behaviour is to call defaults(). */ - virtual void sysdefaults(KPrefs* prefs) { defaults(prefs); }; + virtual void sysdefaults() { defaults(); }; /** * Return a quick-help text. @@ -193,6 +193,7 @@ public: */ bool useRootOnlyMsg() const; + KPrefs* getPreferences(); //US KInstance *instance() const; -- cgit v0.9.0.2