-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index c4ccede..248476f 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp | |||
@@ -26,130 +26,128 @@ | |||
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 | //US #include "kcmultidialog.moc" | 37 | //US #include "kcmultidialog.moc" |
38 | //US #include "kcmoduleloader.h" | 38 | //US #include "kcmoduleloader.h" |
39 | 39 | ||
40 | KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) | 40 | KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) |
41 | : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, | 41 | : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, |
42 | parent, name, modal, true), d(0L) | 42 | parent, name, modal, true), d(0L) |
43 | { | 43 | { |
44 | enableButton(Apply, false); | 44 | enableButton(Apply, false); |
45 | //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); | 45 | //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); |
46 | 46 | ||
47 | connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); | 47 | connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); |
48 | 48 | ||
49 | _baseGroup = baseGroup; | 49 | _baseGroup = baseGroup; |
50 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); | 50 | mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); |
51 | setMainWidget(mMainWidget ); | 51 | setMainWidget(mMainWidget ); |
52 | #ifdef DESKTOP_VERSION | 52 | #ifdef DESKTOP_VERSION |
53 | resize(640,480); | 53 | resize(640,480); |
54 | #else | 54 | #else |
55 | resize(640,480); | 55 | resize(640,480); |
56 | setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); | 56 | setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); |
57 | //showMaximized(); | 57 | //showMaximized(); |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | } | 60 | } |
61 | 61 | ||
62 | KCMultiDialog::~KCMultiDialog() | 62 | KCMultiDialog::~KCMultiDialog() |
63 | { | 63 | { |
64 | //US moduleDict.setAutoDelete(true); | 64 | //US moduleDict.setAutoDelete(true); |
65 | } | 65 | } |
66 | 66 | ||
67 | void KCMultiDialog::slotDefault() | 67 | void KCMultiDialog::slotDefault() |
68 | { | 68 | { |
69 | 69 | ||
70 | int curPageIndex = activePageIndex(); | 70 | int curPageIndex = activePageIndex(); |
71 | 71 | ||
72 | QPtrListIterator<KCModule> it(modules); | 72 | QPtrListIterator<KCModule> it(modules); |
73 | for (; it.current(); ++it) | 73 | for (; it.current(); ++it) |
74 | { | 74 | { |
75 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) | 75 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) |
76 | { | 76 | { |
77 | (*it)->defaults(); | 77 | (*it)->defaults(); |
78 | clientChanged(true); | 78 | clientChanged(true); |
79 | return; | 79 | return; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | } | 83 | } |
84 | void KCMultiDialog::accept() | 84 | void KCMultiDialog::accept() |
85 | { | 85 | { |
86 | slotOk(); | 86 | slotOk(); |
87 | } | 87 | } |
88 | void KCMultiDialog::slotApply() | 88 | void KCMultiDialog::slotApply() |
89 | { | 89 | { |
90 | qDebug("KCMultiDialog::slotApply clicked"); | ||
91 | |||
92 | QPtrListIterator<KCModule> it(modules); | 90 | QPtrListIterator<KCModule> it(modules); |
93 | for (; it.current(); ++it) | 91 | for (; it.current(); ++it) |
94 | (*it)->save(); | 92 | (*it)->save(); |
95 | clientChanged(false); | 93 | clientChanged(false); |
96 | 94 | ||
97 | emit applyClicked(); | 95 | emit applyClicked(); |
98 | 96 | ||
99 | } | 97 | } |
100 | 98 | ||
101 | 99 | ||
102 | void KCMultiDialog::slotOk() | 100 | void KCMultiDialog::slotOk() |
103 | { | 101 | { |
104 | qDebug("KCMultiDialog::slotOk clicked"); | 102 | qDebug("KCMultiDialog::slotOk clicked"); |
105 | 103 | ||
106 | QPtrListIterator<KCModule> it(modules); | 104 | QPtrListIterator<KCModule> it(modules); |
107 | for (; it.current(); ++it) | 105 | for (; it.current(); ++it) |
108 | (*it)->save(); | 106 | (*it)->save(); |
109 | QDialog::accept(); | 107 | QDialog::accept(); |
110 | 108 | ||
111 | emit okClicked(); | 109 | emit okClicked(); |
112 | } | 110 | } |
113 | 111 | ||
114 | void KCMultiDialog::slotHelp() | 112 | void KCMultiDialog::slotHelp() |
115 | { | 113 | { |
116 | /*US | 114 | /*US |
117 | KURL url( KURL("help:/"), _docPath ); | 115 | KURL url( KURL("help:/"), _docPath ); |
118 | 116 | ||
119 | if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { | 117 | if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { |
120 | KProcess process; | 118 | KProcess process; |
121 | process << "khelpcenter" | 119 | process << "khelpcenter" |
122 | << url.url(); | 120 | << url.url(); |
123 | process.start(KProcess::DontCare); | 121 | process.start(KProcess::DontCare); |
124 | process.detach(); | 122 | process.detach(); |
125 | } else { | 123 | } else { |
126 | new KRun(url); | 124 | new KRun(url); |
127 | } | 125 | } |
128 | */ | 126 | */ |
129 | } | 127 | } |
130 | 128 | ||
131 | void KCMultiDialog::clientChanged(bool state) | 129 | void KCMultiDialog::clientChanged(bool state) |
132 | { | 130 | { |
133 | enableButton(Apply, state); | 131 | enableButton(Apply, state); |
134 | } | 132 | } |
135 | 133 | ||
136 | /*US | 134 | /*US |
137 | void KCMultiDialog::addModule(const QString& path, bool withfallback) | 135 | void KCMultiDialog::addModule(const QString& path, bool withfallback) |
138 | { | 136 | { |
139 | kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; | 137 | kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; |
140 | 138 | ||
141 | KCModuleInfo info(path, _baseGroup); | 139 | KCModuleInfo info(path, _baseGroup); |
142 | 140 | ||
143 | QHBox* page = addHBoxPage(info.moduleName(), info.comment(), | 141 | QHBox* page = addHBoxPage(info.moduleName(), info.comment(), |
144 | KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium)); | 142 | KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium)); |
145 | if(!page) { | 143 | if(!page) { |
146 | KCModuleLoader::unloadModule(info); | 144 | KCModuleLoader::unloadModule(info); |
147 | return; | 145 | return; |
148 | } | 146 | } |
149 | moduleDict.insert(page, new LoadInfo(path, withfallback)); | 147 | moduleDict.insert(page, new LoadInfo(path, withfallback)); |
150 | if (modules.isEmpty()) | 148 | if (modules.isEmpty()) |
151 | slotAboutToShow(page); | 149 | slotAboutToShow(page); |
152 | } | 150 | } |
153 | */ | 151 | */ |
154 | QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) | 152 | QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) |
155 | { | 153 | { |