author | ulf69 <ulf69> | 2004-08-06 20:29:00 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-06 20:29:00 (UTC) |
commit | 38d84409bcca83516eb816461c8b79b4cf6cbf57 (patch) (unidiff) | |
tree | f7cc928c007ed6f4bca43d7474343d78bd0f4eab /microkde/kutils/kcmultidialog.cpp | |
parent | 40ac88770c32ae78e194096e758ef3818d2fb434 (diff) | |
download | kdepimpi-38d84409bcca83516eb816461c8b79b4cf6cbf57.zip kdepimpi-38d84409bcca83516eb816461c8b79b4cf6cbf57.tar.gz kdepimpi-38d84409bcca83516eb816461c8b79b4cf6cbf57.tar.bz2 |
expanded functionality of kcmultidialog to support other applications
Diffstat (limited to 'microkde/kutils/kcmultidialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index 13be2ce..c2378fb 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp | |||
@@ -25,30 +25,31 @@ | |||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | 26 | ||
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <kglobal.h> | 28 | #include <kglobal.h> |
29 | #include <kdebug.h> | 29 | #include <kdebug.h> |
30 | #include <kiconloader.h> | 30 | #include <kiconloader.h> |
31 | #include <kmessagebox.h> | 31 | #include <kmessagebox.h> |
32 | //US #include <klibloader.h> | 32 | //US #include <klibloader.h> |
33 | #include <krun.h> | 33 | #include <krun.h> |
34 | #include <kprocess.h> | 34 | #include <kprocess.h> |
35 | 35 | ||
36 | #include "kcmultidialog.h" | 36 | #include "kcmultidialog.h" |
37 | #include "kprefs.h" | ||
37 | //US #include "kcmultidialog.moc" | 38 | //US #include "kcmultidialog.moc" |
38 | //US #include "kcmoduleloader.h" | 39 | //US #include "kcmoduleloader.h" |
39 | 40 | ||
40 | KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) | 41 | KCMultiDialog::KCMultiDialog(KPrefs* prefs, const QString& baseGroup, QWidget *parent, const char *name, bool modal) |
41 | : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, | 42 | : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, |
42 | parent, name, modal, true), d(0L) | 43 | parent, name, modal, true), mPrefs(prefs), d(0L) |
43 | { | 44 | { |
44 | enableButton(Apply, false); | 45 | enableButton(Apply, false); |
45 | //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); | 46 | //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); |
46 | 47 | ||
47 | connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); | 48 | connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); |
48 | 49 | ||
49 | _baseGroup = baseGroup; | 50 | _baseGroup = baseGroup; |
50 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); | 51 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); |
51 | setMainWidget(mMainWidget ); | 52 | setMainWidget(mMainWidget ); |
52 | #ifdef DESKTOP_VERSION | 53 | #ifdef DESKTOP_VERSION |
53 | resize(640,480); | 54 | resize(640,480); |
54 | #else | 55 | #else |
@@ -65,53 +66,53 @@ KCMultiDialog::~KCMultiDialog() | |||
65 | } | 66 | } |
66 | 67 | ||
67 | void KCMultiDialog::slotDefault() | 68 | void KCMultiDialog::slotDefault() |
68 | { | 69 | { |
69 | 70 | ||
70 | int curPageIndex = mMainWidget->activePageIndex(); | 71 | int curPageIndex = mMainWidget->activePageIndex(); |
71 | 72 | ||
72 | QPtrListIterator<KCModule> it(modules); | 73 | QPtrListIterator<KCModule> it(modules); |
73 | for (; it.current(); ++it) | 74 | for (; it.current(); ++it) |
74 | { | 75 | { |
75 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) | 76 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) |
76 | { | 77 | { |
77 | (*it)->defaults(); | 78 | (*it)->defaults(mPrefs); |
78 | clientChanged(true); | 79 | clientChanged(true); |
79 | return; | 80 | return; |
80 | } | 81 | } |
81 | } | 82 | } |
82 | 83 | ||
83 | } | 84 | } |
84 | 85 | ||
85 | void KCMultiDialog::slotApply() | 86 | void KCMultiDialog::slotApply() |
86 | { | 87 | { |
87 | qDebug("KCMultiDialog::slotApply clicked"); | 88 | qDebug("KCMultiDialog::slotApply clicked"); |
88 | 89 | ||
89 | QPtrListIterator<KCModule> it(modules); | 90 | QPtrListIterator<KCModule> it(modules); |
90 | for (; it.current(); ++it) | 91 | for (; it.current(); ++it) |
91 | (*it)->save(); | 92 | (*it)->save(mPrefs); |
92 | clientChanged(false); | 93 | clientChanged(false); |
93 | 94 | ||
94 | emit applyClicked(); | 95 | emit applyClicked(); |
95 | 96 | ||
96 | } | 97 | } |
97 | 98 | ||
98 | 99 | ||
99 | void KCMultiDialog::slotOk() | 100 | void KCMultiDialog::slotOk() |
100 | { | 101 | { |
101 | qDebug("KCMultiDialog::slotOk clicked"); | 102 | qDebug("KCMultiDialog::slotOk clicked"); |
102 | 103 | ||
103 | QPtrListIterator<KCModule> it(modules); | 104 | QPtrListIterator<KCModule> it(modules); |
104 | for (; it.current(); ++it) | 105 | for (; it.current(); ++it) |
105 | (*it)->save(); | 106 | (*it)->save(mPrefs); |
106 | accept(); | 107 | accept(); |
107 | 108 | ||
108 | emit okClicked(); | 109 | emit okClicked(); |
109 | } | 110 | } |
110 | 111 | ||
111 | void KCMultiDialog::slotHelp() | 112 | void KCMultiDialog::slotHelp() |
112 | { | 113 | { |
113 | /*US | 114 | /*US |
114 | KURL url( KURL("help:/"), _docPath ); | 115 | KURL url( KURL("help:/"), _docPath ); |
115 | 116 | ||
116 | if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { | 117 | if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { |
117 | KProcess process; | 118 | KProcess process; |
@@ -151,24 +152,26 @@ void KCMultiDialog::addModule(const QString& path, bool withfallback) | |||
151 | QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) | 152 | QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) |
152 | { | 153 | { |
153 | QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); | 154 | QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); |
154 | return page; | 155 | return page; |
155 | 156 | ||
156 | } | 157 | } |
157 | //US special method for microkde. We dop noty want to load everything dynamically. | 158 | //US special method for microkde. We dop noty want to load everything dynamically. |
158 | void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) | 159 | void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) |
159 | { | 160 | { |
160 | 161 | ||
161 | modules.append(module); | 162 | modules.append(module); |
162 | connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); | 163 | connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); |
164 | //US | ||
165 | module->load(mPrefs); | ||
163 | 166 | ||
164 | 167 | ||
165 | } | 168 | } |
166 | 169 | ||
167 | void KCMultiDialog::slotAboutToShow(QWidget *page) | 170 | void KCMultiDialog::slotAboutToShow(QWidget *page) |
168 | { | 171 | { |
169 | /*US | 172 | /*US |
170 | LoadInfo *loadInfo = moduleDict[page]; | 173 | LoadInfo *loadInfo = moduleDict[page]; |
171 | if (!loadInfo) | 174 | if (!loadInfo) |
172 | return; | 175 | return; |
173 | 176 | ||
174 | QApplication::setOverrideCursor(Qt::WaitCursor); | 177 | QApplication::setOverrideCursor(Qt::WaitCursor); |