author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kutils | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 16 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.h | 8 |
2 files changed, 13 insertions, 11 deletions
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp index 9c87682..88f17e5 100644 --- a/microkde/kutils/kcmultidialog.cpp +++ b/microkde/kutils/kcmultidialog.cpp | |||
@@ -14,20 +14,22 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <qhbox.h> | 22 | #include <q3hbox.h> |
23 | #include <qvbox.h> | 23 | #include <q3vbox.h> |
24 | #include <qcursor.h> | 24 | #include <qcursor.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | //Added by qt3to4: | ||
27 | #include <QPixmap> | ||
26 | 28 | ||
27 | #include <klocale.h> | 29 | #include <klocale.h> |
28 | #include <kglobal.h> | 30 | #include <kglobal.h> |
29 | #include <kdebug.h> | 31 | #include <kdebug.h> |
30 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
31 | #include <kmessagebox.h> | 33 | #include <kmessagebox.h> |
32 | //US #include <klibloader.h> | 34 | //US #include <klibloader.h> |
33 | #include <krun.h> | 35 | #include <krun.h> |
@@ -68,17 +70,17 @@ KCMultiDialog::~KCMultiDialog() | |||
68 | //US moduleDict.setAutoDelete(true); | 70 | //US moduleDict.setAutoDelete(true); |
69 | } | 71 | } |
70 | 72 | ||
71 | void KCMultiDialog::slotDefault() | 73 | void KCMultiDialog::slotDefault() |
72 | { | 74 | { |
73 | 75 | ||
74 | int curPageIndex = activePageIndex(); | 76 | int curPageIndex = activePageIndex(); |
75 | 77 | ||
76 | QPtrListIterator<KCModule> it(modules); | 78 | Q3PtrListIterator<KCModule> it(modules); |
77 | for (; it.current(); ++it) | 79 | for (; it.current(); ++it) |
78 | { | 80 | { |
79 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) | 81 | if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) |
80 | { | 82 | { |
81 | (*it)->defaults(); | 83 | (*it)->defaults(); |
82 | clientChanged(true); | 84 | clientChanged(true); |
83 | return; | 85 | return; |
84 | } | 86 | } |
@@ -86,31 +88,31 @@ void KCMultiDialog::slotDefault() | |||
86 | 88 | ||
87 | } | 89 | } |
88 | void KCMultiDialog::accept() | 90 | void KCMultiDialog::accept() |
89 | { | 91 | { |
90 | slotOk(); | 92 | slotOk(); |
91 | } | 93 | } |
92 | void KCMultiDialog::slotApply() | 94 | void KCMultiDialog::slotApply() |
93 | { | 95 | { |
94 | QPtrListIterator<KCModule> it(modules); | 96 | Q3PtrListIterator<KCModule> it(modules); |
95 | for (; it.current(); ++it) | 97 | for (; it.current(); ++it) |
96 | (*it)->save(); | 98 | (*it)->save(); |
97 | clientChanged(false); | 99 | clientChanged(false); |
98 | 100 | ||
99 | emit applyClicked(); | 101 | emit applyClicked(); |
100 | 102 | ||
101 | } | 103 | } |
102 | 104 | ||
103 | 105 | ||
104 | void KCMultiDialog::slotOk() | 106 | void KCMultiDialog::slotOk() |
105 | { | 107 | { |
106 | qDebug("KCMultiDialog::slotOk clicked"); | 108 | qDebug("KCMultiDialog::slotOk clicked"); |
107 | 109 | ||
108 | QPtrListIterator<KCModule> it(modules); | 110 | Q3PtrListIterator<KCModule> it(modules); |
109 | for (; it.current(); ++it) | 111 | for (; it.current(); ++it) |
110 | (*it)->save(); | 112 | (*it)->save(); |
111 | QDialog::accept(); | 113 | QDialog::accept(); |
112 | 114 | ||
113 | emit okClicked(); | 115 | emit okClicked(); |
114 | } | 116 | } |
115 | 117 | ||
116 | void KCMultiDialog::slotHelp() | 118 | void KCMultiDialog::slotHelp() |
@@ -148,19 +150,19 @@ void KCMultiDialog::addModule(const QString& path, bool withfallback) | |||
148 | KCModuleLoader::unloadModule(info); | 150 | KCModuleLoader::unloadModule(info); |
149 | return; | 151 | return; |
150 | } | 152 | } |
151 | moduleDict.insert(page, new LoadInfo(path, withfallback)); | 153 | moduleDict.insert(page, new LoadInfo(path, withfallback)); |
152 | if (modules.isEmpty()) | 154 | if (modules.isEmpty()) |
153 | slotAboutToShow(page); | 155 | slotAboutToShow(page); |
154 | } | 156 | } |
155 | */ | 157 | */ |
156 | QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) | 158 | Q3VBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) |
157 | { | 159 | { |
158 | QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); | 160 | Q3VBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); |
159 | return page; | 161 | return page; |
160 | 162 | ||
161 | } | 163 | } |
162 | //US special method for microkde. We dop noty want to load everything dynamically. | 164 | //US special method for microkde. We dop noty want to load everything dynamically. |
163 | void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) | 165 | void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) |
164 | { | 166 | { |
165 | 167 | ||
166 | modules.append(module); | 168 | modules.append(module); |
diff --git a/microkde/kutils/kcmultidialog.h b/microkde/kutils/kcmultidialog.h index 66412ac..78f8a00 100644 --- a/microkde/kutils/kcmultidialog.h +++ b/microkde/kutils/kcmultidialog.h | |||
@@ -17,18 +17,18 @@ | |||
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifndef KCMULTIDIALOG_H | 22 | #ifndef KCMULTIDIALOG_H |
23 | #define KCMULTIDIALOG_H | 23 | #define KCMULTIDIALOG_H |
24 | 24 | ||
25 | #include <qptrlist.h> | 25 | #include <q3ptrlist.h> |
26 | #include <qptrdict.h> | 26 | #include <q3ptrdict.h> |
27 | 27 | ||
28 | #include <kdialogbase.h> | 28 | #include <kdialogbase.h> |
29 | #include <kjanuswidget.h> | 29 | #include <kjanuswidget.h> |
30 | #include <kcmodule.h> | 30 | #include <kcmodule.h> |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * A class that offers a @ref KDialogBase containing arbitrary KControl Modules | 33 | * A class that offers a @ref KDialogBase containing arbitrary KControl Modules |
34 | * | 34 | * |
@@ -70,17 +70,17 @@ public: | |||
70 | * @param withfallback Try harder to load the module. Might result | 70 | * @param withfallback Try harder to load the module. Might result |
71 | * in the module appearing outside the dialog. | 71 | * in the module appearing outside the dialog. |
72 | **/ | 72 | **/ |
73 | //US void addModule(const QString& module, bool withfallback=true); | 73 | //US void addModule(const QString& module, bool withfallback=true); |
74 | 74 | ||
75 | 75 | ||
76 | //US special method for microkde. We do not want to load everything dynamically. | 76 | //US special method for microkde. We do not want to load everything dynamically. |
77 | void addModule(KCModule* module );//, const QString& modulename, const QString& iconname); | 77 | void addModule(KCModule* module );//, const QString& modulename, const QString& iconname); |
78 | QVBox* getNewVBoxPage(const QString & modulename) ; | 78 | Q3VBox* getNewVBoxPage(const QString & modulename) ; |
79 | 79 | ||
80 | 80 | ||
81 | bool showPage( int index ); | 81 | bool showPage( int index ); |
82 | int activePageIndex() const; | 82 | int activePageIndex() const; |
83 | int pageIndex( QWidget *widget ) const; | 83 | int pageIndex( QWidget *widget ) const; |
84 | 84 | ||
85 | protected slots: | 85 | protected slots: |
86 | /** | 86 | /** |
@@ -128,17 +128,17 @@ private: | |||
128 | struct LoadInfo { | 128 | struct LoadInfo { |
129 | LoadInfo(const QString &_path, bool _withfallback) | 129 | LoadInfo(const QString &_path, bool _withfallback) |
130 | : path(_path), withfallback(_withfallback) | 130 | : path(_path), withfallback(_withfallback) |
131 | { } | 131 | { } |
132 | QString path; | 132 | QString path; |
133 | bool withfallback; | 133 | bool withfallback; |
134 | }; | 134 | }; |
135 | */ | 135 | */ |
136 | QPtrList<KCModule> modules; | 136 | Q3PtrList<KCModule> modules; |
137 | /* | 137 | /* |
138 | QPtrDict<LoadInfo> moduleDict; | 138 | QPtrDict<LoadInfo> moduleDict; |
139 | QString _docPath; | 139 | QString _docPath; |
140 | */ | 140 | */ |
141 | QString _baseGroup; | 141 | QString _baseGroup; |
142 | 142 | ||
143 | //US | 143 | //US |
144 | KJanusWidget* mMainWidget; | 144 | KJanusWidget* mMainWidget; |