-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 7 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index 6c82e4f..e7aa9d1 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp | |||
@@ -52,87 +52,90 @@ KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const ch | |||
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 = mMainWidget->activePageIndex(); | 70 | int curPageIndex = mMainWidget->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 | 84 | void KCMultiDialog::accept() | |
85 | { | ||
86 | slotOk(); | ||
87 | } | ||
85 | void KCMultiDialog::slotApply() | 88 | void KCMultiDialog::slotApply() |
86 | { | 89 | { |
87 | qDebug("KCMultiDialog::slotApply clicked"); | 90 | qDebug("KCMultiDialog::slotApply clicked"); |
88 | 91 | ||
89 | QPtrListIterator<KCModule> it(modules); | 92 | QPtrListIterator<KCModule> it(modules); |
90 | for (; it.current(); ++it) | 93 | for (; it.current(); ++it) |
91 | (*it)->save(); | 94 | (*it)->save(); |
92 | clientChanged(false); | 95 | clientChanged(false); |
93 | 96 | ||
94 | emit applyClicked(); | 97 | emit applyClicked(); |
95 | 98 | ||
96 | } | 99 | } |
97 | 100 | ||
98 | 101 | ||
99 | void KCMultiDialog::slotOk() | 102 | void KCMultiDialog::slotOk() |
100 | { | 103 | { |
101 | qDebug("KCMultiDialog::slotOk clicked"); | 104 | qDebug("KCMultiDialog::slotOk clicked"); |
102 | 105 | ||
103 | QPtrListIterator<KCModule> it(modules); | 106 | QPtrListIterator<KCModule> it(modules); |
104 | for (; it.current(); ++it) | 107 | for (; it.current(); ++it) |
105 | (*it)->save(); | 108 | (*it)->save(); |
106 | accept(); | 109 | QDialog::accept(); |
107 | 110 | ||
108 | emit okClicked(); | 111 | emit okClicked(); |
109 | } | 112 | } |
110 | 113 | ||
111 | void KCMultiDialog::slotHelp() | 114 | void KCMultiDialog::slotHelp() |
112 | { | 115 | { |
113 | /*US | 116 | /*US |
114 | KURL url( KURL("help:/"), _docPath ); | 117 | KURL url( KURL("help:/"), _docPath ); |
115 | 118 | ||
116 | if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { | 119 | if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { |
117 | KProcess process; | 120 | KProcess process; |
118 | process << "khelpcenter" | 121 | process << "khelpcenter" |
119 | << url.url(); | 122 | << url.url(); |
120 | process.start(KProcess::DontCare); | 123 | process.start(KProcess::DontCare); |
121 | process.detach(); | 124 | process.detach(); |
122 | } else { | 125 | } else { |
123 | new KRun(url); | 126 | new KRun(url); |
124 | } | 127 | } |
125 | */ | 128 | */ |
126 | } | 129 | } |
127 | 130 | ||
128 | void KCMultiDialog::clientChanged(bool state) | 131 | void KCMultiDialog::clientChanged(bool state) |
129 | { | 132 | { |
130 | enableButton(Apply, state); | 133 | enableButton(Apply, state); |
131 | } | 134 | } |
132 | 135 | ||
133 | /*US | 136 | /*US |
134 | void KCMultiDialog::addModule(const QString& path, bool withfallback) | 137 | void KCMultiDialog::addModule(const QString& path, bool withfallback) |
135 | { | 138 | { |
136 | kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; | 139 | kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; |
137 | 140 | ||
138 | KCModuleInfo info(path, _baseGroup); | 141 | KCModuleInfo info(path, _baseGroup); |
diff --git a/microkde/kutils/kcmultidialog.h b/microkde/kutils/kcmultidialog.h index 1aa66b2..768faea 100644 --- a/microkde/kutils/kcmultidialog.h +++ b/microkde/kutils/kcmultidialog.h | |||
@@ -83,64 +83,66 @@ protected slots: | |||
83 | /** | 83 | /** |
84 | * This slot is called when the user presses the "Default" Button | 84 | * This slot is called when the user presses the "Default" Button |
85 | * You can reimplement it if needed. | 85 | * You can reimplement it if needed. |
86 | * | 86 | * |
87 | * @note Make sure you call the original implementation! | 87 | * @note Make sure you call the original implementation! |
88 | **/ | 88 | **/ |
89 | virtual void slotDefault(); | 89 | virtual void slotDefault(); |
90 | 90 | ||
91 | /** | 91 | /** |
92 | * This slot is called when the user presses the "Apply" Button | 92 | * This slot is called when the user presses the "Apply" Button |
93 | * You can reimplement it if needed | 93 | * You can reimplement it if needed |
94 | * | 94 | * |
95 | * @note Make sure you call the original implementation! | 95 | * @note Make sure you call the original implementation! |
96 | **/ | 96 | **/ |
97 | virtual void slotApply(); | 97 | virtual void slotApply(); |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * This slot is called when the user presses the "OK" Button | 100 | * This slot is called when the user presses the "OK" Button |
101 | * You can reimplement it if needed | 101 | * You can reimplement it if needed |
102 | * | 102 | * |
103 | * @note Make sure you call the original implementation! | 103 | * @note Make sure you call the original implementation! |
104 | **/ | 104 | **/ |
105 | virtual void slotOk(); | 105 | virtual void slotOk(); |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * This slot is called when the user presses the "Help" Button | 108 | * This slot is called when the user presses the "Help" Button |
109 | * You can reimplement it if needed | 109 | * You can reimplement it if needed |
110 | * | 110 | * |
111 | * @note Make sure you call the original implementation! | 111 | * @note Make sure you call the original implementation! |
112 | **/ | 112 | **/ |
113 | virtual void slotHelp(); | 113 | virtual void slotHelp(); |
114 | 114 | ||
115 | void accept(); | ||
116 | |||
115 | private slots: | 117 | private slots: |
116 | 118 | ||
117 | void slotAboutToShow(QWidget *); | 119 | void slotAboutToShow(QWidget *); |
118 | 120 | ||
119 | void clientChanged(bool state); | 121 | void clientChanged(bool state); |
120 | 122 | ||
121 | private: | 123 | private: |
122 | /*US | 124 | /*US |
123 | struct LoadInfo { | 125 | struct LoadInfo { |
124 | LoadInfo(const QString &_path, bool _withfallback) | 126 | LoadInfo(const QString &_path, bool _withfallback) |
125 | : path(_path), withfallback(_withfallback) | 127 | : path(_path), withfallback(_withfallback) |
126 | { } | 128 | { } |
127 | QString path; | 129 | QString path; |
128 | bool withfallback; | 130 | bool withfallback; |
129 | }; | 131 | }; |
130 | */ | 132 | */ |
131 | QPtrList<KCModule> modules; | 133 | QPtrList<KCModule> modules; |
132 | /* | 134 | /* |
133 | QPtrDict<LoadInfo> moduleDict; | 135 | QPtrDict<LoadInfo> moduleDict; |
134 | QString _docPath; | 136 | QString _docPath; |
135 | */ | 137 | */ |
136 | QString _baseGroup; | 138 | QString _baseGroup; |
137 | 139 | ||
138 | //US | 140 | //US |
139 | KJanusWidget* mMainWidget; | 141 | KJanusWidget* mMainWidget; |
140 | 142 | ||
141 | // For future use | 143 | // For future use |
142 | class KCMultiDialogPrivate; | 144 | class KCMultiDialogPrivate; |
143 | KCMultiDialogPrivate *d; | 145 | KCMultiDialogPrivate *d; |
144 | }; | 146 | }; |
145 | 147 | ||
146 | #endif //KCMULTIDIALOG_H | 148 | #endif //KCMULTIDIALOG_H |