author | ulf69 <ulf69> | 2004-08-10 01:34:22 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-10 01:34:22 (UTC) |
commit | c9d570427f3d5bead7bee1301514a2d4b82836ea (patch) (unidiff) | |
tree | 8d25f388217c591b7dac1db6c26d0777e6459352 /microkde/kdeui/kcmodule.cpp | |
parent | 4f05a9fcbb9e54184aef93883886aaf865104463 (diff) | |
download | kdepimpi-c9d570427f3d5bead7bee1301514a2d4b82836ea.zip kdepimpi-c9d570427f3d5bead7bee1301514a2d4b82836ea.tar.gz kdepimpi-c9d570427f3d5bead7bee1301514a2d4b82836ea.tar.bz2 |
enhancements to configure external apps like email and phones through a
generalized interface
-rw-r--r-- | microkde/kdeui/kcmodule.cpp | 16 |
1 files changed, 12 insertions, 4 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 | |||
@@ -12,95 +12,103 @@ | |||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "kcmodule.h" | 23 | #include "kcmodule.h" |
24 | //US#include <kinstance.h> | 24 | //US#include <kinstance.h> |
25 | #include <kglobal.h> | 25 | #include <kglobal.h> |
26 | #include <klocale.h> | 26 | #include <klocale.h> |
27 | #include <kdebug.h> | 27 | #include <kdebug.h> |
28 | 28 | ||
29 | class KCModulePrivate | 29 | class KCModulePrivate |
30 | { | 30 | { |
31 | public: | 31 | public: |
32 | //US KInstance *_instance; | 32 | //US KInstance *_instance; |
33 | QString _rootOnlyMsg; | 33 | QString _rootOnlyMsg; |
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 | { |
41 | kdDebug() << "KCModule " << name << endl; | 42 | kdDebug() << "KCModule " << name << endl; |
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)) { |
47 | d->_instance = new KInstance(name); | 49 | d->_instance = new KInstance(name); |
48 | KGlobal::locale()->insertCatalogue(name); | 50 | KGlobal::locale()->insertCatalogue(name); |
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()); |
54 | } | 56 | } |
55 | 57 | ||
56 | /*US | 58 | /*US |
57 | KCModule::KCModule(KInstance *instance, QWidget *parent, const QStringList & ) | 59 | KCModule::KCModule(KInstance *instance, QWidget *parent, const QStringList & ) |
58 | : QWidget(parent, instance ? instance->instanceName().data() : 0), _btn(Help|Default|Apply) | 60 | : QWidget(parent, instance ? instance->instanceName().data() : 0), _btn(Help|Default|Apply) |
59 | { | 61 | { |
60 | kdDebug() << "KCModule instance " << (instance ? instance->instanceName().data() : "none") << endl; | 62 | kdDebug() << "KCModule instance " << (instance ? instance->instanceName().data() : "none") << endl; |
61 | d = new KCModulePrivate; | 63 | d = new KCModulePrivate; |
62 | d->_useRootOnlyMsg = true; | 64 | d->_useRootOnlyMsg = true; |
63 | d->_instance = instance; | 65 | d->_instance = instance; |
64 | KGlobal::locale()->insertCatalogue(instance->instanceName()); | 66 | KGlobal::locale()->insertCatalogue(instance->instanceName()); |
65 | d->_hasOwnInstance = false; | 67 | d->_hasOwnInstance = false; |
66 | KGlobal::setActiveInstance(this->instance()); | 68 | KGlobal::setActiveInstance(this->instance()); |
67 | } | 69 | } |
68 | */ | 70 | */ |
69 | KCModule::~KCModule() | 71 | KCModule::~KCModule() |
70 | { | 72 | { |
71 | /*US | 73 | /*US |
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 | } |
77 | 79 | ||
78 | void KCModule::setRootOnlyMsg(const QString& msg) | 80 | void KCModule::setRootOnlyMsg(const QString& msg) |
79 | { | 81 | { |
80 | d->_rootOnlyMsg = msg; | 82 | d->_rootOnlyMsg = msg; |
81 | } | 83 | } |
82 | 84 | ||
83 | QString KCModule::rootOnlyMsg() const | 85 | QString KCModule::rootOnlyMsg() const |
84 | { | 86 | { |
85 | return d->_rootOnlyMsg; | 87 | return d->_rootOnlyMsg; |
86 | } | 88 | } |
87 | 89 | ||
88 | void KCModule::setUseRootOnlyMsg(bool on) | 90 | void KCModule::setUseRootOnlyMsg(bool on) |
89 | { | 91 | { |
90 | d->_useRootOnlyMsg = on; | 92 | d->_useRootOnlyMsg = on; |
91 | } | 93 | } |
92 | 94 | ||
93 | bool KCModule::useRootOnlyMsg() const | 95 | bool KCModule::useRootOnlyMsg() const |
94 | { | 96 | { |
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 |
99 | { | 107 | { |
100 | return d->_instance; | 108 | return d->_instance; |
101 | } | 109 | } |
102 | */ | 110 | */ |
103 | void KCModule::virtual_hook( int, void* ) | 111 | void KCModule::virtual_hook( int, void* ) |
104 | { /*BASE::virtual_hook( id, data );*/ } | 112 | { /*BASE::virtual_hook( id, data );*/ } |
105 | 113 | ||
106 | //US #include "kcmodule.moc" | 114 | //US #include "kcmodule.moc" |