-rw-r--r-- | microkde/kdeui/kcmodule.cpp | 16 | ||||
-rw-r--r-- | microkde/kdeui/kcmodule.h | 11 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 13 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.h | 5 |
4 files changed, 25 insertions, 20 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 | |||
@@ -34,7 +34,8 @@ public: | |||
34 | bool _useRootOnlyMsg; | 34 | bool _useRootOnlyMsg; |
35 | bool _hasOwnInstance; | 35 | bool _hasOwnInstance; |
36 | KPrefs* _prefs; | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | KCModule::KCModule(QWidget *parent, const char *name, const QStringList &) | 39 | KCModule::KCModule(KPrefs* prefs, QWidget *parent, const char *name, const QStringList &) |
39 | : QWidget(parent, name), _btn(Help|Default|Apply) | 40 | : QWidget(parent, name), _btn(Help|Default|Apply) |
40 | { | 41 | { |
@@ -42,5 +43,6 @@ KCModule::KCModule(QWidget *parent, const char *name, const QStringList &) | |||
42 | d = new KCModulePrivate; | 43 | d = new KCModulePrivate; |
43 | d->_useRootOnlyMsg = true; | 44 | d->_useRootOnlyMsg = true; |
44 | /*US | 45 | d->_prefs = prefs; |
46 | /*US | ||
45 | d->_instance = new KInstance(name); | 47 | d->_instance = new KInstance(name); |
46 | if (name && strlen(name)) { | 48 | if (name && strlen(name)) { |
@@ -49,5 +51,5 @@ KCModule::KCModule(QWidget *parent, const char *name, const QStringList &) | |||
49 | } else | 51 | } else |
50 | d->_instance = new KInstance("kcmunnamed"); | 52 | d->_instance = new KInstance("kcmunnamed"); |
51 | */ | 53 | */ |
52 | d->_hasOwnInstance = true; | 54 | d->_hasOwnInstance = true; |
53 | //US KGlobal::setActiveInstance(this->instance()); | 55 | //US KGlobal::setActiveInstance(this->instance()); |
@@ -72,5 +74,5 @@ KCModule::~KCModule() | |||
72 | if (d->_hasOwnInstance) | 74 | if (d->_hasOwnInstance) |
73 | delete d->_instance; | 75 | delete d->_instance; |
74 | */ | 76 | */ |
75 | delete d; | 77 | delete d; |
76 | } | 78 | } |
@@ -95,4 +97,10 @@ bool KCModule::useRootOnlyMsg() const | |||
95 | return d->_useRootOnlyMsg; | 97 | return d->_useRootOnlyMsg; |
96 | } | 98 | } |
99 | |||
100 | KPrefs* KCModule::getPreferences() | ||
101 | { | ||
102 | return d->_prefs; | ||
103 | } | ||
104 | |||
97 | /*US | 105 | /*US |
98 | KInstance *KCModule::instance() const | 106 | 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 | |||
@@ -84,5 +84,5 @@ public: | |||
84 | * implementation. | 84 | * implementation. |
85 | */ | 85 | */ |
86 | KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() ); | 86 | KCModule(KPrefs* prefs, QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() ); |
87 | 87 | ||
88 | //US KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() ); | 88 | //US KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() ); |
@@ -107,5 +107,5 @@ public: | |||
107 | * so you probably want to call this method in the constructor. | 107 | * so you probably want to call this method in the constructor. |
108 | */ | 108 | */ |
109 | virtual void load(KPrefs* prefs) {}; | 109 | virtual void load() {}; |
110 | 110 | ||
111 | /** | 111 | /** |
@@ -120,5 +120,5 @@ public: | |||
120 | * save is called when the user clicks "Apply" or "Ok". | 120 | * save is called when the user clicks "Apply" or "Ok". |
121 | */ | 121 | */ |
122 | virtual void save(KPrefs* prefs) {}; | 122 | virtual void save() {}; |
123 | 123 | ||
124 | /** | 124 | /** |
@@ -128,5 +128,5 @@ public: | |||
128 | * button. It should set the display to useful values. | 128 | * button. It should set the display to useful values. |
129 | */ | 129 | */ |
130 | virtual void defaults(KPrefs* prefs) {}; | 130 | virtual void defaults() {}; |
131 | 131 | ||
132 | /** | 132 | /** |
@@ -138,5 +138,5 @@ public: | |||
138 | * NOTE: The default behaviour is to call defaults(). | 138 | * NOTE: The default behaviour is to call defaults(). |
139 | */ | 139 | */ |
140 | virtual void sysdefaults(KPrefs* prefs) { defaults(prefs); }; | 140 | virtual void sysdefaults() { defaults(); }; |
141 | 141 | ||
142 | /** | 142 | /** |
@@ -194,4 +194,5 @@ public: | |||
194 | bool useRootOnlyMsg() const; | 194 | bool useRootOnlyMsg() const; |
195 | 195 | ||
196 | KPrefs* getPreferences(); | ||
196 | 197 | ||
197 | //US KInstance *instance() const; | 198 | //US KInstance *instance() const; |
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index c2378fb..6c82e4f 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp | |||
@@ -35,11 +35,10 @@ | |||
35 | 35 | ||
36 | #include "kcmultidialog.h" | 36 | #include "kcmultidialog.h" |
37 | #include "kprefs.h" | ||
38 | //US #include "kcmultidialog.moc" | 37 | //US #include "kcmultidialog.moc" |
39 | //US #include "kcmoduleloader.h" | 38 | //US #include "kcmoduleloader.h" |
40 | 39 | ||
41 | KCMultiDialog::KCMultiDialog(KPrefs* prefs, const QString& baseGroup, QWidget *parent, const char *name, bool modal) | 40 | KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) |
42 | : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, | 41 | : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, |
43 | parent, name, modal, true), mPrefs(prefs), d(0L) | 42 | parent, name, modal, true), d(0L) |
44 | { | 43 | { |
45 | enableButton(Apply, false); | 44 | enableButton(Apply, false); |
@@ -76,5 +75,5 @@ void KCMultiDialog::slotDefault() | |||
76 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) | 75 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) |
77 | { | 76 | { |
78 | (*it)->defaults(mPrefs); | 77 | (*it)->defaults(); |
79 | clientChanged(true); | 78 | clientChanged(true); |
80 | return; | 79 | return; |
@@ -90,5 +89,5 @@ qDebug("KCMultiDialog::slotApply clicked"); | |||
90 | QPtrListIterator<KCModule> it(modules); | 89 | QPtrListIterator<KCModule> it(modules); |
91 | for (; it.current(); ++it) | 90 | for (; it.current(); ++it) |
92 | (*it)->save(mPrefs); | 91 | (*it)->save(); |
93 | clientChanged(false); | 92 | clientChanged(false); |
94 | 93 | ||
@@ -104,5 +103,5 @@ qDebug("KCMultiDialog::slotOk clicked"); | |||
104 | QPtrListIterator<KCModule> it(modules); | 103 | QPtrListIterator<KCModule> it(modules); |
105 | for (; it.current(); ++it) | 104 | for (; it.current(); ++it) |
106 | (*it)->save(mPrefs); | 105 | (*it)->save(); |
107 | accept(); | 106 | accept(); |
108 | 107 | ||
@@ -163,5 +162,5 @@ void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, | |||
163 | connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); | 162 | connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); |
164 | //US | 163 | //US |
165 | module->load(mPrefs); | 164 | module->load(); |
166 | 165 | ||
167 | 166 | ||
diff --git a/microkde/kutils/kcmultidialog.h b/microkde/kutils/kcmultidialog.h index a42555f..1aa66b2 100644 --- a/microkde/kutils/kcmultidialog.h +++ b/microkde/kutils/kcmultidialog.h | |||
@@ -30,6 +30,4 @@ | |||
30 | #include <kcmodule.h> | 30 | #include <kcmodule.h> |
31 | 31 | ||
32 | class KPrefs; | ||
33 | |||
34 | /** | 32 | /** |
35 | * A class that offers a @ref KDialogBase containing arbitrary KControl Modules | 33 | * A class that offers a @ref KDialogBase containing arbitrary KControl Modules |
@@ -55,5 +53,5 @@ public: | |||
55 | * @param modal If you pass true here, the dialog will be modal | 53 | * @param modal If you pass true here, the dialog will be modal |
56 | **/ | 54 | **/ |
57 | KCMultiDialog(KPrefs* prefs, const QString& baseGroup = QString::fromLatin1("settings"), | 55 | KCMultiDialog(const QString& baseGroup = QString::fromLatin1("settings"), |
58 | QWidget *parent=0, const char *name=0, | 56 | QWidget *parent=0, const char *name=0, |
59 | bool modal=false); | 57 | bool modal=false); |
@@ -140,5 +138,4 @@ private: | |||
140 | //US | 138 | //US |
141 | KJanusWidget* mMainWidget; | 139 | KJanusWidget* mMainWidget; |
142 | KPrefs* mPrefs; | ||
143 | 140 | ||
144 | // For future use | 141 | // For future use |