-rw-r--r-- | library/Makefile.in | 26 | ||||
-rw-r--r-- | library/global.cpp | 2 | ||||
-rw-r--r-- | library/library.pro | 4 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 4 |
4 files changed, 17 insertions, 19 deletions
diff --git a/library/Makefile.in b/library/Makefile.in index c89390f..b74b818 100644 --- a/library/Makefile.in +++ b/library/Makefile.in | |||
@@ -1,905 +1,903 @@ | |||
1 | ############################################################################# | 1 | ############################################################################# |
2 | 2 | ||
3 | ####### Compiler, tools and options | 3 | ####### Compiler, tools and options |
4 | 4 | ||
5 | CXX =$(SYSCONF_CXX) $(QT_CXX_MT) | 5 | CXX =$(SYSCONF_CXX) $(QT_CXX_MT) |
6 | CXXFLAGS=$(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) $(SYSCONF_CXXFLAGS_LIB) | 6 | CXXFLAGS=$(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) $(SYSCONF_CXXFLAGS_LIB) |
7 | CC =$(SYSCONF_CC) $(QT_C_MT) | 7 | CC =$(SYSCONF_CC) $(QT_C_MT) |
8 | CFLAGS =$(SYSCONF_CFLAGS) $(SYSCONF_CFLAGS_LIB) | 8 | CFLAGS =$(SYSCONF_CFLAGS) $(SYSCONF_CFLAGS_LIB) |
9 | INCPATH =-I$(QPEDIR)/include -Ibackend | 9 | INCPATH =-I$(OPIEDIR)/include -Ibackend |
10 | LFLAGS =$(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) | 10 | LFLAGS =$(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) |
11 | LIBS =$(SUBLIBS) -ldl -lcrypt -lm $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS_QTAPP) | 11 | LIBS =$(SUBLIBS) -ldl -lcrypt -lm $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS_QTAPP) |
12 | MOC =$(SYSCONF_MOC) | 12 | MOC =$(SYSCONF_MOC) |
13 | UIC =$(SYSCONF_UIC) | 13 | UIC =$(SYSCONF_UIC) |
14 | 14 | ||
15 | ####### Target | 15 | ####### Target |
16 | 16 | ||
17 | DESTDIR = $(QTDIR)/lib$(PROJMAK)/ | 17 | DESTDIR = $(QTDIR)/lib$(PROJMAK)/ |
18 | VER_MAJ = 1 | 18 | VER_MAJ = 1 |
19 | VER_MIN = 5 | 19 | VER_MIN = 5 |
20 | VER_PATCH = 0 | 20 | VER_PATCH = 0 |
21 | TARGET= qpe | 21 | TARGET= qpe |
22 | TARGET1 = lib$(TARGET).so.$(VER_MAJ) | 22 | TARGET1 = lib$(TARGET).so.$(VER_MAJ) |
23 | 23 | ||
24 | ####### Files | 24 | ####### Files |
25 | 25 | ||
26 | HEADERS =calendar.h \ | 26 | HEADERS =calendar.h \ |
27 | global.h \ | 27 | global.h \ |
28 | resource.h \ | 28 | resource.h \ |
29 | xmlreader.h \ | 29 | xmlreader.h \ |
30 | mimetype.h \ | 30 | mimetype.h \ |
31 | menubutton.h \ | 31 | menubutton.h \ |
32 | network.h \ | 32 | network.h \ |
33 | networkinterface.h \ | 33 | networkinterface.h \ |
34 | proxies.h \ | 34 | proxies.h \ |
35 | filemanager.h \ | 35 | filemanager.h \ |
36 | fontmanager.h \ | 36 | fontmanager.h \ |
37 | qdawg.h \ | 37 | qdawg.h \ |
38 | datebookmonth.h \ | 38 | datebookmonth.h \ |
39 | fileselector.h \ | 39 | fileselector.h \ |
40 | imageedit.h \ | 40 | imageedit.h \ |
41 | qcopenvelope_qws.h \ | 41 | qcopenvelope_qws.h \ |
42 | qpedecoration_qws.h \ | 42 | qpedecoration_qws.h \ |
43 | qpeapplication.h \ | 43 | qpeapplication.h \ |
44 | qpestyle.h \ | 44 | qpestyle.h \ |
45 | qpedialog.h \ | 45 | qpedialog.h \ |
46 | lightstyle.h \ | 46 | lightstyle.h \ |
47 | config.h \ | 47 | config.h \ |
48 | applnk.h \ | 48 | applnk.h \ |
49 | sound.h \ | 49 | sound.h \ |
50 | tzselect.h \ | 50 | tzselect.h \ |
51 | qmath.h \ | 51 | qmath.h \ |
52 | datebookdb.h \ | 52 | datebookdb.h \ |
53 | alarmserver.h \ | 53 | alarmserver.h \ |
54 | process.h \ | 54 | process.h \ |
55 | password.h \ | 55 | password.h \ |
56 | timestring.h \ | 56 | timestring.h \ |
57 | fontfactoryinterface.h \ | 57 | fontfactoryinterface.h \ |
58 | fontdatabase.h \ | 58 | fontdatabase.h \ |
59 | power.h \ | 59 | power.h \ |
60 | storage.h \ | 60 | storage.h \ |
61 | qpemessagebox.h \ | 61 | qpemessagebox.h \ |
62 | backend/timeconversion.h \ | 62 | backend/timeconversion.h \ |
63 | qpedebug.h \ | 63 | qpedebug.h \ |
64 | qpemenubar.h \ | 64 | qpemenubar.h \ |
65 | qpetoolbar.h \ | 65 | qpetoolbar.h \ |
66 | backend/categories.h \ | 66 | backend/categories.h \ |
67 | backend/stringutil.h \ | 67 | backend/stringutil.h \ |
68 | backend/palmtopuid.h \ | 68 | backend/palmtopuid.h \ |
69 | backend/palmtoprecord.h \ | 69 | backend/palmtoprecord.h \ |
70 | backend/task.h \ | 70 | backend/task.h \ |
71 | backend/event.h \ | 71 | backend/event.h \ |
72 | backend/contact.h \ | 72 | backend/contact.h \ |
73 | categorymenu.h \ | 73 | categorymenu.h \ |
74 | categoryedit_p.h \ | 74 | categoryedit_p.h \ |
75 | categoryselect.h \ | 75 | categoryselect.h \ |
76 | categorywidget.h \ | 76 | categorywidget.h \ |
77 | ir.h \ | 77 | ir.h \ |
78 | backend/vobject_p.h \ | 78 | backend/vobject_p.h \ |
79 | findwidget_p.h \ | 79 | findwidget_p.h \ |
80 | finddialog.h \ | 80 | finddialog.h \ |
81 | lnkproperties.h \ | 81 | lnkproperties.h \ |
82 | quuid.h \ | 82 | quuid.h \ |
83 | qcom.h \ | 83 | qcom.h \ |
84 | qlibrary.h \ | 84 | qlibrary.h \ |
85 | qlibrary_p.h \ | 85 | qlibrary_p.h \ |
86 | qprocess.h | 86 | qprocess.h |
87 | SOURCES =calendar.cpp \ | 87 | SOURCES =calendar.cpp \ |
88 | global.cpp \ | 88 | global.cpp \ |
89 | xmlreader.cpp \ | 89 | xmlreader.cpp \ |
90 | mimetype.cpp \ | 90 | mimetype.cpp \ |
91 | menubutton.cpp \ | 91 | menubutton.cpp \ |
92 | network.cpp \ | 92 | network.cpp \ |
93 | networkinterface.cpp \ | 93 | networkinterface.cpp \ |
94 | proxies.cpp \ | 94 | proxies.cpp \ |
95 | filemanager.cpp \ | 95 | filemanager.cpp \ |
96 | fontmanager.cpp \ | 96 | fontmanager.cpp \ |
97 | qdawg.cpp \ | 97 | qdawg.cpp \ |
98 | datebookmonth.cpp \ | 98 | datebookmonth.cpp \ |
99 | fileselector.cpp \ | 99 | fileselector.cpp \ |
100 | imageedit.cpp \ | 100 | imageedit.cpp \ |
101 | resource.cpp \ | 101 | resource.cpp \ |
102 | qpedecoration_qws.cpp \ | 102 | qpedecoration_qws.cpp \ |
103 | qcopenvelope_qws.cpp \ | 103 | qcopenvelope_qws.cpp \ |
104 | qpeapplication.cpp \ | 104 | qpeapplication.cpp \ |
105 | qpestyle.cpp \ | 105 | qpestyle.cpp \ |
106 | qpedialog.cpp \ | 106 | qpedialog.cpp \ |
107 | lightstyle.cpp \ | 107 | lightstyle.cpp \ |
108 | config.cpp \ | 108 | config.cpp \ |
109 | applnk.cpp \ | 109 | applnk.cpp \ |
110 | sound.cpp \ | 110 | sound.cpp \ |
111 | tzselect.cpp \ | 111 | tzselect.cpp \ |
112 | qmath.c \ | 112 | qmath.c \ |
113 | datebookdb.cpp \ | 113 | datebookdb.cpp \ |
114 | alarmserver.cpp \ | 114 | alarmserver.cpp \ |
115 | password.cpp \ | 115 | password.cpp \ |
116 | process.cpp \ | 116 | process.cpp \ |
117 | process_unix.cpp \ | 117 | process_unix.cpp \ |
118 | timestring.cpp \ | 118 | timestring.cpp \ |
119 | fontdatabase.cpp \ | 119 | fontdatabase.cpp \ |
120 | power.cpp \ | 120 | power.cpp \ |
121 | storage.cpp \ | 121 | storage.cpp \ |
122 | qpemessagebox.cpp \ | 122 | qpemessagebox.cpp \ |
123 | backend/timeconversion.cpp \ | 123 | backend/timeconversion.cpp \ |
124 | qpedebug.cpp \ | 124 | qpedebug.cpp \ |
125 | qpemenubar.cpp \ | 125 | qpemenubar.cpp \ |
126 | qpetoolbar.cpp \ | 126 | qpetoolbar.cpp \ |
127 | backend/categories.cpp \ | 127 | backend/categories.cpp \ |
128 | backend/stringutil.cpp \ | 128 | backend/stringutil.cpp \ |
129 | backend/palmtoprecord.cpp \ | 129 | backend/palmtoprecord.cpp \ |
130 | backend/task.cpp \ | 130 | backend/task.cpp \ |
131 | backend/event.cpp \ | 131 | backend/event.cpp \ |
132 | backend/contact.cpp \ | 132 | backend/contact.cpp \ |
133 | categorymenu.cpp \ | 133 | categorymenu.cpp \ |
134 | categoryedit_p.cpp \ | 134 | categoryedit_p.cpp \ |
135 | categoryselect.cpp \ | 135 | categoryselect.cpp \ |
136 | categorywidget.cpp \ | 136 | categorywidget.cpp \ |
137 | ir.cpp \ | 137 | ir.cpp \ |
138 | backend/vcc_yacc.cpp \ | 138 | backend/vcc_yacc.cpp \ |
139 | backend/vobject.cpp \ | 139 | backend/vobject.cpp \ |
140 | findwidget_p.cpp \ | 140 | findwidget_p.cpp \ |
141 | finddialog.cpp \ | 141 | finddialog.cpp \ |
142 | lnkproperties.cpp \ | 142 | lnkproperties.cpp \ |
143 | quuid.cpp \ | 143 | quuid.cpp \ |
144 | qlibrary.cpp \ | 144 | qlibrary.cpp \ |
145 | qlibrary_unix.cpp \ | 145 | qlibrary_unix.cpp \ |
146 | qprocess.cpp \ | 146 | qprocess.cpp \ |
147 | qprocess_unix.cpp | 147 | qprocess_unix.cpp |
148 | OBJECTS =calendar.o \ | 148 | OBJECTS =calendar.o \ |
149 | global.o \ | 149 | global.o \ |
150 | xmlreader.o \ | 150 | xmlreader.o \ |
151 | mimetype.o \ | 151 | mimetype.o \ |
152 | menubutton.o \ | 152 | menubutton.o \ |
153 | network.o \ | 153 | network.o \ |
154 | networkinterface.o \ | 154 | networkinterface.o \ |
155 | proxies.o \ | 155 | proxies.o \ |
156 | filemanager.o \ | 156 | filemanager.o \ |
157 | fontmanager.o \ | 157 | fontmanager.o \ |
158 | qdawg.o \ | 158 | qdawg.o \ |
159 | datebookmonth.o \ | 159 | datebookmonth.o \ |
160 | fileselector.o \ | 160 | fileselector.o \ |
161 | imageedit.o \ | 161 | imageedit.o \ |
162 | resource.o \ | 162 | resource.o \ |
163 | qpedecoration_qws.o \ | 163 | qpedecoration_qws.o \ |
164 | qcopenvelope_qws.o \ | 164 | qcopenvelope_qws.o \ |
165 | qpeapplication.o \ | 165 | qpeapplication.o \ |
166 | qpestyle.o \ | 166 | qpestyle.o \ |
167 | qpedialog.o \ | 167 | qpedialog.o \ |
168 | lightstyle.o \ | 168 | lightstyle.o \ |
169 | config.o \ | 169 | config.o \ |
170 | applnk.o \ | 170 | applnk.o \ |
171 | sound.o \ | 171 | sound.o \ |
172 | tzselect.o \ | 172 | tzselect.o \ |
173 | qmath.o \ | 173 | qmath.o \ |
174 | datebookdb.o \ | 174 | datebookdb.o \ |
175 | alarmserver.o \ | 175 | alarmserver.o \ |
176 | password.o \ | 176 | password.o \ |
177 | process.o \ | 177 | process.o \ |
178 | process_unix.o \ | 178 | process_unix.o \ |
179 | timestring.o \ | 179 | timestring.o \ |
180 | fontdatabase.o \ | 180 | fontdatabase.o \ |
181 | power.o \ | 181 | power.o \ |
182 | storage.o \ | 182 | storage.o \ |
183 | qpemessagebox.o \ | 183 | qpemessagebox.o \ |
184 | backend/timeconversion.o \ | 184 | backend/timeconversion.o \ |
185 | qpedebug.o \ | 185 | qpedebug.o \ |
186 | qpemenubar.o \ | 186 | qpemenubar.o \ |
187 | qpetoolbar.o \ | 187 | qpetoolbar.o \ |
188 | backend/categories.o \ | 188 | backend/categories.o \ |
189 | backend/stringutil.o \ | 189 | backend/stringutil.o \ |
190 | backend/palmtoprecord.o \ | 190 | backend/palmtoprecord.o \ |
191 | backend/task.o \ | 191 | backend/task.o \ |
192 | backend/event.o \ | 192 | backend/event.o \ |
193 | backend/contact.o \ | 193 | backend/contact.o \ |
194 | categorymenu.o \ | 194 | categorymenu.o \ |
195 | categoryedit_p.o \ | 195 | categoryedit_p.o \ |
196 | categoryselect.o \ | 196 | categoryselect.o \ |
197 | categorywidget.o \ | 197 | categorywidget.o \ |
198 | ir.o \ | 198 | ir.o \ |
199 | backend/vcc_yacc.o \ | 199 | backend/vcc_yacc.o \ |
200 | backend/vobject.o \ | 200 | backend/vobject.o \ |
201 | findwidget_p.o \ | 201 | findwidget_p.o \ |
202 | finddialog.o \ | 202 | finddialog.o \ |
203 | lnkproperties.o \ | 203 | lnkproperties.o \ |
204 | quuid.o \ | 204 | quuid.o \ |
205 | qlibrary.o \ | 205 | qlibrary.o \ |
206 | qlibrary_unix.o \ | 206 | qlibrary_unix.o \ |
207 | qprocess.o \ | 207 | qprocess.o \ |
208 | qprocess_unix.o \ | 208 | qprocess_unix.o \ |
209 | passwordbase_p.o \ | 209 | passwordbase_p.o \ |
210 | proxiesbase_p.o \ | 210 | proxiesbase_p.o \ |
211 | categoryeditbase_p.o \ | 211 | categoryeditbase_p.o \ |
212 | findwidgetbase_p.o \ | 212 | findwidgetbase_p.o \ |
213 | lnkpropertiesbase_p.o | 213 | lnkpropertiesbase_p.o |
214 | INTERFACES = passwordbase_p.ui \ | 214 | INTERFACES = passwordbase_p.ui \ |
215 | proxiesbase_p.ui \ | 215 | proxiesbase_p.ui \ |
216 | categoryeditbase_p.ui \ | 216 | categoryeditbase_p.ui \ |
217 | findwidgetbase_p.ui \ | 217 | findwidgetbase_p.ui \ |
218 | lnkpropertiesbase_p.ui | 218 | lnkpropertiesbase_p.ui |
219 | UICDECLS = passwordbase_p.h \ | 219 | UICDECLS = passwordbase_p.h \ |
220 | proxiesbase_p.h \ | 220 | proxiesbase_p.h \ |
221 | categoryeditbase_p.h \ | 221 | categoryeditbase_p.h \ |
222 | findwidgetbase_p.h \ | 222 | findwidgetbase_p.h \ |
223 | lnkpropertiesbase_p.h | 223 | lnkpropertiesbase_p.h |
224 | UICIMPLS = passwordbase_p.cpp \ | 224 | UICIMPLS = passwordbase_p.cpp \ |
225 | proxiesbase_p.cpp \ | 225 | proxiesbase_p.cpp \ |
226 | categoryeditbase_p.cpp \ | 226 | categoryeditbase_p.cpp \ |
227 | findwidgetbase_p.cpp \ | 227 | findwidgetbase_p.cpp \ |
228 | lnkpropertiesbase_p.cpp | 228 | lnkpropertiesbase_p.cpp |
229 | SRCMOC =moc_menubutton.cpp \ | 229 | SRCMOC =moc_menubutton.cpp \ |
230 | moc_proxies.cpp \ | 230 | moc_proxies.cpp \ |
231 | moc_datebookmonth.cpp \ | 231 | moc_datebookmonth.cpp \ |
232 | moc_fileselector.cpp \ | 232 | moc_fileselector.cpp \ |
233 | moc_imageedit.cpp \ | 233 | moc_imageedit.cpp \ |
234 | moc_qpedecoration_qws.cpp \ | 234 | moc_qpedecoration_qws.cpp \ |
235 | moc_qpeapplication.cpp \ | 235 | moc_qpeapplication.cpp \ |
236 | moc_qpedialog.cpp \ | 236 | moc_qpedialog.cpp \ |
237 | moc_tzselect.cpp \ | 237 | moc_tzselect.cpp \ |
238 | moc_process.cpp \ | 238 | moc_process.cpp \ |
239 | moc_storage.cpp \ | 239 | moc_storage.cpp \ |
240 | moc_qpemenubar.cpp \ | 240 | moc_qpemenubar.cpp \ |
241 | moc_qpetoolbar.cpp \ | 241 | moc_qpetoolbar.cpp \ |
242 | backend/moc_categories.cpp \ | 242 | backend/moc_categories.cpp \ |
243 | moc_categorymenu.cpp \ | 243 | moc_categorymenu.cpp \ |
244 | moc_categoryedit_p.cpp \ | 244 | moc_categoryedit_p.cpp \ |
245 | moc_categoryselect.cpp \ | 245 | moc_categoryselect.cpp \ |
246 | moc_ir.cpp \ | 246 | moc_ir.cpp \ |
247 | moc_findwidget_p.cpp \ | 247 | moc_findwidget_p.cpp \ |
248 | moc_finddialog.cpp \ | 248 | moc_finddialog.cpp \ |
249 | moc_lnkproperties.cpp \ | 249 | moc_lnkproperties.cpp \ |
250 | moc_qlibrary_p.cpp \ | 250 | moc_qlibrary_p.cpp \ |
251 | moc_qprocess.cpp \ | 251 | moc_qprocess.cpp \ |
252 | global.moc \ | 252 | global.moc \ |
253 | network.moc \ | 253 | network.moc \ |
254 | password.moc \ | 254 | password.moc \ |
255 | process_unix.moc \ | 255 | process_unix.moc \ |
256 | timestring.moc \ | 256 | timestring.moc \ |
257 | qprocess_unix.moc \ | 257 | qprocess_unix.moc \ |
258 | moc_passwordbase_p.cpp \ | 258 | moc_passwordbase_p.cpp \ |
259 | moc_proxiesbase_p.cpp \ | 259 | moc_proxiesbase_p.cpp \ |
260 | moc_categoryeditbase_p.cpp \ | 260 | moc_categoryeditbase_p.cpp \ |
261 | moc_findwidgetbase_p.cpp \ | 261 | moc_findwidgetbase_p.cpp \ |
262 | moc_lnkpropertiesbase_p.cpp | 262 | moc_lnkpropertiesbase_p.cpp |
263 | OBJMOC =moc_menubutton.o \ | 263 | OBJMOC =moc_menubutton.o \ |
264 | moc_proxies.o \ | 264 | moc_proxies.o \ |
265 | moc_datebookmonth.o \ | 265 | moc_datebookmonth.o \ |
266 | moc_fileselector.o \ | 266 | moc_fileselector.o \ |
267 | moc_imageedit.o \ | 267 | moc_imageedit.o \ |
268 | moc_qpedecoration_qws.o \ | 268 | moc_qpedecoration_qws.o \ |
269 | moc_qpeapplication.o \ | 269 | moc_qpeapplication.o \ |
270 | moc_qpedialog.o \ | 270 | moc_qpedialog.o \ |
271 | moc_tzselect.o \ | 271 | moc_tzselect.o \ |
272 | moc_process.o \ | 272 | moc_process.o \ |
273 | moc_storage.o \ | 273 | moc_storage.o \ |
274 | moc_qpemenubar.o \ | 274 | moc_qpemenubar.o \ |
275 | moc_qpetoolbar.o \ | 275 | moc_qpetoolbar.o \ |
276 | backend/moc_categories.o \ | 276 | backend/moc_categories.o \ |
277 | moc_categorymenu.o \ | 277 | moc_categorymenu.o \ |
278 | moc_categoryedit_p.o \ | 278 | moc_categoryedit_p.o \ |
279 | moc_categoryselect.o \ | 279 | moc_categoryselect.o \ |
280 | moc_ir.o \ | 280 | moc_ir.o \ |
281 | moc_findwidget_p.o \ | 281 | moc_findwidget_p.o \ |
282 | moc_finddialog.o \ | 282 | moc_finddialog.o \ |
283 | moc_lnkproperties.o \ | 283 | moc_lnkproperties.o \ |
284 | moc_qlibrary_p.o \ | 284 | moc_qlibrary_p.o \ |
285 | moc_qprocess.o \ | 285 | moc_qprocess.o \ |
286 | moc_passwordbase_p.o \ | 286 | moc_passwordbase_p.o \ |
287 | moc_proxiesbase_p.o \ | 287 | moc_proxiesbase_p.o \ |
288 | moc_categoryeditbase_p.o \ | 288 | moc_categoryeditbase_p.o \ |
289 | moc_findwidgetbase_p.o \ | 289 | moc_findwidgetbase_p.o \ |
290 | moc_lnkpropertiesbase_p.o | 290 | moc_lnkpropertiesbase_p.o |
291 | 291 | ||
292 | 292 | ||
293 | ####### Implicit rules | 293 | ####### Implicit rules |
294 | 294 | ||
295 | .SUFFIXES: .cpp .cxx .cc .C .c | 295 | .SUFFIXES: .cpp .cxx .cc .C .c |
296 | 296 | ||
297 | .cpp.o: | 297 | .cpp.o: |
298 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | 298 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< |
299 | 299 | ||
300 | .cxx.o: | 300 | .cxx.o: |
301 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | 301 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< |
302 | 302 | ||
303 | .cc.o: | 303 | .cc.o: |
304 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | 304 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< |
305 | 305 | ||
306 | .C.o: | 306 | .C.o: |
307 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | 307 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< |
308 | 308 | ||
309 | .c.o: | 309 | .c.o: |
310 | $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | 310 | $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< |
311 | 311 | ||
312 | ####### Build rules | 312 | ####### Build rules |
313 | 313 | ||
314 | 314 | ||
315 | all: $(DESTDIR)$(SYSCONF_LINK_TARGET) | 315 | all: $(DESTDIR)$(SYSCONF_LINK_TARGET) |
316 | 316 | ||
317 | $(DESTDIR)$(SYSCONF_LINK_TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) | 317 | $(DESTDIR)$(SYSCONF_LINK_TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) |
318 | $(SYSCONF_LINK_LIB) | 318 | $(SYSCONF_LINK_LIB) |
319 | 319 | ||
320 | moc: $(SRCMOC) | 320 | moc: $(SRCMOC) |
321 | 321 | ||
322 | tmake: | 322 | tmake: |
323 | tmake library.pro | 323 | tmake library.pro |
324 | 324 | ||
325 | clean: | 325 | clean: |
326 | -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) | 326 | -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) |
327 | -rm -f *~ core | 327 | -rm -f *~ core |
328 | -rm -f allmoc.cpp | 328 | -rm -f allmoc.cpp |
329 | 329 | ||
330 | ####### Extension Modules | 330 | ####### Extension Modules |
331 | 331 | ||
332 | listpromodules: | 332 | listpromodules: |
333 | @echo | 333 | @echo |
334 | 334 | ||
335 | listallmodules: | 335 | listallmodules: |
336 | @echo | 336 | @echo |
337 | 337 | ||
338 | listaddonpromodules: | 338 | listaddonpromodules: |
339 | @echo | 339 | @echo |
340 | 340 | ||
341 | listaddonentmodules: | 341 | listaddonentmodules: |
342 | @echo | 342 | @echo |
343 | 343 | ||
344 | 344 | ||
345 | REQUIRES= | 345 | REQUIRES= |
346 | 346 | ||
347 | ####### Sub-libraries | 347 | ####### Sub-libraries |
348 | 348 | ||
349 | 349 | ||
350 | ###### Combined headers | 350 | ###### Combined headers |
351 | 351 | ||
352 | 352 | ||
353 | 353 | ||
354 | ####### Compile | 354 | ####### Compile |
355 | 355 | ||
356 | calendar.o: calendar.cpp \ | 356 | calendar.o: calendar.cpp \ |
357 | calendar.h | 357 | calendar.h |
358 | 358 | ||
359 | global.o: global.cpp \ | 359 | global.o: global.cpp \ |
360 | global.moc | 360 | global.moc |
361 | 361 | ||
362 | xmlreader.o: xmlreader.cpp \ | 362 | xmlreader.o: xmlreader.cpp \ |
363 | xmlreader.h | 363 | xmlreader.h |
364 | 364 | ||
365 | mimetype.o: mimetype.cpp \ | 365 | mimetype.o: mimetype.cpp \ |
366 | mimetype.h \ | 366 | mimetype.h \ |
367 | applnk.h \ | 367 | applnk.h \ |
368 | resource.h \ | 368 | resource.h \ |
369 | qpeapplication.h \ | 369 | qpeapplication.h \ |
370 | qpedecoration_qws.h \ | 370 | qpedecoration_qws.h \ |
371 | timestring.h | 371 | timestring.h |
372 | 372 | ||
373 | menubutton.o: menubutton.cpp \ | 373 | menubutton.o: menubutton.cpp \ |
374 | menubutton.h | 374 | menubutton.h |
375 | 375 | ||
376 | network.o: network.cpp \ | 376 | network.o: network.cpp \ |
377 | network.moc | 377 | network.moc |
378 | 378 | ||
379 | networkinterface.o: networkinterface.cpp \ | 379 | networkinterface.o: networkinterface.cpp \ |
380 | networkinterface.h \ | 380 | networkinterface.h \ |
381 | network.h \ | 381 | network.h \ |
382 | config.h | 382 | config.h |
383 | 383 | ||
384 | proxies.o: proxies.cpp \ | 384 | proxies.o: proxies.cpp \ |
385 | proxies.h \ | 385 | proxies.h \ |
386 | config.h \ | 386 | config.h \ |
387 | proxiesbase_p.h | 387 | proxiesbase_p.h |
388 | 388 | ||
389 | filemanager.o: filemanager.cpp \ | 389 | filemanager.o: filemanager.cpp \ |
390 | filemanager.h \ | 390 | filemanager.h \ |
391 | applnk.h | 391 | applnk.h |
392 | 392 | ||
393 | fontmanager.o: fontmanager.cpp \ | 393 | fontmanager.o: fontmanager.cpp \ |
394 | fontmanager.h | 394 | fontmanager.h |
395 | 395 | ||
396 | qdawg.o: qdawg.cpp \ | 396 | qdawg.o: qdawg.cpp \ |
397 | qdawg.h | 397 | qdawg.h |
398 | 398 | ||
399 | datebookmonth.o: datebookmonth.cpp \ | 399 | datebookmonth.o: datebookmonth.cpp \ |
400 | config.h \ | 400 | config.h \ |
401 | datebookmonth.h \ | 401 | datebookmonth.h \ |
402 | calendar.h \ | 402 | calendar.h \ |
403 | timestring.h \ | 403 | timestring.h \ |
404 | datebookdb.h \ | 404 | datebookdb.h \ |
405 | resource.h \ | 405 | resource.h \ |
406 | qpeapplication.h \ | 406 | qpeapplication.h \ |
407 | qpedecoration_qws.h | 407 | qpedecoration_qws.h |
408 | 408 | ||
409 | fileselector.o: fileselector.cpp \ | 409 | fileselector.o: fileselector.cpp \ |
410 | fileselector.h \ | 410 | fileselector.h \ |
411 | filemanager.h \ | 411 | filemanager.h \ |
412 | applnk.h \ | 412 | applnk.h \ |
413 | global.h \ | 413 | global.h \ |
414 | resource.h \ | 414 | resource.h \ |
415 | config.h \ | 415 | config.h \ |
416 | storage.h \ | 416 | storage.h \ |
417 | qpemenubar.h \ | 417 | qpemenubar.h \ |
418 | lnkproperties.h \ | 418 | lnkproperties.h \ |
419 | qpeapplication.h \ | 419 | qpeapplication.h \ |
420 | qpedecoration_qws.h \ | 420 | qpedecoration_qws.h \ |
421 | timestring.h \ | 421 | timestring.h \ |
422 | categorymenu.h | 422 | categorymenu.h |
423 | 423 | ||
424 | imageedit.o: imageedit.cpp \ | 424 | imageedit.o: imageedit.cpp \ |
425 | imageedit.h | 425 | imageedit.h |
426 | 426 | ||
427 | resource.o: resource.cpp \ | 427 | resource.o: resource.cpp \ |
428 | qpeapplication.h \ | 428 | qpeapplication.h \ |
429 | qpedecoration_qws.h \ | 429 | qpedecoration_qws.h \ |
430 | timestring.h \ | 430 | timestring.h \ |
431 | resource.h \ | 431 | resource.h \ |
432 | inlinepics_p.h | 432 | inlinepics_p.h |
433 | 433 | ||
434 | qpedecoration_qws.o: qpedecoration_qws.cpp \ | 434 | qpedecoration_qws.o: qpedecoration_qws.cpp \ |
435 | qcopenvelope_qws.h \ | 435 | qcopenvelope_qws.h \ |
436 | qpedecoration_qws.h \ | 436 | qpedecoration_qws.h \ |
437 | qpeapplication.h \ | 437 | qpeapplication.h \ |
438 | timestring.h \ | 438 | timestring.h \ |
439 | resource.h \ | 439 | resource.h \ |
440 | global.h | 440 | global.h |
441 | 441 | ||
442 | qcopenvelope_qws.o: qcopenvelope_qws.cpp \ | 442 | qcopenvelope_qws.o: qcopenvelope_qws.cpp \ |
443 | qcopenvelope_qws.h \ | 443 | qcopenvelope_qws.h \ |
444 | global.h | 444 | global.h |
445 | 445 | ||
446 | qpeapplication.o: qpeapplication.cpp \ | 446 | qpeapplication.o: qpeapplication.cpp \ |
447 | qcopenvelope_qws.h \ | 447 | qcopenvelope_qws.h \ |
448 | qpeapplication.h \ | 448 | qpeapplication.h \ |
449 | qpedecoration_qws.h \ | 449 | qpedecoration_qws.h \ |
450 | timestring.h \ | 450 | timestring.h \ |
451 | qpestyle.h \ | 451 | qpestyle.h \ |
452 | lightstyle.h \ | 452 | lightstyle.h \ |
453 | global.h \ | 453 | global.h \ |
454 | resource.h \ | 454 | resource.h \ |
455 | config.h \ | 455 | config.h \ |
456 | network.h \ | 456 | network.h \ |
457 | fontmanager.h \ | 457 | fontmanager.h \ |
458 | power.h \ | 458 | power.h \ |
459 | alarmserver.h \ | 459 | alarmserver.h \ |
460 | applnk.h | 460 | applnk.h \ |
461 | qpemenubar.h | ||
461 | 462 | ||
462 | qpestyle.o: qpestyle.cpp \ | 463 | qpestyle.o: qpestyle.cpp \ |
463 | qpestyle.h \ | 464 | qpestyle.h \ |
464 | qpeapplication.h \ | 465 | qpeapplication.h \ |
465 | qpedecoration_qws.h \ | 466 | qpedecoration_qws.h \ |
466 | timestring.h | 467 | timestring.h |
467 | 468 | ||
468 | qpedialog.o: qpedialog.cpp \ | 469 | qpedialog.o: qpedialog.cpp \ |
469 | qpedialog.h \ | 470 | qpedialog.h \ |
470 | qpeapplication.h \ | 471 | qpeapplication.h \ |
471 | qpedecoration_qws.h \ | 472 | qpedecoration_qws.h \ |
472 | timestring.h | 473 | timestring.h |
473 | 474 | ||
474 | lightstyle.o: lightstyle.cpp \ | 475 | lightstyle.o: lightstyle.cpp \ |
475 | lightstyle.h | 476 | lightstyle.h |
476 | 477 | ||
477 | config.o: config.cpp \ | 478 | config.o: config.cpp \ |
478 | config.h | 479 | config.h |
479 | 480 | ||
480 | applnk.o: applnk.cpp \ | 481 | applnk.o: applnk.cpp \ |
481 | applnk.h | 482 | applnk.h |
482 | 483 | ||
483 | sound.o: sound.cpp | 484 | sound.o: sound.cpp |
484 | 485 | ||
485 | tzselect.o: tzselect.cpp \ | 486 | tzselect.o: tzselect.cpp \ |
486 | tzselect.h \ | 487 | tzselect.h \ |
487 | resource.h \ | 488 | resource.h \ |
488 | global.h \ | 489 | global.h \ |
489 | config.h | 490 | config.h |
490 | 491 | ||
491 | qmath.o: qmath.c \ | 492 | qmath.o: qmath.c \ |
492 | qmath.h | 493 | qmath.h |
493 | 494 | ||
494 | datebookdb.o: datebookdb.cpp \ | 495 | datebookdb.o: datebookdb.cpp \ |
495 | datebookdb.h | 496 | datebookdb.h |
496 | 497 | ||
497 | alarmserver.o: alarmserver.cpp \ | 498 | alarmserver.o: alarmserver.cpp \ |
498 | qpeapplication.h \ | 499 | qpeapplication.h \ |
499 | qpedecoration_qws.h \ | 500 | qpedecoration_qws.h \ |
500 | timestring.h \ | 501 | timestring.h \ |
501 | global.h \ | 502 | global.h \ |
502 | resource.h \ | 503 | resource.h \ |
503 | qcopenvelope_qws.h \ | 504 | qcopenvelope_qws.h \ |
504 | alarmserver.h | 505 | alarmserver.h |
505 | 506 | ||
506 | password.o: password.cpp \ | 507 | password.o: password.cpp \ |
507 | password.moc \ | 508 | password.moc \ |
508 | password.h \ | 509 | password.h \ |
509 | config.h \ | 510 | config.h \ |
510 | global.h \ | 511 | global.h \ |
511 | backend/contact.h \ | 512 | backend/contact.h \ |
512 | passwordbase_p.h | 513 | passwordbase_p.h |
513 | 514 | ||
514 | process.o: process.cpp \ | 515 | process.o: process.cpp \ |
515 | process.h | 516 | process.h |
516 | 517 | ||
517 | process_unix.o: process_unix.cpp \ | 518 | process_unix.o: process_unix.cpp \ |
518 | process_unix.moc \ | 519 | process_unix.moc \ |
519 | process.h | 520 | process.h |
520 | 521 | ||
521 | timestring.o: timestring.cpp \ | 522 | timestring.o: timestring.cpp \ |
522 | timestring.moc \ | 523 | timestring.moc \ |
523 | timestring.h \ | 524 | timestring.h \ |
524 | qpeapplication.h \ | 525 | qpeapplication.h \ |
525 | qpedecoration_qws.h \ | 526 | qpedecoration_qws.h \ |
526 | config.h | 527 | config.h |
527 | 528 | ||
528 | fontdatabase.o: fontdatabase.cpp \ | 529 | fontdatabase.o: fontdatabase.cpp \ |
529 | qpeapplication.h \ | 530 | qpeapplication.h \ |
530 | qpedecoration_qws.h \ | 531 | qpedecoration_qws.h \ |
531 | timestring.h \ | 532 | timestring.h \ |
532 | fontfactoryinterface.h \ | 533 | fontfactoryinterface.h \ |
533 | fontdatabase.h | 534 | fontdatabase.h |
534 | 535 | ||
535 | power.o: power.cpp \ | 536 | power.o: power.cpp \ |
536 | power.h | 537 | power.h \ |
538 | custom.h | ||
537 | 539 | ||
538 | storage.o: storage.cpp | 540 | storage.o: storage.cpp |
539 | 541 | ||
540 | qpemessagebox.o: qpemessagebox.cpp \ | 542 | qpemessagebox.o: qpemessagebox.cpp \ |
541 | qpemessagebox.h | 543 | qpemessagebox.h |
542 | 544 | ||
543 | backend/timeconversion.o: backend/timeconversion.cpp \ | 545 | backend/timeconversion.o: backend/timeconversion.cpp \ |
544 | backend/timeconversion.h | 546 | backend/timeconversion.h |
545 | 547 | ||
546 | qpedebug.o: qpedebug.cpp \ | 548 | qpedebug.o: qpedebug.cpp \ |
547 | qpedebug.h | 549 | qpedebug.h |
548 | 550 | ||
549 | qpemenubar.o: qpemenubar.cpp \ | 551 | qpemenubar.o: qpemenubar.cpp \ |
550 | qpemenubar.h | 552 | qpemenubar.h |
551 | 553 | ||
552 | qpetoolbar.o: qpetoolbar.cpp \ | 554 | qpetoolbar.o: qpetoolbar.cpp \ |
553 | qpetoolbar.h \ | 555 | qpetoolbar.h \ |
554 | qpemenubar.h | 556 | qpemenubar.h |
555 | 557 | ||
556 | backend/categories.o: backend/categories.cpp \ | 558 | backend/categories.o: backend/categories.cpp \ |
557 | backend/categories.h \ | 559 | backend/categories.h \ |
558 | backend/qpcglobal.h \ | 560 | backend/qpcglobal.h \ |
559 | backend/palmtopuidgen.h \ | 561 | backend/palmtopuidgen.h \ |
560 | backend/stringutil.h | 562 | backend/stringutil.h |
561 | 563 | ||
562 | backend/stringutil.o: backend/stringutil.cpp \ | 564 | backend/stringutil.o: backend/stringutil.cpp \ |
563 | backend/stringutil.h \ | 565 | backend/stringutil.h \ |
564 | backend/qpcglobal.h | 566 | backend/qpcglobal.h |
565 | 567 | ||
566 | backend/palmtoprecord.o: backend/palmtoprecord.cpp \ | 568 | backend/palmtoprecord.o: backend/palmtoprecord.cpp \ |
567 | backend/palmtoprecord.h \ | 569 | backend/palmtoprecord.h \ |
568 | backend/qpcglobal.h \ | 570 | backend/qpcglobal.h \ |
569 | backend/palmtopuidgen.h \ | 571 | backend/palmtopuidgen.h \ |
570 | backend/stringutil.h | 572 | backend/stringutil.h |
571 | 573 | ||
572 | backend/task.o: backend/task.cpp \ | 574 | backend/task.o: backend/task.cpp \ |
573 | backend/vobject_p.h \ | 575 | backend/vobject_p.h \ |
574 | backend/timeconversion.h \ | 576 | backend/timeconversion.h \ |
575 | backend/qfiledirect_p.h | 577 | backend/qfiledirect_p.h |
576 | 578 | ||
577 | backend/event.o: backend/event.cpp \ | 579 | backend/event.o: backend/event.cpp \ |
578 | backend/event.h \ | 580 | backend/event.h \ |
579 | backend/qfiledirect_p.h \ | 581 | backend/qfiledirect_p.h \ |
580 | backend/vobject_p.h | 582 | backend/vobject_p.h |
581 | 583 | ||
582 | backend/contact.o: backend/contact.cpp \ | 584 | backend/contact.o: backend/contact.cpp \ |
583 | backend/contact.h \ | 585 | backend/contact.h \ |
584 | backend/vobject_p.h \ | 586 | backend/vobject_p.h \ |
585 | backend/qfiledirect_p.h | 587 | backend/qfiledirect_p.h |
586 | 588 | ||
587 | categorymenu.o: categorymenu.cpp \ | 589 | categorymenu.o: categorymenu.cpp \ |
588 | categorymenu.h \ | 590 | categorymenu.h \ |
589 | backend/categories.h \ | 591 | backend/categories.h \ |
590 | backend/qpcglobal.h \ | 592 | backend/qpcglobal.h \ |
591 | backend/palmtopuidgen.h \ | 593 | backend/palmtopuidgen.h \ |
592 | categoryselect.h | 594 | categoryselect.h |
593 | 595 | ||
594 | categoryedit_p.o: categoryedit_p.cpp \ | 596 | categoryedit_p.o: categoryedit_p.cpp \ |
595 | categoryedit_p.h \ | 597 | categoryedit_p.h \ |
596 | categoryeditbase_p.h | 598 | categoryeditbase_p.h |
597 | 599 | ||
598 | categoryselect.o: categoryselect.cpp \ | 600 | categoryselect.o: categoryselect.cpp \ |
599 | categorywidget.h \ | 601 | categorywidget.h \ |
600 | categoryselect.h | 602 | categoryselect.h |
601 | 603 | ||
602 | categorywidget.o: categorywidget.cpp \ | 604 | categorywidget.o: categorywidget.cpp \ |
603 | categoryedit_p.h \ | 605 | categoryedit_p.h \ |
604 | categoryeditbase_p.h \ | 606 | categoryeditbase_p.h \ |
605 | categorywidget.h | 607 | categorywidget.h |
606 | 608 | ||
607 | ir.o: ir.cpp \ | 609 | ir.o: ir.cpp \ |
608 | ir.h \ | 610 | ir.h \ |
609 | qcopenvelope_qws.h \ | 611 | qcopenvelope_qws.h \ |
610 | applnk.h | 612 | applnk.h |
611 | 613 | ||
612 | backend/vcc_yacc.o: backend/vcc_yacc.cpp \ | 614 | backend/vcc_yacc.o: backend/vcc_yacc.cpp \ |
613 | backend/vobject_p.h | 615 | backend/vobject_p.h \ |
616 | backend/qfiledirect_p.h | ||
614 | 617 | ||
615 | backend/vobject.o: backend/vobject.cpp \ | 618 | backend/vobject.o: backend/vobject.cpp \ |
616 | backend/vobject_p.h \ | 619 | backend/vobject_p.h \ |
617 | backend/qfiledirect_p.h | 620 | backend/qfiledirect_p.h |
618 | 621 | ||
619 | findwidget_p.o: findwidget_p.cpp \ | 622 | findwidget_p.o: findwidget_p.cpp \ |
620 | findwidget_p.h \ | 623 | findwidget_p.h \ |
621 | findwidgetbase_p.h | 624 | findwidgetbase_p.h |
622 | 625 | ||
623 | finddialog.o: finddialog.cpp \ | 626 | finddialog.o: finddialog.cpp \ |
624 | finddialog.h \ | 627 | finddialog.h \ |
625 | findwidget_p.h \ | 628 | findwidget_p.h \ |
626 | findwidgetbase_p.h | 629 | findwidgetbase_p.h |
627 | 630 | ||
628 | lnkproperties.o: lnkproperties.cpp \ | 631 | lnkproperties.o: lnkproperties.cpp \ |
629 | lnkproperties.h \ | 632 | lnkproperties.h \ |
630 | lnkpropertiesbase_p.h \ | 633 | lnkpropertiesbase_p.h \ |
631 | ir.h | 634 | ir.h |
632 | 635 | ||
633 | quuid.o: quuid.cpp \ | 636 | quuid.o: quuid.cpp \ |
634 | quuid.h | 637 | quuid.h |
635 | 638 | ||
636 | qlibrary.o: qlibrary.cpp \ | 639 | qlibrary.o: qlibrary.cpp \ |
637 | qlibrary_p.h \ | 640 | qlibrary_p.h \ |
638 | qlibrary.h | 641 | qlibrary.h |
639 | 642 | ||
640 | qlibrary_unix.o: qlibrary_unix.cpp \ | 643 | qlibrary_unix.o: qlibrary_unix.cpp \ |
641 | qlibrary_p.h \ | 644 | qlibrary_p.h \ |
642 | qlibrary.h | 645 | qlibrary.h |
643 | 646 | ||
644 | qprocess.o: qprocess.cpp \ | 647 | qprocess.o: qprocess.cpp \ |
645 | qprocess.h | 648 | qprocess.h |
646 | 649 | ||
647 | qprocess_unix.o: qprocess_unix.cpp \ | 650 | qprocess_unix.o: qprocess_unix.cpp \ |
648 | qprocess_unix.moc \ | 651 | qprocess_unix.moc \ |
649 | qprocess.h \ | 652 | qprocess.h \ |
650 | qcleanuphandler_p.h | 653 | qcleanuphandler_p.h |
651 | 654 | ||
652 | passwordbase_p.h: passwordbase_p.ui | 655 | passwordbase_p.h: passwordbase_p.ui |
653 | $(UIC) passwordbase_p.ui -o $(INTERFACE_DECL_PATH)/passwordbase_p.h | 656 | $(UIC) passwordbase_p.ui -o $(INTERFACE_DECL_PATH)/passwordbase_p.h |
654 | 657 | ||
655 | passwordbase_p.cpp: passwordbase_p.ui | 658 | passwordbase_p.cpp: passwordbase_p.ui |
656 | $(UIC) passwordbase_p.ui -i passwordbase_p.h -o passwordbase_p.cpp | 659 | $(UIC) passwordbase_p.ui -i passwordbase_p.h -o passwordbase_p.cpp |
657 | 660 | ||
658 | proxiesbase_p.h: proxiesbase_p.ui | 661 | proxiesbase_p.h: proxiesbase_p.ui |
659 | $(UIC) proxiesbase_p.ui -o $(INTERFACE_DECL_PATH)/proxiesbase_p.h | 662 | $(UIC) proxiesbase_p.ui -o $(INTERFACE_DECL_PATH)/proxiesbase_p.h |
660 | 663 | ||
661 | proxiesbase_p.cpp: proxiesbase_p.ui | 664 | proxiesbase_p.cpp: proxiesbase_p.ui |
662 | $(UIC) proxiesbase_p.ui -i proxiesbase_p.h -o proxiesbase_p.cpp | 665 | $(UIC) proxiesbase_p.ui -i proxiesbase_p.h -o proxiesbase_p.cpp |
663 | 666 | ||
664 | categoryeditbase_p.h: categoryeditbase_p.ui | 667 | categoryeditbase_p.h: categoryeditbase_p.ui |
665 | $(UIC) categoryeditbase_p.ui -o $(INTERFACE_DECL_PATH)/categoryeditbase_p.h | 668 | $(UIC) categoryeditbase_p.ui -o $(INTERFACE_DECL_PATH)/categoryeditbase_p.h |
666 | 669 | ||
667 | categoryeditbase_p.cpp: categoryeditbase_p.ui | 670 | categoryeditbase_p.cpp: categoryeditbase_p.ui |
668 | $(UIC) categoryeditbase_p.ui -i categoryeditbase_p.h -o categoryeditbase_p.cpp | 671 | $(UIC) categoryeditbase_p.ui -i categoryeditbase_p.h -o categoryeditbase_p.cpp |
669 | 672 | ||
670 | findwidgetbase_p.h: findwidgetbase_p.ui | 673 | findwidgetbase_p.h: findwidgetbase_p.ui |
671 | $(UIC) findwidgetbase_p.ui -o $(INTERFACE_DECL_PATH)/findwidgetbase_p.h | 674 | $(UIC) findwidgetbase_p.ui -o $(INTERFACE_DECL_PATH)/findwidgetbase_p.h |
672 | 675 | ||
673 | findwidgetbase_p.cpp: findwidgetbase_p.ui | 676 | findwidgetbase_p.cpp: findwidgetbase_p.ui |
674 | $(UIC) findwidgetbase_p.ui -i findwidgetbase_p.h -o findwidgetbase_p.cpp | 677 | $(UIC) findwidgetbase_p.ui -i findwidgetbase_p.h -o findwidgetbase_p.cpp |
675 | 678 | ||
676 | lnkpropertiesbase_p.h: lnkpropertiesbase_p.ui | 679 | lnkpropertiesbase_p.h: lnkpropertiesbase_p.ui |
677 | $(UIC) lnkpropertiesbase_p.ui -o $(INTERFACE_DECL_PATH)/lnkpropertiesbase_p.h | 680 | $(UIC) lnkpropertiesbase_p.ui -o $(INTERFACE_DECL_PATH)/lnkpropertiesbase_p.h |
678 | 681 | ||
679 | lnkpropertiesbase_p.cpp: lnkpropertiesbase_p.ui | 682 | lnkpropertiesbase_p.cpp: lnkpropertiesbase_p.ui |
680 | $(UIC) lnkpropertiesbase_p.ui -i lnkpropertiesbase_p.h -o lnkpropertiesbase_p.cpp | 683 | $(UIC) lnkpropertiesbase_p.ui -i lnkpropertiesbase_p.h -o lnkpropertiesbase_p.cpp |
681 | 684 | ||
682 | passwordbase_p.o: passwordbase_p.cpp \ | 685 | passwordbase_p.o: passwordbase_p.cpp |
683 | passwordbase_p.h | ||
684 | 686 | ||
685 | proxiesbase_p.o: proxiesbase_p.cpp \ | 687 | proxiesbase_p.o: proxiesbase_p.cpp |
686 | proxiesbase_p.h | ||
687 | 688 | ||
688 | categoryeditbase_p.o: categoryeditbase_p.cpp \ | 689 | categoryeditbase_p.o: categoryeditbase_p.cpp |
689 | categoryeditbase_p.h | ||
690 | 690 | ||
691 | findwidgetbase_p.o: findwidgetbase_p.cpp \ | 691 | findwidgetbase_p.o: findwidgetbase_p.cpp |
692 | findwidgetbase_p.h | ||
693 | 692 | ||
694 | lnkpropertiesbase_p.o: lnkpropertiesbase_p.cpp \ | 693 | lnkpropertiesbase_p.o: lnkpropertiesbase_p.cpp |
695 | lnkpropertiesbase_p.h | ||
696 | 694 | ||
697 | moc_menubutton.o: moc_menubutton.cpp \ | 695 | moc_menubutton.o: moc_menubutton.cpp \ |
698 | menubutton.h | 696 | menubutton.h |
699 | 697 | ||
700 | moc_proxies.o: moc_proxies.cpp \ | 698 | moc_proxies.o: moc_proxies.cpp \ |
701 | proxies.h \ | 699 | proxies.h \ |
702 | config.h | 700 | config.h |
703 | 701 | ||
704 | moc_datebookmonth.o: moc_datebookmonth.cpp \ | 702 | moc_datebookmonth.o: moc_datebookmonth.cpp \ |
705 | datebookmonth.h \ | 703 | datebookmonth.h \ |
706 | calendar.h \ | 704 | calendar.h \ |
707 | timestring.h | 705 | timestring.h |
708 | 706 | ||
709 | moc_fileselector.o: moc_fileselector.cpp \ | 707 | moc_fileselector.o: moc_fileselector.cpp \ |
710 | fileselector.h \ | 708 | fileselector.h \ |
711 | filemanager.h \ | 709 | filemanager.h \ |
712 | applnk.h | 710 | applnk.h |
713 | 711 | ||
714 | moc_imageedit.o: moc_imageedit.cpp \ | 712 | moc_imageedit.o: moc_imageedit.cpp \ |
715 | imageedit.h | 713 | imageedit.h |
716 | 714 | ||
717 | moc_qpedecoration_qws.o: moc_qpedecoration_qws.cpp \ | 715 | moc_qpedecoration_qws.o: moc_qpedecoration_qws.cpp \ |
718 | qpedecoration_qws.h | 716 | qpedecoration_qws.h |
719 | 717 | ||
720 | moc_qpeapplication.o: moc_qpeapplication.cpp \ | 718 | moc_qpeapplication.o: moc_qpeapplication.cpp \ |
721 | qpeapplication.h \ | 719 | qpeapplication.h \ |
722 | qpedecoration_qws.h \ | 720 | qpedecoration_qws.h \ |
723 | timestring.h | 721 | timestring.h |
724 | 722 | ||
725 | moc_qpedialog.o: moc_qpedialog.cpp \ | 723 | moc_qpedialog.o: moc_qpedialog.cpp \ |
726 | qpedialog.h | 724 | qpedialog.h |
727 | 725 | ||
728 | moc_tzselect.o: moc_tzselect.cpp \ | 726 | moc_tzselect.o: moc_tzselect.cpp \ |
729 | tzselect.h | 727 | tzselect.h |
730 | 728 | ||
731 | moc_process.o: moc_process.cpp \ | 729 | moc_process.o: moc_process.cpp \ |
732 | process.h | 730 | process.h |
733 | 731 | ||
734 | moc_storage.o: moc_storage.cpp \ | 732 | moc_storage.o: moc_storage.cpp \ |
735 | storage.h | 733 | storage.h |
736 | 734 | ||
737 | moc_qpemenubar.o: moc_qpemenubar.cpp \ | 735 | moc_qpemenubar.o: moc_qpemenubar.cpp \ |
738 | qpemenubar.h | 736 | qpemenubar.h |
739 | 737 | ||
740 | moc_qpetoolbar.o: moc_qpetoolbar.cpp \ | 738 | moc_qpetoolbar.o: moc_qpetoolbar.cpp \ |
741 | qpetoolbar.h | 739 | qpetoolbar.h |
742 | 740 | ||
743 | backend/moc_categories.o: backend/moc_categories.cpp \ | 741 | backend/moc_categories.o: backend/moc_categories.cpp \ |
744 | backend/categories.h \ | 742 | backend/categories.h \ |
745 | backend/qpcglobal.h \ | 743 | backend/qpcglobal.h \ |
746 | backend/palmtopuidgen.h | 744 | backend/palmtopuidgen.h |
747 | 745 | ||
748 | moc_categorymenu.o: moc_categorymenu.cpp \ | 746 | moc_categorymenu.o: moc_categorymenu.cpp \ |
749 | categorymenu.h | 747 | categorymenu.h |
750 | 748 | ||
751 | moc_categoryedit_p.o: moc_categoryedit_p.cpp \ | 749 | moc_categoryedit_p.o: moc_categoryedit_p.cpp \ |
752 | categoryedit_p.h \ | 750 | categoryedit_p.h \ |
753 | categoryeditbase_p.h | 751 | categoryeditbase_p.h |
754 | 752 | ||
755 | moc_categoryselect.o: moc_categoryselect.cpp \ | 753 | moc_categoryselect.o: moc_categoryselect.cpp \ |
756 | categoryselect.h | 754 | categoryselect.h |
757 | 755 | ||
758 | moc_ir.o: moc_ir.cpp \ | 756 | moc_ir.o: moc_ir.cpp \ |
759 | ir.h | 757 | ir.h |
760 | 758 | ||
761 | moc_findwidget_p.o: moc_findwidget_p.cpp \ | 759 | moc_findwidget_p.o: moc_findwidget_p.cpp \ |
762 | findwidget_p.h \ | 760 | findwidget_p.h \ |
763 | findwidgetbase_p.h | 761 | findwidgetbase_p.h |
764 | 762 | ||
765 | moc_finddialog.o: moc_finddialog.cpp \ | 763 | moc_finddialog.o: moc_finddialog.cpp \ |
766 | finddialog.h | 764 | finddialog.h |
767 | 765 | ||
768 | moc_lnkproperties.o: moc_lnkproperties.cpp \ | 766 | moc_lnkproperties.o: moc_lnkproperties.cpp \ |
769 | lnkproperties.h | 767 | lnkproperties.h |
770 | 768 | ||
771 | moc_qlibrary_p.o: moc_qlibrary_p.cpp \ | 769 | moc_qlibrary_p.o: moc_qlibrary_p.cpp \ |
772 | qlibrary_p.h \ | 770 | qlibrary_p.h \ |
773 | qlibrary.h | 771 | qlibrary.h |
774 | 772 | ||
775 | moc_qprocess.o: moc_qprocess.cpp \ | 773 | moc_qprocess.o: moc_qprocess.cpp \ |
776 | qprocess.h | 774 | qprocess.h |
777 | 775 | ||
778 | moc_passwordbase_p.o: global.moc \ | 776 | moc_passwordbase_p.o: global.moc \ |
779 | global.cpp | 777 | global.cpp |
780 | 778 | ||
781 | moc_proxiesbase_p.o: network.moc \ | 779 | moc_proxiesbase_p.o: network.moc \ |
782 | network.cpp | 780 | network.cpp |
783 | 781 | ||
784 | moc_categoryeditbase_p.o: password.moc \ | 782 | moc_categoryeditbase_p.o: password.moc \ |
785 | password.cpp \ | 783 | password.cpp \ |
786 | password.h \ | 784 | password.h \ |
787 | config.h \ | 785 | config.h \ |
788 | global.h \ | 786 | global.h \ |
789 | backend/contact.h \ | 787 | backend/contact.h \ |
790 | passwordbase_p.h | 788 | passwordbase_p.h |
791 | 789 | ||
792 | moc_findwidgetbase_p.o: process_unix.moc \ | 790 | moc_findwidgetbase_p.o: process_unix.moc \ |
793 | process_unix.cpp \ | 791 | process_unix.cpp \ |
794 | process.h | 792 | process.h |
795 | 793 | ||
796 | moc_lnkpropertiesbase_p.o: timestring.moc \ | 794 | moc_lnkpropertiesbase_p.o: timestring.moc \ |
797 | timestring.cpp \ | 795 | timestring.cpp \ |
798 | timestring.h \ | 796 | timestring.h \ |
799 | qpeapplication.h \ | 797 | qpeapplication.h \ |
800 | qpedecoration_qws.h \ | 798 | qpedecoration_qws.h \ |
801 | config.h | 799 | config.h |
802 | 800 | ||
803 | moc_menubutton.cpp: menubutton.h | 801 | moc_menubutton.cpp: menubutton.h |
804 | $(MOC) menubutton.h -o moc_menubutton.cpp | 802 | $(MOC) menubutton.h -o moc_menubutton.cpp |
805 | 803 | ||
806 | moc_proxies.cpp: proxies.h | 804 | moc_proxies.cpp: proxies.h |
807 | $(MOC) proxies.h -o moc_proxies.cpp | 805 | $(MOC) proxies.h -o moc_proxies.cpp |
808 | 806 | ||
809 | moc_datebookmonth.cpp: datebookmonth.h | 807 | moc_datebookmonth.cpp: datebookmonth.h |
810 | $(MOC) datebookmonth.h -o moc_datebookmonth.cpp | 808 | $(MOC) datebookmonth.h -o moc_datebookmonth.cpp |
811 | 809 | ||
812 | moc_fileselector.cpp: fileselector.h | 810 | moc_fileselector.cpp: fileselector.h |
813 | $(MOC) fileselector.h -o moc_fileselector.cpp | 811 | $(MOC) fileselector.h -o moc_fileselector.cpp |
814 | 812 | ||
815 | moc_imageedit.cpp: imageedit.h | 813 | moc_imageedit.cpp: imageedit.h |
816 | $(MOC) imageedit.h -o moc_imageedit.cpp | 814 | $(MOC) imageedit.h -o moc_imageedit.cpp |
817 | 815 | ||
818 | moc_qpedecoration_qws.cpp: qpedecoration_qws.h | 816 | moc_qpedecoration_qws.cpp: qpedecoration_qws.h |
819 | $(MOC) qpedecoration_qws.h -o moc_qpedecoration_qws.cpp | 817 | $(MOC) qpedecoration_qws.h -o moc_qpedecoration_qws.cpp |
820 | 818 | ||
821 | moc_qpeapplication.cpp: qpeapplication.h | 819 | moc_qpeapplication.cpp: qpeapplication.h |
822 | $(MOC) qpeapplication.h -o moc_qpeapplication.cpp | 820 | $(MOC) qpeapplication.h -o moc_qpeapplication.cpp |
823 | 821 | ||
824 | moc_qpedialog.cpp: qpedialog.h | 822 | moc_qpedialog.cpp: qpedialog.h |
825 | $(MOC) qpedialog.h -o moc_qpedialog.cpp | 823 | $(MOC) qpedialog.h -o moc_qpedialog.cpp |
826 | 824 | ||
827 | moc_tzselect.cpp: tzselect.h | 825 | moc_tzselect.cpp: tzselect.h |
828 | $(MOC) tzselect.h -o moc_tzselect.cpp | 826 | $(MOC) tzselect.h -o moc_tzselect.cpp |
829 | 827 | ||
830 | moc_process.cpp: process.h | 828 | moc_process.cpp: process.h |
831 | $(MOC) process.h -o moc_process.cpp | 829 | $(MOC) process.h -o moc_process.cpp |
832 | 830 | ||
833 | moc_storage.cpp: storage.h | 831 | moc_storage.cpp: storage.h |
834 | $(MOC) storage.h -o moc_storage.cpp | 832 | $(MOC) storage.h -o moc_storage.cpp |
835 | 833 | ||
836 | moc_qpemenubar.cpp: qpemenubar.h | 834 | moc_qpemenubar.cpp: qpemenubar.h |
837 | $(MOC) qpemenubar.h -o moc_qpemenubar.cpp | 835 | $(MOC) qpemenubar.h -o moc_qpemenubar.cpp |
838 | 836 | ||
839 | moc_qpetoolbar.cpp: qpetoolbar.h | 837 | moc_qpetoolbar.cpp: qpetoolbar.h |
840 | $(MOC) qpetoolbar.h -o moc_qpetoolbar.cpp | 838 | $(MOC) qpetoolbar.h -o moc_qpetoolbar.cpp |
841 | 839 | ||
842 | backend/moc_categories.cpp: backend/categories.h | 840 | backend/moc_categories.cpp: backend/categories.h |
843 | $(MOC) backend/categories.h -o backend/moc_categories.cpp | 841 | $(MOC) backend/categories.h -o backend/moc_categories.cpp |
844 | 842 | ||
845 | moc_categorymenu.cpp: categorymenu.h | 843 | moc_categorymenu.cpp: categorymenu.h |
846 | $(MOC) categorymenu.h -o moc_categorymenu.cpp | 844 | $(MOC) categorymenu.h -o moc_categorymenu.cpp |
847 | 845 | ||
848 | moc_categoryedit_p.cpp: categoryedit_p.h | 846 | moc_categoryedit_p.cpp: categoryedit_p.h |
849 | $(MOC) categoryedit_p.h -o moc_categoryedit_p.cpp | 847 | $(MOC) categoryedit_p.h -o moc_categoryedit_p.cpp |
850 | 848 | ||
851 | moc_categoryselect.cpp: categoryselect.h | 849 | moc_categoryselect.cpp: categoryselect.h |
852 | $(MOC) categoryselect.h -o moc_categoryselect.cpp | 850 | $(MOC) categoryselect.h -o moc_categoryselect.cpp |
853 | 851 | ||
854 | moc_ir.cpp: ir.h | 852 | moc_ir.cpp: ir.h |
855 | $(MOC) ir.h -o moc_ir.cpp | 853 | $(MOC) ir.h -o moc_ir.cpp |
856 | 854 | ||
857 | moc_findwidget_p.cpp: findwidget_p.h | 855 | moc_findwidget_p.cpp: findwidget_p.h |
858 | $(MOC) findwidget_p.h -o moc_findwidget_p.cpp | 856 | $(MOC) findwidget_p.h -o moc_findwidget_p.cpp |
859 | 857 | ||
860 | moc_finddialog.cpp: finddialog.h | 858 | moc_finddialog.cpp: finddialog.h |
861 | $(MOC) finddialog.h -o moc_finddialog.cpp | 859 | $(MOC) finddialog.h -o moc_finddialog.cpp |
862 | 860 | ||
863 | moc_lnkproperties.cpp: lnkproperties.h | 861 | moc_lnkproperties.cpp: lnkproperties.h |
864 | $(MOC) lnkproperties.h -o moc_lnkproperties.cpp | 862 | $(MOC) lnkproperties.h -o moc_lnkproperties.cpp |
865 | 863 | ||
866 | moc_qlibrary_p.cpp: qlibrary_p.h | 864 | moc_qlibrary_p.cpp: qlibrary_p.h |
867 | $(MOC) qlibrary_p.h -o moc_qlibrary_p.cpp | 865 | $(MOC) qlibrary_p.h -o moc_qlibrary_p.cpp |
868 | 866 | ||
869 | moc_qprocess.cpp: qprocess.h | 867 | moc_qprocess.cpp: qprocess.h |
870 | $(MOC) qprocess.h -o moc_qprocess.cpp | 868 | $(MOC) qprocess.h -o moc_qprocess.cpp |
871 | 869 | ||
872 | global.moc: global.cpp | 870 | global.moc: global.cpp |
873 | $(MOC) global.cpp -o global.moc | 871 | $(MOC) global.cpp -o global.moc |
874 | 872 | ||
875 | network.moc: network.cpp | 873 | network.moc: network.cpp |
876 | $(MOC) network.cpp -o network.moc | 874 | $(MOC) network.cpp -o network.moc |
877 | 875 | ||
878 | password.moc: password.cpp | 876 | password.moc: password.cpp |
879 | $(MOC) password.cpp -o password.moc | 877 | $(MOC) password.cpp -o password.moc |
880 | 878 | ||
881 | process_unix.moc: process_unix.cpp | 879 | process_unix.moc: process_unix.cpp |
882 | $(MOC) process_unix.cpp -o process_unix.moc | 880 | $(MOC) process_unix.cpp -o process_unix.moc |
883 | 881 | ||
884 | timestring.moc: timestring.cpp | 882 | timestring.moc: timestring.cpp |
885 | $(MOC) timestring.cpp -o timestring.moc | 883 | $(MOC) timestring.cpp -o timestring.moc |
886 | 884 | ||
887 | qprocess_unix.moc: qprocess_unix.cpp | 885 | qprocess_unix.moc: qprocess_unix.cpp |
888 | $(MOC) qprocess_unix.cpp -o qprocess_unix.moc | 886 | $(MOC) qprocess_unix.cpp -o qprocess_unix.moc |
889 | 887 | ||
890 | moc_passwordbase_p.cpp: passwordbase_p.h | 888 | moc_passwordbase_p.cpp: passwordbase_p.h |
891 | $(MOC) passwordbase_p.h -o moc_passwordbase_p.cpp | 889 | $(MOC) passwordbase_p.h -o moc_passwordbase_p.cpp |
892 | 890 | ||
893 | moc_proxiesbase_p.cpp: proxiesbase_p.h | 891 | moc_proxiesbase_p.cpp: proxiesbase_p.h |
894 | $(MOC) proxiesbase_p.h -o moc_proxiesbase_p.cpp | 892 | $(MOC) proxiesbase_p.h -o moc_proxiesbase_p.cpp |
895 | 893 | ||
896 | moc_categoryeditbase_p.cpp: categoryeditbase_p.h | 894 | moc_categoryeditbase_p.cpp: categoryeditbase_p.h |
897 | $(MOC) categoryeditbase_p.h -o moc_categoryeditbase_p.cpp | 895 | $(MOC) categoryeditbase_p.h -o moc_categoryeditbase_p.cpp |
898 | 896 | ||
899 | moc_findwidgetbase_p.cpp: findwidgetbase_p.h | 897 | moc_findwidgetbase_p.cpp: findwidgetbase_p.h |
900 | $(MOC) findwidgetbase_p.h -o moc_findwidgetbase_p.cpp | 898 | $(MOC) findwidgetbase_p.h -o moc_findwidgetbase_p.cpp |
901 | 899 | ||
902 | moc_lnkpropertiesbase_p.cpp: lnkpropertiesbase_p.h | 900 | moc_lnkpropertiesbase_p.cpp: lnkpropertiesbase_p.h |
903 | $(MOC) lnkpropertiesbase_p.h -o moc_lnkpropertiesbase_p.cpp | 901 | $(MOC) lnkpropertiesbase_p.h -o moc_lnkpropertiesbase_p.cpp |
904 | 902 | ||
905 | 903 | ||
diff --git a/library/global.cpp b/library/global.cpp index e1bbf3e..e5fc2b3 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -1,644 +1,644 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/qpedebug.h> | 20 | #include <qpe/qpedebug.h> |
21 | #include <qpe/global.h> | 21 | #include <qpe/global.h> |
22 | #include <qpe/qdawg.h> | 22 | #include <qpe/qdawg.h> |
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | #include <qpe/storage.h> | 25 | #include <qpe/storage.h> |
26 | #include <qpe/applnk.h> | 26 | #include <qpe/applnk.h> |
27 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 27 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
28 | #include "qpe/qcopenvelope_qws.h" | 28 | #include "qpe/qcopenvelope_qws.h" |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qlabel.h> | 32 | #include <qlabel.h> |
33 | #include <qtimer.h> | 33 | #include <qtimer.h> |
34 | #include <qmap.h> | 34 | #include <qmap.h> |
35 | #include <qdict.h> | 35 | #include <qdict.h> |
36 | #include <qdir.h> | 36 | #include <qdir.h> |
37 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | 39 | ||
40 | #include <stdlib.h> | 40 | #include <stdlib.h> |
41 | #include <sys/stat.h> | 41 | #include <sys/stat.h> |
42 | #include <sys/wait.h> | 42 | #include <sys/wait.h> |
43 | #include <sys/types.h> | 43 | #include <sys/types.h> |
44 | #include <fcntl.h> | 44 | #include <fcntl.h> |
45 | #include <unistd.h> | 45 | #include <unistd.h> |
46 | 46 | ||
47 | #include <qwindowsystem_qws.h> // for qwsServer | 47 | #include <qwindowsystem_qws.h> // for qwsServer |
48 | #include <qdatetime.h> | 48 | #include <qdatetime.h> |
49 | 49 | ||
50 | //#include "quickexec_p.h" | 50 | //#include "quickexec_p.h" |
51 | 51 | ||
52 | class Emitter : public QObject { | 52 | class Emitter : public QObject { |
53 | Q_OBJECT | 53 | Q_OBJECT |
54 | public: | 54 | public: |
55 | Emitter( QWidget* receiver, const QString& document ) | 55 | Emitter( QWidget* receiver, const QString& document ) |
56 | { | 56 | { |
57 | connect(this, SIGNAL(setDocument(const QString&)), | 57 | connect(this, SIGNAL(setDocument(const QString&)), |
58 | receiver, SLOT(setDocument(const QString&))); | 58 | receiver, SLOT(setDocument(const QString&))); |
59 | emit setDocument(document); | 59 | emit setDocument(document); |
60 | disconnect(this, SIGNAL(setDocument(const QString&)), | 60 | disconnect(this, SIGNAL(setDocument(const QString&)), |
61 | receiver, SLOT(setDocument(const QString&))); | 61 | receiver, SLOT(setDocument(const QString&))); |
62 | } | 62 | } |
63 | 63 | ||
64 | signals: | 64 | signals: |
65 | void setDocument(const QString&); | 65 | void setDocument(const QString&); |
66 | }; | 66 | }; |
67 | 67 | ||
68 | 68 | ||
69 | class StartingAppList : public QObject { | 69 | class StartingAppList : public QObject { |
70 | Q_OBJECT | 70 | Q_OBJECT |
71 | public: | 71 | public: |
72 | static void add( const QString& name ); | 72 | static void add( const QString& name ); |
73 | static bool isStarting( const QString name ); | 73 | static bool isStarting( const QString name ); |
74 | private slots: | 74 | private slots: |
75 | void handleNewChannel( const QString &); | 75 | void handleNewChannel( const QString &); |
76 | private: | 76 | private: |
77 | StartingAppList( QObject *parent=0, const char* name=0 ) ; | 77 | StartingAppList( QObject *parent=0, const char* name=0 ) ; |
78 | 78 | ||
79 | QDict<QTime> dict; | 79 | QDict<QTime> dict; |
80 | static StartingAppList *appl; | 80 | static StartingAppList *appl; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | StartingAppList* StartingAppList::appl = 0; | 83 | StartingAppList* StartingAppList::appl = 0; |
84 | 84 | ||
85 | StartingAppList::StartingAppList( QObject *parent, const char* name ) | 85 | StartingAppList::StartingAppList( QObject *parent, const char* name ) |
86 | :QObject( parent, name ) | 86 | :QObject( parent, name ) |
87 | { | 87 | { |
88 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) | 88 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) |
89 | connect( qwsServer, SIGNAL( newChannel(const QString&)), | 89 | connect( qwsServer, SIGNAL( newChannel(const QString&)), |
90 | this, SLOT( handleNewChannel(const QString&)) ); | 90 | this, SLOT( handleNewChannel(const QString&)) ); |
91 | dict.setAutoDelete( TRUE ); | 91 | dict.setAutoDelete( TRUE ); |
92 | #endif | 92 | #endif |
93 | } | 93 | } |
94 | 94 | ||
95 | void StartingAppList::add( const QString& name ) | 95 | void StartingAppList::add( const QString& name ) |
96 | { | 96 | { |
97 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) | 97 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) |
98 | if ( !appl ) | 98 | if ( !appl ) |
99 | appl = new StartingAppList; | 99 | appl = new StartingAppList; |
100 | QTime *t = new QTime; | 100 | QTime *t = new QTime; |
101 | t->start(); | 101 | t->start(); |
102 | appl->dict.insert( "QPE/Application/" + name, t ); | 102 | appl->dict.insert( "QPE/Application/" + name, t ); |
103 | #endif | 103 | #endif |
104 | } | 104 | } |
105 | 105 | ||
106 | bool StartingAppList::isStarting( const QString name ) | 106 | bool StartingAppList::isStarting( const QString name ) |
107 | { | 107 | { |
108 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) | 108 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) |
109 | if ( appl ) { | 109 | if ( appl ) { |
110 | QTime *t = appl->dict.find( "QPE/Application/" + name ); | 110 | QTime *t = appl->dict.find( "QPE/Application/" + name ); |
111 | if ( !t ) | 111 | if ( !t ) |
112 | return FALSE; | 112 | return FALSE; |
113 | if ( t->elapsed() > 10000 ) { | 113 | if ( t->elapsed() > 10000 ) { |
114 | // timeout in case of crash or something | 114 | // timeout in case of crash or something |
115 | appl->dict.remove( "QPE/Application/" + name ); | 115 | appl->dict.remove( "QPE/Application/" + name ); |
116 | return FALSE; | 116 | return FALSE; |
117 | } | 117 | } |
118 | return TRUE; | 118 | return TRUE; |
119 | } | 119 | } |
120 | #endif | 120 | #endif |
121 | return FALSE; | 121 | return FALSE; |
122 | } | 122 | } |
123 | 123 | ||
124 | void StartingAppList::handleNewChannel( const QString & name ) | 124 | void StartingAppList::handleNewChannel( const QString & name ) |
125 | { | 125 | { |
126 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) | 126 | #if QT_VERSION >= 232 && !defined(QT_NO_COP) |
127 | dict.remove( name ); | 127 | dict.remove( name ); |
128 | #endif | 128 | #endif |
129 | } | 129 | } |
130 | 130 | ||
131 | static bool docDirCreated = FALSE; | 131 | static bool docDirCreated = FALSE; |
132 | static QDawg* fixed_dawg = 0; | 132 | static QDawg* fixed_dawg = 0; |
133 | static QDict<QDawg> *named_dawg = 0; | 133 | static QDict<QDawg> *named_dawg = 0; |
134 | 134 | ||
135 | static QString qpeDir() | 135 | static QString qpeDir() |
136 | { | 136 | { |
137 | QString dir = getenv("QPEDIR"); | 137 | QString dir = getenv("OPIEDIR"); |
138 | if ( dir.isEmpty() ) dir = ".."; | 138 | if ( dir.isEmpty() ) dir = ".."; |
139 | return dir; | 139 | return dir; |
140 | } | 140 | } |
141 | 141 | ||
142 | static QString dictDir() | 142 | static QString dictDir() |
143 | { | 143 | { |
144 | return qpeDir() + "/etc/dict"; | 144 | return qpeDir() + "/etc/dict"; |
145 | } | 145 | } |
146 | 146 | ||
147 | /*! | 147 | /*! |
148 | \class Global global.h | 148 | \class Global global.h |
149 | \brief The Global class collects application-wide global functions. | 149 | \brief The Global class collects application-wide global functions. |
150 | */ | 150 | */ |
151 | 151 | ||
152 | /*! | 152 | /*! |
153 | \internal | 153 | \internal |
154 | */ | 154 | */ |
155 | Global::Global() | 155 | Global::Global() |
156 | { | 156 | { |
157 | } | 157 | } |
158 | 158 | ||
159 | /*! | 159 | /*! |
160 | Returns the unchangeable QDawg that contains general | 160 | Returns the unchangeable QDawg that contains general |
161 | words for the current locale. | 161 | words for the current locale. |
162 | 162 | ||
163 | \sa addedDawg() | 163 | \sa addedDawg() |
164 | */ | 164 | */ |
165 | const QDawg& Global::fixedDawg() | 165 | const QDawg& Global::fixedDawg() |
166 | { | 166 | { |
167 | if ( !fixed_dawg ) { | 167 | if ( !fixed_dawg ) { |
168 | if ( !docDirCreated ) | 168 | if ( !docDirCreated ) |
169 | createDocDir(); | 169 | createDocDir(); |
170 | 170 | ||
171 | fixed_dawg = new QDawg; | 171 | fixed_dawg = new QDawg; |
172 | QString dawgfilename = dictDir() + "/dawg"; | 172 | QString dawgfilename = dictDir() + "/dawg"; |
173 | QString lang = getenv( "LANG" ); | 173 | QString lang = getenv( "LANG" ); |
174 | QString dawgfilename_lang = dawgfilename + "." + lang; | 174 | QString dawgfilename_lang = dawgfilename + "." + lang; |
175 | QString words_lang = dictDir() + "/words." + lang; | 175 | QString words_lang = dictDir() + "/words." + lang; |
176 | if ( QFile::exists(dawgfilename_lang) || | 176 | if ( QFile::exists(dawgfilename_lang) || |
177 | QFile::exists(words_lang) ) | 177 | QFile::exists(words_lang) ) |
178 | dawgfilename = dawgfilename_lang; | 178 | dawgfilename = dawgfilename_lang; |
179 | QFile dawgfile(dawgfilename); | 179 | QFile dawgfile(dawgfilename); |
180 | 180 | ||
181 | if ( !dawgfile.exists() ) { | 181 | if ( !dawgfile.exists() ) { |
182 | QString fn = dictDir() + "/words"; | 182 | QString fn = dictDir() + "/words"; |
183 | if ( QFile::exists(words_lang) ) | 183 | if ( QFile::exists(words_lang) ) |
184 | fn = words_lang; | 184 | fn = words_lang; |
185 | QFile in(fn); | 185 | QFile in(fn); |
186 | if ( in.open(IO_ReadOnly) ) { | 186 | if ( in.open(IO_ReadOnly) ) { |
187 | fixed_dawg->createFromWords(&in); | 187 | fixed_dawg->createFromWords(&in); |
188 | dawgfile.open(IO_WriteOnly); | 188 | dawgfile.open(IO_WriteOnly); |
189 | fixed_dawg->write(&dawgfile); | 189 | fixed_dawg->write(&dawgfile); |
190 | dawgfile.close(); | 190 | dawgfile.close(); |
191 | } | 191 | } |
192 | } else { | 192 | } else { |
193 | fixed_dawg->readFile(dawgfilename); | 193 | fixed_dawg->readFile(dawgfilename); |
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
197 | return *fixed_dawg; | 197 | return *fixed_dawg; |
198 | } | 198 | } |
199 | 199 | ||
200 | /*! | 200 | /*! |
201 | Returns the changeable QDawg that contains general | 201 | Returns the changeable QDawg that contains general |
202 | words for the current locale. | 202 | words for the current locale. |
203 | 203 | ||
204 | \sa fixedDawg() | 204 | \sa fixedDawg() |
205 | */ | 205 | */ |
206 | const QDawg& Global::addedDawg() | 206 | const QDawg& Global::addedDawg() |
207 | { | 207 | { |
208 | return dawg("local"); | 208 | return dawg("local"); |
209 | } | 209 | } |
210 | 210 | ||
211 | /*! | 211 | /*! |
212 | Returns the QDawg with the given \a name. | 212 | Returns the QDawg with the given \a name. |
213 | This is an application-specific word list. | 213 | This is an application-specific word list. |
214 | 214 | ||
215 | \a name should not contain "/". | 215 | \a name should not contain "/". |
216 | */ | 216 | */ |
217 | const QDawg& Global::dawg(const QString& name) | 217 | const QDawg& Global::dawg(const QString& name) |
218 | { | 218 | { |
219 | createDocDir(); | 219 | createDocDir(); |
220 | if ( !named_dawg ) | 220 | if ( !named_dawg ) |
221 | named_dawg = new QDict<QDawg>; | 221 | named_dawg = new QDict<QDawg>; |
222 | QDawg* r = named_dawg->find(name); | 222 | QDawg* r = named_dawg->find(name); |
223 | if ( !r ) { | 223 | if ( !r ) { |
224 | r = new QDawg; | 224 | r = new QDawg; |
225 | named_dawg->insert(name,r); | 225 | named_dawg->insert(name,r); |
226 | QString dawgfilename = dictDir() + "/" + name + ".dawg"; | 226 | QString dawgfilename = dictDir() + "/" + name + ".dawg"; |
227 | QFile dawgfile(dawgfilename); | 227 | QFile dawgfile(dawgfilename); |
228 | if ( dawgfile.open(IO_ReadOnly) ) | 228 | if ( dawgfile.open(IO_ReadOnly) ) |
229 | r->readFile(dawgfilename); | 229 | r->readFile(dawgfilename); |
230 | } | 230 | } |
231 | return *r; | 231 | return *r; |
232 | } | 232 | } |
233 | 233 | ||
234 | /*! | 234 | /*! |
235 | Adds \a wordlist to the addedDawg(). | 235 | Adds \a wordlist to the addedDawg(). |
236 | */ | 236 | */ |
237 | void Global::addWords(const QStringList& wordlist) | 237 | void Global::addWords(const QStringList& wordlist) |
238 | { | 238 | { |
239 | addWords("local",wordlist); | 239 | addWords("local",wordlist); |
240 | } | 240 | } |
241 | 241 | ||
242 | /*! | 242 | /*! |
243 | Adds \a wordlist to the dawg() named \a dictname. | 243 | Adds \a wordlist to the dawg() named \a dictname. |
244 | */ | 244 | */ |
245 | void Global::addWords(const QString& dictname, const QStringList& wordlist) | 245 | void Global::addWords(const QString& dictname, const QStringList& wordlist) |
246 | { | 246 | { |
247 | QDawg& d = (QDawg&)dawg(dictname); | 247 | QDawg& d = (QDawg&)dawg(dictname); |
248 | QStringList all = d.allWords() + wordlist; | 248 | QStringList all = d.allWords() + wordlist; |
249 | d.createFromWords(all); | 249 | d.createFromWords(all); |
250 | 250 | ||
251 | QString dawgfilename = dictDir() + "/" + dictname + ".dawg"; | 251 | QString dawgfilename = dictDir() + "/" + dictname + ".dawg"; |
252 | QFile dawgfile(dawgfilename); | 252 | QFile dawgfile(dawgfilename); |
253 | if ( dawgfile.open(IO_WriteOnly) ) { | 253 | if ( dawgfile.open(IO_WriteOnly) ) { |
254 | d.write(&dawgfile); | 254 | d.write(&dawgfile); |
255 | dawgfile.close(); | 255 | dawgfile.close(); |
256 | } | 256 | } |
257 | 257 | ||
258 | // #### Re-read the dawg here if we use mmap(). | 258 | // #### Re-read the dawg here if we use mmap(). |
259 | 259 | ||
260 | // #### Signal other processes to re-read. | 260 | // #### Signal other processes to re-read. |
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
264 | /*! | 264 | /*! |
265 | Returns a full path for the application named \a appname, with the | 265 | Returns a full path for the application named \a appname, with the |
266 | given \a filename or QString::null if there was a problem creating | 266 | given \a filename or QString::null if there was a problem creating |
267 | the directory tree for \a appname. | 267 | the directory tree for \a appname. |
268 | If \a filename contains "/", it is the caller's responsibility to | 268 | If \a filename contains "/", it is the caller's responsibility to |
269 | ensure those directories exist. | 269 | ensure those directories exist. |
270 | */ | 270 | */ |
271 | QString Global::applicationFileName(const QString& appname, const QString& filename) | 271 | QString Global::applicationFileName(const QString& appname, const QString& filename) |
272 | { | 272 | { |
273 | QDir d; | 273 | QDir d; |
274 | QString r = getenv("HOME"); | 274 | QString r = getenv("HOME"); |
275 | r += "/Applications/"; | 275 | r += "/Applications/"; |
276 | if ( !QFile::exists( r ) ) | 276 | if ( !QFile::exists( r ) ) |
277 | if ( d.mkdir(r) == false ) | 277 | if ( d.mkdir(r) == false ) |
278 | return QString::null; | 278 | return QString::null; |
279 | r += appname; | 279 | r += appname; |
280 | if ( !QFile::exists( r ) ) | 280 | if ( !QFile::exists( r ) ) |
281 | if ( d.mkdir(r) == false ) | 281 | if ( d.mkdir(r) == false ) |
282 | return QString::null; | 282 | return QString::null; |
283 | r += "/"; r += filename; | 283 | r += "/"; r += filename; |
284 | return r; | 284 | return r; |
285 | } | 285 | } |
286 | 286 | ||
287 | /*! | 287 | /*! |
288 | \internal | 288 | \internal |
289 | */ | 289 | */ |
290 | void Global::createDocDir() | 290 | void Global::createDocDir() |
291 | { | 291 | { |
292 | if ( !docDirCreated ) { | 292 | if ( !docDirCreated ) { |
293 | docDirCreated = TRUE; | 293 | docDirCreated = TRUE; |
294 | mkdir( QPEApplication::documentDir().latin1(), 0755 ); | 294 | mkdir( QPEApplication::documentDir().latin1(), 0755 ); |
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
298 | 298 | ||
299 | /*! | 299 | /*! |
300 | Displays a status \a message to the user. This generally appears | 300 | Displays a status \a message to the user. This generally appears |
301 | in the taskbar for some amount of time, then disappears. | 301 | in the taskbar for some amount of time, then disappears. |
302 | */ | 302 | */ |
303 | void Global::statusMessage(const QString& message) | 303 | void Global::statusMessage(const QString& message) |
304 | { | 304 | { |
305 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 305 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
306 | QCopEnvelope e( "QPE/TaskBar", "message(QString)" ); | 306 | QCopEnvelope e( "QPE/TaskBar", "message(QString)" ); |
307 | e << message; | 307 | e << message; |
308 | #endif | 308 | #endif |
309 | } | 309 | } |
310 | 310 | ||
311 | /*! | 311 | /*! |
312 | \internal | 312 | \internal |
313 | */ | 313 | */ |
314 | void Global::applyStyle() | 314 | void Global::applyStyle() |
315 | { | 315 | { |
316 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 316 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
317 | QCopChannel::send( "QPE/System", "applyStyle()" ); | 317 | QCopChannel::send( "QPE/System", "applyStyle()" ); |
318 | #else | 318 | #else |
319 | ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version | 319 | ((QPEApplication *)qApp)->applyStyle(); // apply without needing QCop for floppy version |
320 | #endif | 320 | #endif |
321 | } | 321 | } |
322 | 322 | ||
323 | /*! | 323 | /*! |
324 | \internal | 324 | \internal |
325 | */ | 325 | */ |
326 | QWidget *Global::shutdown( bool ) | 326 | QWidget *Global::shutdown( bool ) |
327 | { | 327 | { |
328 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 328 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
329 | QCopChannel::send( "QPE/System", "shutdown()" ); | 329 | QCopChannel::send( "QPE/System", "shutdown()" ); |
330 | #endif | 330 | #endif |
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | /*! | 334 | /*! |
335 | \internal | 335 | \internal |
336 | */ | 336 | */ |
337 | QWidget *Global::restart( bool ) | 337 | QWidget *Global::restart( bool ) |
338 | { | 338 | { |
339 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 339 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
340 | QCopChannel::send( "QPE/System", "restart()" ); | 340 | QCopChannel::send( "QPE/System", "restart()" ); |
341 | #endif | 341 | #endif |
342 | return 0; | 342 | return 0; |
343 | } | 343 | } |
344 | 344 | ||
345 | /*! | 345 | /*! |
346 | Explicitly show the current input method. | 346 | Explicitly show the current input method. |
347 | */ | 347 | */ |
348 | void Global::showInputMethod() | 348 | void Global::showInputMethod() |
349 | { | 349 | { |
350 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 350 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
351 | QCopChannel::send( "QPE/TaskBar", "showInputMethod()" ); | 351 | QCopChannel::send( "QPE/TaskBar", "showInputMethod()" ); |
352 | #endif | 352 | #endif |
353 | } | 353 | } |
354 | 354 | ||
355 | /*! | 355 | /*! |
356 | Explicitly hide the current input method. | 356 | Explicitly hide the current input method. |
357 | */ | 357 | */ |
358 | void Global::hideInputMethod() | 358 | void Global::hideInputMethod() |
359 | { | 359 | { |
360 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 360 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
361 | QCopChannel::send( "QPE/TaskBar", "hideInputMethod()" ); | 361 | QCopChannel::send( "QPE/TaskBar", "hideInputMethod()" ); |
362 | #endif | 362 | #endif |
363 | } | 363 | } |
364 | 364 | ||
365 | 365 | ||
366 | /*! | 366 | /*! |
367 | \internal | 367 | \internal |
368 | */ | 368 | */ |
369 | bool Global::isBuiltinCommand( const QString &name ) | 369 | bool Global::isBuiltinCommand( const QString &name ) |
370 | { | 370 | { |
371 | if(!builtin) | 371 | if(!builtin) |
372 | return FALSE; // yes, it can happen | 372 | return FALSE; // yes, it can happen |
373 | for (int i = 0; builtin[i].file; i++) { | 373 | for (int i = 0; builtin[i].file; i++) { |
374 | if ( builtin[i].file == name ) { | 374 | if ( builtin[i].file == name ) { |
375 | return TRUE; | 375 | return TRUE; |
376 | } | 376 | } |
377 | } | 377 | } |
378 | return FALSE; | 378 | return FALSE; |
379 | } | 379 | } |
380 | 380 | ||
381 | Global::Command* Global::builtin=0; | 381 | Global::Command* Global::builtin=0; |
382 | QGuardedPtr<QWidget> *Global::running=0; | 382 | QGuardedPtr<QWidget> *Global::running=0; |
383 | 383 | ||
384 | /*! | 384 | /*! |
385 | \class Global::Command | 385 | \class Global::Command |
386 | \brief The Global::Command class is internal. | 386 | \brief The Global::Command class is internal. |
387 | \internal | 387 | \internal |
388 | */ | 388 | */ |
389 | 389 | ||
390 | /*! | 390 | /*! |
391 | \internal | 391 | \internal |
392 | */ | 392 | */ |
393 | void Global::setBuiltinCommands( Command* list ) | 393 | void Global::setBuiltinCommands( Command* list ) |
394 | { | 394 | { |
395 | if ( running ) | 395 | if ( running ) |
396 | delete [] running; | 396 | delete [] running; |
397 | 397 | ||
398 | builtin = list; | 398 | builtin = list; |
399 | int count = 0; | 399 | int count = 0; |
400 | if (!builtin) | 400 | if (!builtin) |
401 | return; | 401 | return; |
402 | while ( builtin[count].file ) | 402 | while ( builtin[count].file ) |
403 | count++; | 403 | count++; |
404 | 404 | ||
405 | running = new QGuardedPtr<QWidget> [ count ]; | 405 | running = new QGuardedPtr<QWidget> [ count ]; |
406 | } | 406 | } |
407 | 407 | ||
408 | /*! | 408 | /*! |
409 | \internal | 409 | \internal |
410 | */ | 410 | */ |
411 | void Global::setDocument( QWidget* receiver, const QString& document ) | 411 | void Global::setDocument( QWidget* receiver, const QString& document ) |
412 | { | 412 | { |
413 | Emitter emitter(receiver,document); | 413 | Emitter emitter(receiver,document); |
414 | } | 414 | } |
415 | 415 | ||
416 | /*! | 416 | /*! |
417 | \internal | 417 | \internal |
418 | */ | 418 | */ |
419 | bool Global::terminateBuiltin( const QString& n ) | 419 | bool Global::terminateBuiltin( const QString& n ) |
420 | { | 420 | { |
421 | if (!builtin) | 421 | if (!builtin) |
422 | return FALSE; | 422 | return FALSE; |
423 | for (int i = 0; builtin[i].file; i++) { | 423 | for (int i = 0; builtin[i].file; i++) { |
424 | if ( builtin[i].file == n ) { | 424 | if ( builtin[i].file == n ) { |
425 | delete running[i]; | 425 | delete running[i]; |
426 | return TRUE; | 426 | return TRUE; |
427 | } | 427 | } |
428 | } | 428 | } |
429 | return FALSE; | 429 | return FALSE; |
430 | } | 430 | } |
431 | 431 | ||
432 | /*! | 432 | /*! |
433 | \internal | 433 | \internal |
434 | */ | 434 | */ |
435 | void Global::terminate( const AppLnk* app ) | 435 | void Global::terminate( const AppLnk* app ) |
436 | { | 436 | { |
437 | //if ( terminateBuiltin(app->exec()) ) return; // maybe? haven't tried this | 437 | //if ( terminateBuiltin(app->exec()) ) return; // maybe? haven't tried this |
438 | 438 | ||
439 | QCString channel = "QPE/Application/" + app->exec().utf8(); | 439 | QCString channel = "QPE/Application/" + app->exec().utf8(); |
440 | if ( QCopChannel::isRegistered(channel) ) { | 440 | if ( QCopChannel::isRegistered(channel) ) { |
441 | QCopEnvelope e(channel, "quit()"); | 441 | QCopEnvelope e(channel, "quit()"); |
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | /*! | 445 | /*! |
446 | Low-level function to run command \a c. Not recommended. | 446 | Low-level function to run command \a c. Not recommended. |
447 | */ | 447 | */ |
448 | void Global::invoke(const QString &c) | 448 | void Global::invoke(const QString &c) |
449 | { | 449 | { |
450 | // Convert the command line in to a list of arguments | 450 | // Convert the command line in to a list of arguments |
451 | QStringList list = QStringList::split(QRegExp(" *"),c); | 451 | QStringList list = QStringList::split(QRegExp(" *"),c); |
452 | 452 | ||
453 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 453 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
454 | QString ap=list[0]; | 454 | QString ap=list[0]; |
455 | // see if the application is already running | 455 | // see if the application is already running |
456 | // XXX should lock file /tmp/qcop-msg-ap | 456 | // XXX should lock file /tmp/qcop-msg-ap |
457 | if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { | 457 | if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { |
458 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); | 458 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); |
459 | e << ap; | 459 | e << ap; |
460 | return; | 460 | return; |
461 | } | 461 | } |
462 | // XXX should unlock file /tmp/qcop-msg-ap | 462 | // XXX should unlock file /tmp/qcop-msg-ap |
463 | //see if it is being started | 463 | //see if it is being started |
464 | if ( StartingAppList::isStarting( ap ) ) { | 464 | if ( StartingAppList::isStarting( ap ) ) { |
465 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); | 465 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); |
466 | e << ap; | 466 | e << ap; |
467 | return; | 467 | return; |
468 | } | 468 | } |
469 | 469 | ||
470 | #endif | 470 | #endif |
471 | 471 | ||
472 | #ifdef QT_NO_QWS_MULTIPROCESS | 472 | #ifdef QT_NO_QWS_MULTIPROCESS |
473 | QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); | 473 | QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); |
474 | #else | 474 | #else |
475 | 475 | ||
476 | QStrList slist; | 476 | QStrList slist; |
477 | unsigned int j; | 477 | unsigned int j; |
478 | for ( j = 0; j < list.count(); j++ ) | 478 | for ( j = 0; j < list.count(); j++ ) |
479 | slist.append( list[j].utf8() ); | 479 | slist.append( list[j].utf8() ); |
480 | 480 | ||
481 | const char **args = new (const char *)[slist.count() + 1]; | 481 | const char **args = new (const char *)[slist.count() + 1]; |
482 | for ( j = 0; j < slist.count(); j++ ) | 482 | for ( j = 0; j < slist.count(); j++ ) |
483 | args[j] = slist.at(j); | 483 | args[j] = slist.at(j); |
484 | args[j] = NULL; | 484 | args[j] = NULL; |
485 | 485 | ||
486 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 486 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
487 | // an attempt to show a wait... | 487 | // an attempt to show a wait... |
488 | // more logic should be used, but this will be fine for the moment... | 488 | // more logic should be used, but this will be fine for the moment... |
489 | QCopEnvelope ( "QPE/System", "busy()" ); | 489 | QCopEnvelope ( "QPE/System", "busy()" ); |
490 | #endif | 490 | #endif |
491 | 491 | ||
492 | #ifdef HAVE_QUICKEXEC | 492 | #ifdef HAVE_QUICKEXEC |
493 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; | 493 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; |
494 | qDebug("libfile = %s", libexe.latin1() ); | 494 | qDebug("libfile = %s", libexe.latin1() ); |
495 | if ( QFile::exists( libexe ) ) { | 495 | if ( QFile::exists( libexe ) ) { |
496 | qDebug("calling quickexec %s", libexe.latin1() ); | 496 | qDebug("calling quickexec %s", libexe.latin1() ); |
497 | quickexecv( libexe.utf8().data(), (const char **)args ); | 497 | quickexecv( libexe.utf8().data(), (const char **)args ); |
498 | } else | 498 | } else |
499 | #endif | 499 | #endif |
500 | { | 500 | { |
501 | if ( !::vfork() ) { | 501 | if ( !::vfork() ) { |
502 | for ( int fd = 3; fd < 100; fd++ ) | 502 | for ( int fd = 3; fd < 100; fd++ ) |
503 | ::close( fd ); | 503 | ::close( fd ); |
504 | ::setpgid( ::getpid(), ::getppid() ); | 504 | ::setpgid( ::getpid(), ::getppid() ); |
505 | // Try bindir first, so that foo/bar works too | 505 | // Try bindir first, so that foo/bar works too |
506 | ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); | 506 | ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); |
507 | ::execvp( args[0], (char * const *)args ); | 507 | ::execvp( args[0], (char * const *)args ); |
508 | exit( -1 ); | 508 | exit( -1 ); |
509 | } | 509 | } |
510 | } | 510 | } |
511 | StartingAppList::add( list[0] ); | 511 | StartingAppList::add( list[0] ); |
512 | #endif //QT_NO_QWS_MULTIPROCESS | 512 | #endif //QT_NO_QWS_MULTIPROCESS |
513 | } | 513 | } |
514 | 514 | ||
515 | /*! | 515 | /*! |
516 | Executes application identfied by \a c, passing \a document. | 516 | Executes application identfied by \a c, passing \a document. |
517 | 517 | ||
518 | Note that you might be better off sending a QCop message to | 518 | Note that you might be better off sending a QCop message to |
519 | the application's QPE/Application/<i>appname</i> channel. | 519 | the application's QPE/Application/<i>appname</i> channel. |
520 | */ | 520 | */ |
521 | void Global::execute( const QString &c, const QString& document ) | 521 | void Global::execute( const QString &c, const QString& document ) |
522 | { | 522 | { |
523 | if ( qApp->type() != QApplication::GuiServer ) { | 523 | if ( qApp->type() != QApplication::GuiServer ) { |
524 | // ask the server to do the work | 524 | // ask the server to do the work |
525 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 525 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
526 | if ( document.isNull() ) { | 526 | if ( document.isNull() ) { |
527 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 527 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
528 | e << c; | 528 | e << c; |
529 | } else { | 529 | } else { |
530 | QCopEnvelope e( "QPE/System", "execute(QString,QString)" ); | 530 | QCopEnvelope e( "QPE/System", "execute(QString,QString)" ); |
531 | e << c << document; | 531 | e << c << document; |
532 | } | 532 | } |
533 | #endif | 533 | #endif |
534 | return; | 534 | return; |
535 | } | 535 | } |
536 | 536 | ||
537 | // Attempt to execute the app using a builtin class for the app first | 537 | // Attempt to execute the app using a builtin class for the app first |
538 | // else try and find it in the bin directory | 538 | // else try and find it in the bin directory |
539 | if (builtin) { | 539 | if (builtin) { |
540 | for (int i = 0; builtin[i].file; i++) { | 540 | for (int i = 0; builtin[i].file; i++) { |
541 | if ( builtin[i].file == c ) { | 541 | if ( builtin[i].file == c ) { |
542 | if ( running[i] ) { | 542 | if ( running[i] ) { |
543 | if ( !document.isNull() && builtin[i].documentary ) | 543 | if ( !document.isNull() && builtin[i].documentary ) |
544 | setDocument(running[i], document); | 544 | setDocument(running[i], document); |
545 | running[i]->raise(); | 545 | running[i]->raise(); |
546 | running[i]->show(); | 546 | running[i]->show(); |
547 | running[i]->setActiveWindow(); | 547 | running[i]->setActiveWindow(); |
548 | } else { | 548 | } else { |
549 | running[i] = builtin[i].func( builtin[i].maximized ); | 549 | running[i] = builtin[i].func( builtin[i].maximized ); |
550 | } | 550 | } |
551 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); | 551 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); |
552 | e << c; // that was quick ;-) | 552 | e << c; // that was quick ;-) |
553 | return; | 553 | return; |
554 | } | 554 | } |
555 | } | 555 | } |
556 | } | 556 | } |
557 | 557 | ||
558 | //Global::invoke(c, document); | 558 | //Global::invoke(c, document); |
559 | 559 | ||
560 | // Convert the command line in to a list of arguments | 560 | // Convert the command line in to a list of arguments |
561 | QStringList list = QStringList::split(QRegExp(" *"),c); | 561 | QStringList list = QStringList::split(QRegExp(" *"),c); |
562 | 562 | ||
563 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 563 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
564 | QString ap=list[0]; | 564 | QString ap=list[0]; |
565 | 565 | ||
566 | qDebug("executing %s", ap.latin1() ); | 566 | qDebug("executing %s", ap.latin1() ); |
567 | if ( ap == "suspend" ) { | 567 | if ( ap == "suspend" ) { |
568 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); | 568 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); |
569 | return; | 569 | return; |
570 | } | 570 | } |
571 | 571 | ||
572 | /* if need be, sending a qcop message will result in an invoke, see | 572 | /* if need be, sending a qcop message will result in an invoke, see |
573 | preceeding function */ | 573 | preceeding function */ |
574 | { QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); } | 574 | { QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); } |
575 | if ( !document.isEmpty() ) { | 575 | if ( !document.isEmpty() ) { |
576 | QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "setDocument(QString)" ); | 576 | QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "setDocument(QString)" ); |
577 | env << document; | 577 | env << document; |
578 | } | 578 | } |
579 | #endif | 579 | #endif |
580 | } | 580 | } |
581 | 581 | ||
582 | /*! | 582 | /*! |
583 | Returns the string \a s with the characters backslash, ", and $ | 583 | Returns the string \a s with the characters backslash, ", and $ |
584 | quoted by a preceeding backslash. | 584 | quoted by a preceeding backslash. |
585 | */ | 585 | */ |
586 | QString Global::shellQuote(const QString& s) | 586 | QString Global::shellQuote(const QString& s) |
587 | { | 587 | { |
588 | QString r="\""; | 588 | QString r="\""; |
589 | for (int i=0; i<(int)s.length(); i++) { | 589 | for (int i=0; i<(int)s.length(); i++) { |
590 | char c = s[i].latin1(); | 590 | char c = s[i].latin1(); |
591 | switch (c) { | 591 | switch (c) { |
592 | case '\\': case '"': case '$': | 592 | case '\\': case '"': case '$': |
593 | r+="\\"; | 593 | r+="\\"; |
594 | } | 594 | } |
595 | r += s[i]; | 595 | r += s[i]; |
596 | } | 596 | } |
597 | r += "\""; | 597 | r += "\""; |
598 | return r; | 598 | return r; |
599 | } | 599 | } |
600 | 600 | ||
601 | /*! | 601 | /*! |
602 | Returns the string \a s with the characters backslash and " | 602 | Returns the string \a s with the characters backslash and " |
603 | quoted by a preceeding backslash. | 603 | quoted by a preceeding backslash. |
604 | */ | 604 | */ |
605 | QString Global::stringQuote(const QString& s) | 605 | QString Global::stringQuote(const QString& s) |
606 | { | 606 | { |
607 | QString r="\""; | 607 | QString r="\""; |
608 | for (int i=0; i<(int)s.length(); i++) { | 608 | for (int i=0; i<(int)s.length(); i++) { |
609 | char c = s[i].latin1(); | 609 | char c = s[i].latin1(); |
610 | switch (c) { | 610 | switch (c) { |
611 | case '\\': case '"': | 611 | case '\\': case '"': |
612 | r+="\\"; | 612 | r+="\\"; |
613 | } | 613 | } |
614 | r += s[i]; | 614 | r += s[i]; |
615 | } | 615 | } |
616 | r += "\""; | 616 | r += "\""; |
617 | return r; | 617 | return r; |
618 | } | 618 | } |
619 | 619 | ||
620 | /*! | 620 | /*! |
621 | Finds all documents on the system's document directories which | 621 | Finds all documents on the system's document directories which |
622 | match the filter \a mimefilter, and appends the resulting DocLnk | 622 | match the filter \a mimefilter, and appends the resulting DocLnk |
623 | objects to \a folder. | 623 | objects to \a folder. |
624 | */ | 624 | */ |
625 | void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) | 625 | void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) |
626 | { | 626 | { |
627 | QString homedocs = QString(getenv("HOME")) + "/Documents"; | 627 | QString homedocs = QString(getenv("HOME")) + "/Documents"; |
628 | DocLnkSet d(homedocs,mimefilter); | 628 | DocLnkSet d(homedocs,mimefilter); |
629 | folder->appendFrom(d); | 629 | folder->appendFrom(d); |
630 | StorageInfo storage; | 630 | StorageInfo storage; |
631 | const QList<FileSystem> &fs = storage.fileSystems(); | 631 | const QList<FileSystem> &fs = storage.fileSystems(); |
632 | QListIterator<FileSystem> it ( fs ); | 632 | QListIterator<FileSystem> it ( fs ); |
633 | for ( ; it.current(); ++it ) { | 633 | for ( ; it.current(); ++it ) { |
634 | if ( (*it)->isRemovable() ) { | 634 | if ( (*it)->isRemovable() ) { |
635 | QString path = (*it)->path(); | 635 | QString path = (*it)->path(); |
636 | DocLnkSet ide( path, mimefilter ); | 636 | DocLnkSet ide( path, mimefilter ); |
637 | folder->appendFrom(ide); | 637 | folder->appendFrom(ide); |
638 | } | 638 | } |
639 | } | 639 | } |
640 | } | 640 | } |
641 | 641 | ||
642 | 642 | ||
643 | 643 | ||
644 | #include "global.moc" | 644 | #include "global.moc" |
diff --git a/library/library.pro b/library/library.pro index 06dfc8f..058d216 100644 --- a/library/library.pro +++ b/library/library.pro | |||
@@ -1,132 +1,132 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | HEADERS= calendar.h \ | 3 | HEADERS= calendar.h \ |
4 | global.h \ | 4 | global.h \ |
5 | resource.h \ | 5 | resource.h \ |
6 | xmlreader.h \ | 6 | xmlreader.h \ |
7 | mimetype.h \ | 7 | mimetype.h \ |
8 | menubutton.h \ | 8 | menubutton.h \ |
9 | network.h \ | 9 | network.h \ |
10 | networkinterface.h \ | 10 | networkinterface.h \ |
11 | proxies.h \ | 11 | proxies.h \ |
12 | filemanager.h \ | 12 | filemanager.h \ |
13 | fontmanager.h \ | 13 | fontmanager.h \ |
14 | qdawg.h \ | 14 | qdawg.h \ |
15 | datebookmonth.h \ | 15 | datebookmonth.h \ |
16 | fileselector.h \ | 16 | fileselector.h \ |
17 | imageedit.h \ | 17 | imageedit.h \ |
18 | qcopenvelope_qws.h \ | 18 | qcopenvelope_qws.h \ |
19 | qpedecoration_qws.h \ | 19 | qpedecoration_qws.h \ |
20 | qpeapplication.h \ | 20 | qpeapplication.h \ |
21 | qpestyle.h \ | 21 | qpestyle.h \ |
22 | qpedialog.h \ | 22 | qpedialog.h \ |
23 | lightstyle.h \ | 23 | lightstyle.h \ |
24 | config.h \ | 24 | config.h \ |
25 | applnk.h \ | 25 | applnk.h \ |
26 | sound.h \ | 26 | sound.h \ |
27 | tzselect.h \ | 27 | tzselect.h \ |
28 | qmath.h \ | 28 | qmath.h \ |
29 | datebookdb.h \ | 29 | datebookdb.h \ |
30 | alarmserver.h \ | 30 | alarmserver.h \ |
31 | process.h \ | 31 | process.h \ |
32 | password.h \ | 32 | password.h \ |
33 | timestring.h \ | 33 | timestring.h \ |
34 | fontfactoryinterface.h \ | 34 | fontfactoryinterface.h \ |
35 | fontdatabase.h \ | 35 | fontdatabase.h \ |
36 | power.h \ | 36 | power.h \ |
37 | storage.h \ | 37 | storage.h \ |
38 | qpemessagebox.h \ | 38 | qpemessagebox.h \ |
39 | backend/timeconversion.h \ | 39 | backend/timeconversion.h \ |
40 | qpedebug.h \ | 40 | qpedebug.h \ |
41 | qpemenubar.h \ | 41 | qpemenubar.h \ |
42 | qpetoolbar.h \ | 42 | qpetoolbar.h \ |
43 | backend/categories.h \ | 43 | backend/categories.h \ |
44 | backend/stringutil.h \ | 44 | backend/stringutil.h \ |
45 | backend/palmtopuid.h \ | 45 | backend/palmtopuid.h \ |
46 | backend/palmtoprecord.h \ | 46 | backend/palmtoprecord.h \ |
47 | backend/task.h \ | 47 | backend/task.h \ |
48 | backend/event.h \ | 48 | backend/event.h \ |
49 | backend/contact.h\ | 49 | backend/contact.h\ |
50 | categorymenu.h \ | 50 | categorymenu.h \ |
51 | categoryedit_p.h \ | 51 | categoryedit_p.h \ |
52 | categoryselect.h \ | 52 | categoryselect.h \ |
53 | categorywidget.h \ | 53 | categorywidget.h \ |
54 | ir.h \ | 54 | ir.h \ |
55 | backend/vobject_p.h \ | 55 | backend/vobject_p.h \ |
56 | findwidget_p.h \ | 56 | findwidget_p.h \ |
57 | finddialog.h \ | 57 | finddialog.h \ |
58 | lnkproperties.h | 58 | lnkproperties.h |
59 | 59 | ||
60 | SOURCES= calendar.cpp \ | 60 | SOURCES= calendar.cpp \ |
61 | global.cpp \ | 61 | global.cpp \ |
62 | xmlreader.cpp \ | 62 | xmlreader.cpp \ |
63 | mimetype.cpp \ | 63 | mimetype.cpp \ |
64 | menubutton.cpp \ | 64 | menubutton.cpp \ |
65 | network.cpp \ | 65 | network.cpp \ |
66 | networkinterface.cpp \ | 66 | networkinterface.cpp \ |
67 | proxies.cpp \ | 67 | proxies.cpp \ |
68 | filemanager.cpp \ | 68 | filemanager.cpp \ |
69 | fontmanager.cpp \ | 69 | fontmanager.cpp \ |
70 | qdawg.cpp \ | 70 | qdawg.cpp \ |
71 | datebookmonth.cpp \ | 71 | datebookmonth.cpp \ |
72 | fileselector.cpp \ | 72 | fileselector.cpp \ |
73 | imageedit.cpp \ | 73 | imageedit.cpp \ |
74 | resource.cpp \ | 74 | resource.cpp \ |
75 | qpedecoration_qws.cpp \ | 75 | qpedecoration_qws.cpp \ |
76 | qcopenvelope_qws.cpp \ | 76 | qcopenvelope_qws.cpp \ |
77 | qpeapplication.cpp \ | 77 | qpeapplication.cpp \ |
78 | qpestyle.cpp \ | 78 | qpestyle.cpp \ |
79 | qpedialog.cpp \ | 79 | qpedialog.cpp \ |
80 | lightstyle.cpp \ | 80 | lightstyle.cpp \ |
81 | config.cpp \ | 81 | config.cpp \ |
82 | applnk.cpp \ | 82 | applnk.cpp \ |
83 | sound.cpp \ | 83 | sound.cpp \ |
84 | tzselect.cpp \ | 84 | tzselect.cpp \ |
85 | qmath.c \ | 85 | qmath.c \ |
86 | datebookdb.cpp \ | 86 | datebookdb.cpp \ |
87 | alarmserver.cpp \ | 87 | alarmserver.cpp \ |
88 | password.cpp \ | 88 | password.cpp \ |
89 | process.cpp \ | 89 | process.cpp \ |
90 | process_unix.cpp \ | 90 | process_unix.cpp \ |
91 | timestring.cpp \ | 91 | timestring.cpp \ |
92 | fontdatabase.cpp \ | 92 | fontdatabase.cpp \ |
93 | power.cpp \ | 93 | power.cpp \ |
94 | storage.cpp \ | 94 | storage.cpp \ |
95 | qpemessagebox.cpp \ | 95 | qpemessagebox.cpp \ |
96 | backend/timeconversion.cpp \ | 96 | backend/timeconversion.cpp \ |
97 | qpedebug.cpp \ | 97 | qpedebug.cpp \ |
98 | qpemenubar.cpp \ | 98 | qpemenubar.cpp \ |
99 | qpetoolbar.cpp \ | 99 | qpetoolbar.cpp \ |
100 | backend/categories.cpp \ | 100 | backend/categories.cpp \ |
101 | backend/stringutil.cpp \ | 101 | backend/stringutil.cpp \ |
102 | backend/palmtoprecord.cpp \ | 102 | backend/palmtoprecord.cpp \ |
103 | backend/task.cpp \ | 103 | backend/task.cpp \ |
104 | backend/event.cpp \ | 104 | backend/event.cpp \ |
105 | backend/contact.cpp \ | 105 | backend/contact.cpp \ |
106 | categorymenu.cpp \ | 106 | categorymenu.cpp \ |
107 | categoryedit_p.cpp \ | 107 | categoryedit_p.cpp \ |
108 | categoryselect.cpp \ | 108 | categoryselect.cpp \ |
109 | categorywidget.cpp \ | 109 | categorywidget.cpp \ |
110 | ir.cpp \ | 110 | ir.cpp \ |
111 | backend/vcc_yacc.cpp \ | 111 | backend/vcc_yacc.cpp \ |
112 | backend/vobject.cpp \ | 112 | backend/vobject.cpp \ |
113 | findwidget_p.cpp \ | 113 | findwidget_p.cpp \ |
114 | finddialog.cpp \ | 114 | finddialog.cpp \ |
115 | lnkproperties.cpp | 115 | lnkproperties.cpp |
116 | 116 | ||
117 | # Qt 3 compatibility | 117 | # Qt 3 compatibility |
118 | qt2:HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h qprocess.h | 118 | qt2:HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h qprocess.h |
119 | qt2:SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp qprocess.cpp \ | 119 | qt2:SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp qprocess.cpp \ |
120 | qprocess_unix.cpp | 120 | qprocess_unix.cpp |
121 | 121 | ||
122 | INCLUDEPATH += $(QPEDIR)/include backend | 122 | INCLUDEPATH += $(OPIEDIR)/include backend |
123 | LIBS += -ldl -lcrypt -lm | 123 | LIBS += -ldl -lcrypt -lm |
124 | 124 | ||
125 | INTERFACES = passwordbase_p.ui proxiesbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui | 125 | INTERFACES = passwordbase_p.ui proxiesbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui |
126 | 126 | ||
127 | TARGET = qpe | 127 | TARGET = qpe |
128 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 128 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
129 | # This is set by configure$(QPEDIR). | 129 | # This is set by configure$(OPIEDIR). |
130 | VERSION = 1.5.0 | 130 | VERSION = 1.5.0 |
131 | 131 | ||
132 | TRANSLATIONS = ../i18n/de/libqpe.ts | 132 | TRANSLATIONS = ../i18n/de/libqpe.ts |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index f0a68cf..70ffec1 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1,1597 +1,1597 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | ** $Id$ | 19 | ** $Id$ |
20 | ** | 20 | ** |
21 | **********************************************************************/ | 21 | **********************************************************************/ |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | #include <unistd.h> | 23 | #include <unistd.h> |
24 | #include <qfile.h> | 24 | #include <qfile.h> |
25 | #ifdef Q_WS_QWS | 25 | #ifdef Q_WS_QWS |
26 | #ifndef QT_NO_COP | 26 | #ifndef QT_NO_COP |
27 | #if QT_VERSION <= 231 | 27 | #if QT_VERSION <= 231 |
28 | #define private public | 28 | #define private public |
29 | #define sendLocally processEvent | 29 | #define sendLocally processEvent |
30 | #include "qcopenvelope_qws.h" | 30 | #include "qcopenvelope_qws.h" |
31 | #undef private | 31 | #undef private |
32 | #else | 32 | #else |
33 | #include "qcopenvelope_qws.h" | 33 | #include "qcopenvelope_qws.h" |
34 | #endif | 34 | #endif |
35 | #endif | 35 | #endif |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | #endif | 37 | #endif |
38 | #include <qtextstream.h> | 38 | #include <qtextstream.h> |
39 | #include <qpalette.h> | 39 | #include <qpalette.h> |
40 | #include <qbuffer.h> | 40 | #include <qbuffer.h> |
41 | #include <qptrdict.h> | 41 | #include <qptrdict.h> |
42 | #include <qregexp.h> | 42 | #include <qregexp.h> |
43 | #include <qdir.h> | 43 | #include <qdir.h> |
44 | #include <qlabel.h> | 44 | #include <qlabel.h> |
45 | #include <qdialog.h> | 45 | #include <qdialog.h> |
46 | #include <qdragobject.h> | 46 | #include <qdragobject.h> |
47 | #include <qevent.h> | 47 | #include <qevent.h> |
48 | #include <qtooltip.h> | 48 | #include <qtooltip.h> |
49 | #include <qsignal.h> | 49 | #include <qsignal.h> |
50 | #include "qpeapplication.h" | 50 | #include "qpeapplication.h" |
51 | #include "qpestyle.h" | 51 | #include "qpestyle.h" |
52 | #if QT_VERSION >= 300 | 52 | #if QT_VERSION >= 300 |
53 | #include <qstylefactory.h> | 53 | #include <qstylefactory.h> |
54 | #else | 54 | #else |
55 | #include <qplatinumstyle.h> | 55 | #include <qplatinumstyle.h> |
56 | #include <qwindowsstyle.h> | 56 | #include <qwindowsstyle.h> |
57 | #include <qmotifstyle.h> | 57 | #include <qmotifstyle.h> |
58 | #include <qmotifplusstyle.h> | 58 | #include <qmotifplusstyle.h> |
59 | #include "lightstyle.h" | 59 | #include "lightstyle.h" |
60 | #endif | 60 | #endif |
61 | #include "global.h" | 61 | #include "global.h" |
62 | #include "resource.h" | 62 | #include "resource.h" |
63 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 63 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
64 | #include "qutfcodec.h" | 64 | #include "qutfcodec.h" |
65 | #endif | 65 | #endif |
66 | #include "config.h" | 66 | #include "config.h" |
67 | #include "network.h" | 67 | #include "network.h" |
68 | #include "fontmanager.h" | 68 | #include "fontmanager.h" |
69 | #include "power.h" | 69 | #include "power.h" |
70 | #include "alarmserver.h" | 70 | #include "alarmserver.h" |
71 | #include "applnk.h" | 71 | #include "applnk.h" |
72 | #include "qpemenubar.h" | 72 | #include "qpemenubar.h" |
73 | 73 | ||
74 | #include <unistd.h> | 74 | #include <unistd.h> |
75 | #include <sys/file.h> | 75 | #include <sys/file.h> |
76 | #include <sys/ioctl.h> | 76 | #include <sys/ioctl.h> |
77 | #include <sys/soundcard.h> | 77 | #include <sys/soundcard.h> |
78 | 78 | ||
79 | // for setBacklight() | 79 | // for setBacklight() |
80 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) | 80 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) |
81 | #include <linux/fb.h> | 81 | #include <linux/fb.h> |
82 | #include <sys/types.h> | 82 | #include <sys/types.h> |
83 | #include <sys/stat.h> | 83 | #include <sys/stat.h> |
84 | #endif | 84 | #endif |
85 | #include <stdlib.h> | 85 | #include <stdlib.h> |
86 | 86 | ||
87 | 87 | ||
88 | class QPEApplicationData { | 88 | class QPEApplicationData { |
89 | public: | 89 | public: |
90 | QPEApplicationData() : presstimer(0), presswidget(0), rightpressed(FALSE), | 90 | QPEApplicationData() : presstimer(0), presswidget(0), rightpressed(FALSE), |
91 | kbgrabber(0), kbregrab(FALSE), notbusysent(FALSE), preloaded(FALSE), | 91 | kbgrabber(0), kbregrab(FALSE), notbusysent(FALSE), preloaded(FALSE), |
92 | forceshow(FALSE), nomaximize(FALSE), qpe_main_widget(0), | 92 | forceshow(FALSE), nomaximize(FALSE), qpe_main_widget(0), |
93 | keep_running(TRUE) | 93 | keep_running(TRUE) |
94 | { | 94 | { |
95 | qcopq.setAutoDelete(TRUE); | 95 | qcopq.setAutoDelete(TRUE); |
96 | } | 96 | } |
97 | 97 | ||
98 | int presstimer; | 98 | int presstimer; |
99 | QWidget* presswidget; | 99 | QWidget* presswidget; |
100 | QPoint presspos; | 100 | QPoint presspos; |
101 | bool rightpressed; | 101 | bool rightpressed; |
102 | int kbgrabber; | 102 | int kbgrabber; |
103 | bool kbregrab; | 103 | bool kbregrab; |
104 | bool notbusysent; | 104 | bool notbusysent; |
105 | QString appName; | 105 | QString appName; |
106 | struct QCopRec { | 106 | struct QCopRec { |
107 | QCopRec(const QCString &ch, const QCString &msg, | 107 | QCopRec(const QCString &ch, const QCString &msg, |
108 | const QByteArray &d) : | 108 | const QByteArray &d) : |
109 | channel(ch), message(msg), data(d) { } | 109 | channel(ch), message(msg), data(d) { } |
110 | 110 | ||
111 | QCString channel; | 111 | QCString channel; |
112 | QCString message; | 112 | QCString message; |
113 | QByteArray data; | 113 | QByteArray data; |
114 | }; | 114 | }; |
115 | bool preloaded; | 115 | bool preloaded; |
116 | bool forceshow; | 116 | bool forceshow; |
117 | bool nomaximize; | 117 | bool nomaximize; |
118 | QWidget* qpe_main_widget; | 118 | QWidget* qpe_main_widget; |
119 | bool keep_running; | 119 | bool keep_running; |
120 | QList<QCopRec> qcopq; | 120 | QList<QCopRec> qcopq; |
121 | 121 | ||
122 | void enqueueQCop(const QCString &ch, const QCString &msg, | 122 | void enqueueQCop(const QCString &ch, const QCString &msg, |
123 | const QByteArray &data) | 123 | const QByteArray &data) |
124 | { | 124 | { |
125 | qcopq.append(new QCopRec(ch,msg,data)); | 125 | qcopq.append(new QCopRec(ch,msg,data)); |
126 | } | 126 | } |
127 | void sendQCopQ() | 127 | void sendQCopQ() |
128 | { | 128 | { |
129 | QCopRec* r; | 129 | QCopRec* r; |
130 | for (QListIterator<QCopRec> it(qcopq); (r=it.current()); ++it) | 130 | for (QListIterator<QCopRec> it(qcopq); (r=it.current()); ++it) |
131 | QCopChannel::sendLocally(r->channel,r->message,r->data); | 131 | QCopChannel::sendLocally(r->channel,r->message,r->data); |
132 | qcopq.clear(); | 132 | qcopq.clear(); |
133 | } | 133 | } |
134 | }; | 134 | }; |
135 | 135 | ||
136 | class ResourceMimeFactory : public QMimeSourceFactory { | 136 | class ResourceMimeFactory : public QMimeSourceFactory { |
137 | public: | 137 | public: |
138 | ResourceMimeFactory() | 138 | ResourceMimeFactory() |
139 | { | 139 | { |
140 | QStringList path; | 140 | QStringList path; |
141 | QString lang = getenv("LANG"); | 141 | QString lang = getenv("LANG"); |
142 | if ( !lang.isEmpty() ) | 142 | if ( !lang.isEmpty() ) |
143 | path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; | 143 | path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; |
144 | path += QPEApplication::qpeDir() + "/pics"; | 144 | path += QPEApplication::qpeDir() + "/pics"; |
145 | path += QPEApplication::qpeDir() + "/help/en/html"; | 145 | path += QPEApplication::qpeDir() + "/help/en/html"; |
146 | path += QPEApplication::qpeDir() + "/docs"; | 146 | path += QPEApplication::qpeDir() + "/docs"; |
147 | QString dir = QDir::current().canonicalPath(); | 147 | QString dir = QDir::current().canonicalPath(); |
148 | if ( dir == "/" ) | 148 | if ( dir == "/" ) |
149 | dir += "/docs"; | 149 | dir += "/docs"; |
150 | else { | 150 | else { |
151 | path += dir + "/../pics"; | 151 | path += dir + "/../pics"; |
152 | dir += "/../docs"; | 152 | dir += "/../docs"; |
153 | path += dir; | 153 | path += dir; |
154 | } | 154 | } |
155 | setFilePath( path ); | 155 | setFilePath( path ); |
156 | setExtensionType("html","text/html;charset=UTF-8"); | 156 | setExtensionType("html","text/html;charset=UTF-8"); |
157 | } | 157 | } |
158 | 158 | ||
159 | const QMimeSource* data(const QString& abs_name) const | 159 | const QMimeSource* data(const QString& abs_name) const |
160 | { | 160 | { |
161 | const QMimeSource* r = QMimeSourceFactory::data(abs_name); | 161 | const QMimeSource* r = QMimeSourceFactory::data(abs_name); |
162 | if ( !r ) { | 162 | if ( !r ) { |
163 | int sl = abs_name.length(); | 163 | int sl = abs_name.length(); |
164 | do { | 164 | do { |
165 | sl = abs_name.findRev('/',sl-1); | 165 | sl = abs_name.findRev('/',sl-1); |
166 | QString name = sl>=0 ? abs_name.mid(sl+1) : abs_name; | 166 | QString name = sl>=0 ? abs_name.mid(sl+1) : abs_name; |
167 | int dot = name.findRev('.'); | 167 | int dot = name.findRev('.'); |
168 | if ( dot >= 0 ) | 168 | if ( dot >= 0 ) |
169 | name = name.left(dot); | 169 | name = name.left(dot); |
170 | QImage img = Resource::loadImage(name); | 170 | QImage img = Resource::loadImage(name); |
171 | if ( !img.isNull() ) | 171 | if ( !img.isNull() ) |
172 | r = new QImageDrag(img); | 172 | r = new QImageDrag(img); |
173 | } while (!r && sl>0); | 173 | } while (!r && sl>0); |
174 | } | 174 | } |
175 | return r; | 175 | return r; |
176 | } | 176 | } |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static int muted=0; | 179 | static int muted=0; |
180 | 180 | ||
181 | static void setVolume(int t=0, int percent=-1) | 181 | static void setVolume(int t=0, int percent=-1) |
182 | { | 182 | { |
183 | switch (t) { | 183 | switch (t) { |
184 | case 0: { | 184 | case 0: { |
185 | Config cfg("Sound"); | 185 | Config cfg("Sound"); |
186 | cfg.setGroup("System"); | 186 | cfg.setGroup("System"); |
187 | if ( percent < 0 ) | 187 | if ( percent < 0 ) |
188 | percent = cfg.readNumEntry("Volume",50); | 188 | percent = cfg.readNumEntry("Volume",50); |
189 | int fd = 0; | 189 | int fd = 0; |
190 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { | 190 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { |
191 | int vol = muted ? 0 : percent; | 191 | int vol = muted ? 0 : percent; |
192 | // set both channels to same volume | 192 | // set both channels to same volume |
193 | vol |= vol << 8; | 193 | vol |= vol << 8; |
194 | ioctl(fd, MIXER_WRITE(0), &vol); | 194 | ioctl(fd, MIXER_WRITE(0), &vol); |
195 | ::close(fd); | 195 | ::close(fd); |
196 | } | 196 | } |
197 | } break; | 197 | } break; |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | int qpe_sysBrightnessSteps() | 201 | int qpe_sysBrightnessSteps() |
202 | { | 202 | { |
203 | #if defined(QT_QWS_IPAQ) | 203 | #if defined(QT_QWS_IPAQ) |
204 | return 255; | 204 | return 255; |
205 | #elif defined(QT_QWS_EBX) | 205 | #elif defined(QT_QWS_EBX) |
206 | return 4; | 206 | return 4; |
207 | #else | 207 | #else |
208 | return 255; // ? | 208 | return 255; // ? |
209 | #endif | 209 | #endif |
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | static int& hack(int& i) | 213 | static int& hack(int& i) |
214 | { | 214 | { |
215 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 215 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
216 | // These should be created, but aren't in Qt 2.3.0 | 216 | // These should be created, but aren't in Qt 2.3.0 |
217 | (void)new QUtf8Codec; | 217 | (void)new QUtf8Codec; |
218 | (void)new QUtf16Codec; | 218 | (void)new QUtf16Codec; |
219 | #endif | 219 | #endif |
220 | return i; | 220 | return i; |
221 | } | 221 | } |
222 | 222 | ||
223 | static bool forced_off = FALSE; | 223 | static bool forced_off = FALSE; |
224 | static int curbl=-1; | 224 | static int curbl=-1; |
225 | 225 | ||
226 | static int backlight() | 226 | static int backlight() |
227 | { | 227 | { |
228 | if ( curbl == -1 ) { | 228 | if ( curbl == -1 ) { |
229 | // Read from config | 229 | // Read from config |
230 | Config config( "qpe" ); | 230 | Config config( "qpe" ); |
231 | config.setGroup( "Screensaver" ); | 231 | config.setGroup( "Screensaver" ); |
232 | curbl = config.readNumEntry("Brightness",255); | 232 | curbl = config.readNumEntry("Brightness",255); |
233 | } | 233 | } |
234 | return curbl; | 234 | return curbl; |
235 | } | 235 | } |
236 | 236 | ||
237 | static void setBacklight(int bright) | 237 | static void setBacklight(int bright) |
238 | { | 238 | { |
239 | if ( bright == -3 ) { | 239 | if ( bright == -3 ) { |
240 | // Forced on | 240 | // Forced on |
241 | forced_off = FALSE; | 241 | forced_off = FALSE; |
242 | bright = -1; | 242 | bright = -1; |
243 | } | 243 | } |
244 | if ( forced_off && bright != -2 ) | 244 | if ( forced_off && bright != -2 ) |
245 | return; | 245 | return; |
246 | if ( bright == -2 ) { | 246 | if ( bright == -2 ) { |
247 | // Toggle between off and on | 247 | // Toggle between off and on |
248 | bright = curbl ? 0 : -1; | 248 | bright = curbl ? 0 : -1; |
249 | forced_off = !bright; | 249 | forced_off = !bright; |
250 | } | 250 | } |
251 | if ( bright == -1 ) { | 251 | if ( bright == -1 ) { |
252 | // Read from config | 252 | // Read from config |
253 | Config config( "qpe" ); | 253 | Config config( "qpe" ); |
254 | config.setGroup( "Screensaver" ); | 254 | config.setGroup( "Screensaver" ); |
255 | bright = config.readNumEntry("Brightness",255); | 255 | bright = config.readNumEntry("Brightness",255); |
256 | } | 256 | } |
257 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) | 257 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) |
258 | if ( QFile::exists("/usr/bin/bl") ) { | 258 | if ( QFile::exists("/usr/bin/bl") ) { |
259 | QString cmd = "/usr/bin/bl 1 "; | 259 | QString cmd = "/usr/bin/bl 1 "; |
260 | cmd += bright<=0 ? "0 " : "1 "; | 260 | cmd += bright<=0 ? "0 " : "1 "; |
261 | cmd += QString::number(bright); | 261 | cmd += QString::number(bright); |
262 | system(cmd.latin1()); | 262 | system(cmd.latin1()); |
263 | #if defined(QT_QWS_EBX) | 263 | #if defined(QT_QWS_EBX) |
264 | } else if ( QFile::exists("/dev/fl") ) { | 264 | } else if ( QFile::exists("/dev/fl") ) { |
265 | #define FL_IOCTL_STEP_CONTRAST 100 | 265 | #define FL_IOCTL_STEP_CONTRAST 100 |
266 | int fd = open("/dev/fl", O_WRONLY); | 266 | int fd = open("/dev/fl", O_WRONLY); |
267 | if (fd >= 0 ) { | 267 | if (fd >= 0 ) { |
268 | int steps = qpe_sysBrightnessSteps(); | 268 | int steps = qpe_sysBrightnessSteps(); |
269 | int bl = ( bright * steps + 127 ) / 255; | 269 | int bl = ( bright * steps + 127 ) / 255; |
270 | if ( bright && !bl ) bl = 1; | 270 | if ( bright && !bl ) bl = 1; |
271 | bl = ioctl(fd, FL_IOCTL_STEP_CONTRAST, bl); | 271 | bl = ioctl(fd, FL_IOCTL_STEP_CONTRAST, bl); |
272 | close(fd); | 272 | close(fd); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | #elif defined(QT_QWS_IPAQ) | 275 | #elif defined(QT_QWS_IPAQ) |
276 | } else if ( QFile::exists("/dev/ts") || QFile::exists("/dev/h3600_ts") ) { | 276 | } else if ( QFile::exists("/dev/ts") || QFile::exists("/dev/h3600_ts") ) { |
277 | typedef struct { | 277 | typedef struct { |
278 | unsigned char mode; | 278 | unsigned char mode; |
279 | unsigned char pwr; | 279 | unsigned char pwr; |
280 | unsigned char brightness; | 280 | unsigned char brightness; |
281 | } FLITE_IN; | 281 | } FLITE_IN; |
282 | # ifndef FLITE_ON | 282 | # ifndef FLITE_ON |
283 | # ifndef _LINUX_IOCTL_H | 283 | # ifndef _LINUX_IOCTL_H |
284 | # include <linux/ioctl.h> | 284 | # include <linux/ioctl.h> |
285 | # endif | 285 | # endif |
286 | # define FLITE_ON _IOW('f', 7, FLITE_IN) | 286 | # define FLITE_ON _IOW('f', 7, FLITE_IN) |
287 | # endif | 287 | # endif |
288 | int fd; | 288 | int fd; |
289 | if ( QFile::exists("/dev/ts") ) | 289 | if ( QFile::exists("/dev/ts") ) |
290 | fd = open("/dev/ts", O_WRONLY); | 290 | fd = open("/dev/ts", O_WRONLY); |
291 | else | 291 | else |
292 | fd = open("/dev/h3600_ts", O_WRONLY); | 292 | fd = open("/dev/h3600_ts", O_WRONLY); |
293 | if (fd >= 0 ) { | 293 | if (fd >= 0 ) { |
294 | FLITE_IN bl; | 294 | FLITE_IN bl; |
295 | bl.mode = 1; | 295 | bl.mode = 1; |
296 | bl.pwr = bright ? 1 : 0; | 296 | bl.pwr = bright ? 1 : 0; |
297 | bl.brightness = bright; | 297 | bl.brightness = bright; |
298 | ioctl(fd, FLITE_ON, &bl); | 298 | ioctl(fd, FLITE_ON, &bl); |
299 | close(fd); | 299 | close(fd); |
300 | } | 300 | } |
301 | } | 301 | } |
302 | #endif | 302 | #endif |
303 | #endif | 303 | #endif |
304 | curbl = bright; | 304 | curbl = bright; |
305 | } | 305 | } |
306 | 306 | ||
307 | void qpe_setBacklight(int bright) { setBacklight(bright); } | 307 | void qpe_setBacklight(int bright) { setBacklight(bright); } |
308 | 308 | ||
309 | static bool dim_on = FALSE; | 309 | static bool dim_on = FALSE; |
310 | static bool lightoff_on = FALSE; | 310 | static bool lightoff_on = FALSE; |
311 | static int disable_suspend = 100; | 311 | static int disable_suspend = 100; |
312 | 312 | ||
313 | static bool powerOnline() | 313 | static bool powerOnline() |
314 | { | 314 | { |
315 | return PowerStatusManager::readStatus().acStatus() == PowerStatus::Online; | 315 | return PowerStatusManager::readStatus().acStatus() == PowerStatus::Online; |
316 | } | 316 | } |
317 | 317 | ||
318 | static bool networkOnline() | 318 | static bool networkOnline() |
319 | { | 319 | { |
320 | return Network::networkOnline(); | 320 | return Network::networkOnline(); |
321 | } | 321 | } |
322 | 322 | ||
323 | class QPEScreenSaver : public QWSScreenSaver | 323 | class QPEScreenSaver : public QWSScreenSaver |
324 | { | 324 | { |
325 | 325 | ||
326 | public: | 326 | public: |
327 | QPEScreenSaver() | 327 | QPEScreenSaver() |
328 | { | 328 | { |
329 | } | 329 | } |
330 | void restore() | 330 | void restore() |
331 | { | 331 | { |
332 | setBacklight(-1); | 332 | setBacklight(-1); |
333 | } | 333 | } |
334 | bool save(int level) | 334 | bool save(int level) |
335 | { | 335 | { |
336 | switch ( level ) { | 336 | switch ( level ) { |
337 | case 0: | 337 | case 0: |
338 | if ( disable_suspend > 0 && dim_on ) { | 338 | if ( disable_suspend > 0 && dim_on ) { |
339 | if (backlight() > 1) | 339 | if (backlight() > 1) |
340 | setBacklight(1); // lowest non-off | 340 | setBacklight(1); // lowest non-off |
341 | } | 341 | } |
342 | return TRUE; | 342 | return TRUE; |
343 | break; | 343 | break; |
344 | case 1: | 344 | case 1: |
345 | if ( disable_suspend > 1 && lightoff_on ) { | 345 | if ( disable_suspend > 1 && lightoff_on ) { |
346 | setBacklight(0); // off | 346 | setBacklight(0); // off |
347 | } | 347 | } |
348 | return TRUE; | 348 | return TRUE; |
349 | break; | 349 | break; |
350 | case 2: | 350 | case 2: |
351 | if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) { | 351 | if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) { |
352 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); | 352 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); |
353 | return TRUE; | 353 | return TRUE; |
354 | } | 354 | } |
355 | break; | 355 | break; |
356 | } | 356 | } |
357 | return FALSE; | 357 | return FALSE; |
358 | } | 358 | } |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static int ssi(int interval, Config &config, const QString &enable, const QString& value, int def) | 361 | static int ssi(int interval, Config &config, const QString &enable, const QString& value, int def) |
362 | { | 362 | { |
363 | if ( !enable.isEmpty() && config.readNumEntry(enable,0) == 0 ) | 363 | if ( !enable.isEmpty() && config.readNumEntry(enable,0) == 0 ) |
364 | return 0; | 364 | return 0; |
365 | 365 | ||
366 | if ( interval < 0 ) { | 366 | if ( interval < 0 ) { |
367 | // Restore screen blanking and power saving state | 367 | // Restore screen blanking and power saving state |
368 | interval = config.readNumEntry( value, def ); | 368 | interval = config.readNumEntry( value, def ); |
369 | } | 369 | } |
370 | return interval; | 370 | return interval; |
371 | } | 371 | } |
372 | 372 | ||
373 | static void setScreenSaverIntervals(int i1, int i2, int i3) | 373 | static void setScreenSaverIntervals(int i1, int i2, int i3) |
374 | { | 374 | { |
375 | Config config( "qpe" ); | 375 | Config config( "qpe" ); |
376 | config.setGroup( "Screensaver" ); | 376 | config.setGroup( "Screensaver" ); |
377 | 377 | ||
378 | int v[4]; | 378 | int v[4]; |
379 | i1 = ssi(i1, config, "Dim","Interval_Dim", 30); | 379 | i1 = ssi(i1, config, "Dim","Interval_Dim", 30); |
380 | i2 = ssi(i2, config, "LightOff","Interval_LightOff", 20); | 380 | i2 = ssi(i2, config, "LightOff","Interval_LightOff", 20); |
381 | i3 = ssi(i3, config, "","Interval", 60); | 381 | i3 = ssi(i3, config, "","Interval", 60); |
382 | 382 | ||
383 | //qDebug("screen saver intervals: %d %d %d", i1, i2, i3); | 383 | //qDebug("screen saver intervals: %d %d %d", i1, i2, i3); |
384 | 384 | ||
385 | v[0] = QMAX( 1000*i1, 100); | 385 | v[0] = QMAX( 1000*i1, 100); |
386 | v[1] = QMAX( 1000*i2, 100); | 386 | v[1] = QMAX( 1000*i2, 100); |
387 | v[2] = QMAX( 1000*i3, 100); | 387 | v[2] = QMAX( 1000*i3, 100); |
388 | v[3] = 0; | 388 | v[3] = 0; |
389 | dim_on = ( (i1 != 0) ? config.readNumEntry("Dim",1) : FALSE ); | 389 | dim_on = ( (i1 != 0) ? config.readNumEntry("Dim",1) : FALSE ); |
390 | lightoff_on = ( (i2 != 0 ) ? config.readNumEntry("LightOff",1) : FALSE ); | 390 | lightoff_on = ( (i2 != 0 ) ? config.readNumEntry("LightOff",1) : FALSE ); |
391 | if ( !i1 && !i2 && !i3 ) | 391 | if ( !i1 && !i2 && !i3 ) |
392 | QWSServer::setScreenSaverInterval(0); | 392 | QWSServer::setScreenSaverInterval(0); |
393 | else | 393 | else |
394 | QWSServer::setScreenSaverIntervals(v); | 394 | QWSServer::setScreenSaverIntervals(v); |
395 | } | 395 | } |
396 | 396 | ||
397 | static void setScreenSaverInterval(int interval) | 397 | static void setScreenSaverInterval(int interval) |
398 | { | 398 | { |
399 | setScreenSaverIntervals(-1,-1,interval); | 399 | setScreenSaverIntervals(-1,-1,interval); |
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | ||
403 | /*! | 403 | /*! |
404 | \class QPEApplication qpeapplication.h | 404 | \class QPEApplication qpeapplication.h |
405 | \brief The QPEApplication class implements various system services | 405 | \brief The QPEApplication class implements various system services |
406 | that are available to all Qtopia applications. | 406 | that are available to all Qtopia applications. |
407 | 407 | ||
408 | Simply by using QPEApplication instead of QApplication, a plain Qt | 408 | Simply by using QPEApplication instead of QApplication, a plain Qt |
409 | application becomes a Qtopia application. It automatically follows | 409 | application becomes a Qtopia application. It automatically follows |
410 | style changes, quits and raises, and in the | 410 | style changes, quits and raises, and in the |
411 | case of \link docwidget.html document-oriented\endlink applications, | 411 | case of \link docwidget.html document-oriented\endlink applications, |
412 | changes the current displayed document in response to the environment. | 412 | changes the current displayed document in response to the environment. |
413 | */ | 413 | */ |
414 | 414 | ||
415 | /*! | 415 | /*! |
416 | \fn void QPEApplication::clientMoused() | 416 | \fn void QPEApplication::clientMoused() |
417 | 417 | ||
418 | \internal | 418 | \internal |
419 | */ | 419 | */ |
420 | 420 | ||
421 | /*! | 421 | /*! |
422 | \fn void QPEApplication::timeChanged(); | 422 | \fn void QPEApplication::timeChanged(); |
423 | 423 | ||
424 | This signal is emitted when the time jumps forward or backwards | 424 | This signal is emitted when the time jumps forward or backwards |
425 | by more than the normal passage of time. | 425 | by more than the normal passage of time. |
426 | */ | 426 | */ |
427 | 427 | ||
428 | /*! | 428 | /*! |
429 | \fn void QPEApplication::clockChanged( bool ampm ); | 429 | \fn void QPEApplication::clockChanged( bool ampm ); |
430 | 430 | ||
431 | This signal is emitted when the user changes the style | 431 | This signal is emitted when the user changes the style |
432 | of clock. If \a ampm is TRUE, the user wants a 12-hour | 432 | of clock. If \a ampm is TRUE, the user wants a 12-hour |
433 | AM/PM close, otherwise, they want a 24-hour clock. | 433 | AM/PM close, otherwise, they want a 24-hour clock. |
434 | */ | 434 | */ |
435 | 435 | ||
436 | /*! | 436 | /*! |
437 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) | 437 | \fn void QPEApplication::appMessage( const QCString& msg, const QByteArray& data ) |
438 | 438 | ||
439 | This signal is emitted when a message is received on the | 439 | This signal is emitted when a message is received on the |
440 | QPE/Application/<i>appname</i> QCop channel for this application. | 440 | QPE/Application/<i>appname</i> QCop channel for this application. |
441 | 441 | ||
442 | The slot to which you connect this signal uses \a msg and \a data | 442 | The slot to which you connect this signal uses \a msg and \a data |
443 | in the following way: | 443 | in the following way: |
444 | 444 | ||
445 | \code | 445 | \code |
446 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) | 446 | void MyWidget::receive( const QCString& msg, const QByteArray& data ) |
447 | { | 447 | { |
448 | QDataStream stream( data, IO_ReadOnly ); | 448 | QDataStream stream( data, IO_ReadOnly ); |
449 | if ( msg == "someMessage(int,int,int)" ) { | 449 | if ( msg == "someMessage(int,int,int)" ) { |
450 | int a,b,c; | 450 | int a,b,c; |
451 | stream >> a >> b >> c; | 451 | stream >> a >> b >> c; |
452 | ... | 452 | ... |
453 | } else if ( msg == "otherMessage(QString)" ) { | 453 | } else if ( msg == "otherMessage(QString)" ) { |
454 | ... | 454 | ... |
455 | } | 455 | } |
456 | } | 456 | } |
457 | \endcode | 457 | \endcode |
458 | 458 | ||
459 | \sa qcop.html | 459 | \sa qcop.html |
460 | */ | 460 | */ |
461 | 461 | ||
462 | /*! | 462 | /*! |
463 | Constructs a QPEApplication just as you would construct | 463 | Constructs a QPEApplication just as you would construct |
464 | a QApplication, passing \a argc, \a argv, and \a t. | 464 | a QApplication, passing \a argc, \a argv, and \a t. |
465 | */ | 465 | */ |
466 | QPEApplication::QPEApplication( int& argc, char **argv, Type t ) | 466 | QPEApplication::QPEApplication( int& argc, char **argv, Type t ) |
467 | : QApplication( hack(argc), argv, t ) | 467 | : QApplication( hack(argc), argv, t ) |
468 | { | 468 | { |
469 | int dw = desktop()->width(); | 469 | int dw = desktop()->width(); |
470 | if ( dw < 200 ) { | 470 | if ( dw < 200 ) { |
471 | setFont( QFont( "helvetica", 8 ) ); | 471 | setFont( QFont( "helvetica", 8 ) ); |
472 | AppLnk::setSmallIconSize(10); | 472 | AppLnk::setSmallIconSize(10); |
473 | AppLnk::setBigIconSize(28); | 473 | AppLnk::setBigIconSize(28); |
474 | } | 474 | } |
475 | 475 | ||
476 | d = new QPEApplicationData; | 476 | d = new QPEApplicationData; |
477 | QMimeSourceFactory::setDefaultFactory(new ResourceMimeFactory); | 477 | QMimeSourceFactory::setDefaultFactory(new ResourceMimeFactory); |
478 | 478 | ||
479 | connect(this, SIGNAL(lastWindowClosed()), this, SLOT(hideOrQuit())); | 479 | connect(this, SIGNAL(lastWindowClosed()), this, SLOT(hideOrQuit())); |
480 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 480 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
481 | 481 | ||
482 | QString qcopfn("/tmp/qcop-msg-"); | 482 | QString qcopfn("/tmp/qcop-msg-"); |
483 | qcopfn += QString(argv[0]); // append command name | 483 | qcopfn += QString(argv[0]); // append command name |
484 | 484 | ||
485 | QFile f(qcopfn); | 485 | QFile f(qcopfn); |
486 | if ( f.open(IO_ReadOnly) ) { | 486 | if ( f.open(IO_ReadOnly) ) { |
487 | flock(f.handle(), LOCK_EX); | 487 | flock(f.handle(), LOCK_EX); |
488 | } | 488 | } |
489 | 489 | ||
490 | sysChannel = new QCopChannel( "QPE/System", this ); | 490 | sysChannel = new QCopChannel( "QPE/System", this ); |
491 | connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 491 | connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
492 | this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); | 492 | this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); |
493 | 493 | ||
494 | QCString channel = QCString(argv[0]); | 494 | QCString channel = QCString(argv[0]); |
495 | channel.replace(QRegExp(".*/"),""); | 495 | channel.replace(QRegExp(".*/"),""); |
496 | d->appName = channel; | 496 | d->appName = channel; |
497 | channel = "QPE/Application/" + channel; | 497 | channel = "QPE/Application/" + channel; |
498 | pidChannel = new QCopChannel( channel, this); | 498 | pidChannel = new QCopChannel( channel, this); |
499 | connect( pidChannel, SIGNAL(received(const QCString &, const QByteArray &)), | 499 | connect( pidChannel, SIGNAL(received(const QCString &, const QByteArray &)), |
500 | this, SLOT(pidMessage(const QCString &, const QByteArray &))); | 500 | this, SLOT(pidMessage(const QCString &, const QByteArray &))); |
501 | 501 | ||
502 | if ( f.isOpen() ) { | 502 | if ( f.isOpen() ) { |
503 | d->keep_running = FALSE; | 503 | d->keep_running = FALSE; |
504 | QDataStream ds(&f); | 504 | QDataStream ds(&f); |
505 | QCString channel, message; | 505 | QCString channel, message; |
506 | QByteArray data; | 506 | QByteArray data; |
507 | while(!ds.atEnd()) { | 507 | while(!ds.atEnd()) { |
508 | ds >> channel >> message >> data; | 508 | ds >> channel >> message >> data; |
509 | d->enqueueQCop(channel,message,data); | 509 | d->enqueueQCop(channel,message,data); |
510 | } | 510 | } |
511 | 511 | ||
512 | flock(f.handle(), LOCK_UN); | 512 | flock(f.handle(), LOCK_UN); |
513 | f.close(); | 513 | f.close(); |
514 | f.remove(); | 514 | f.remove(); |
515 | } | 515 | } |
516 | 516 | ||
517 | for (int a=0; a<argc; a++) { | 517 | for (int a=0; a<argc; a++) { |
518 | if ( qstrcmp(argv[a],"-preload")==0 ) { | 518 | if ( qstrcmp(argv[a],"-preload")==0 ) { |
519 | argv[a] = argv[a+1]; | 519 | argv[a] = argv[a+1]; |
520 | a++; | 520 | a++; |
521 | d->preloaded = TRUE; | 521 | d->preloaded = TRUE; |
522 | argc-=1; | 522 | argc-=1; |
523 | } else if ( qstrcmp(argv[a],"-preload-show")==0 ) { | 523 | } else if ( qstrcmp(argv[a],"-preload-show")==0 ) { |
524 | argv[a] = argv[a+1]; | 524 | argv[a] = argv[a+1]; |
525 | a++; | 525 | a++; |
526 | d->preloaded = TRUE; | 526 | d->preloaded = TRUE; |
527 | d->forceshow = TRUE; | 527 | d->forceshow = TRUE; |
528 | argc-=1; | 528 | argc-=1; |
529 | } | 529 | } |
530 | } | 530 | } |
531 | 531 | ||
532 | /* overide stored arguments */ | 532 | /* overide stored arguments */ |
533 | setArgs(argc, argv); | 533 | setArgs(argc, argv); |
534 | 534 | ||
535 | #endif | 535 | #endif |
536 | 536 | ||
537 | qwsSetDecoration( new QPEDecoration() ); | 537 | qwsSetDecoration( new QPEDecoration() ); |
538 | 538 | ||
539 | #ifndef QT_NO_TRANSLATION | 539 | #ifndef QT_NO_TRANSLATION |
540 | char *l = getenv( "LANG" ); | 540 | char *l = getenv( "LANG" ); |
541 | QString lang; | 541 | QString lang; |
542 | if ( l ) { | 542 | if ( l ) { |
543 | lang = l; | 543 | lang = l; |
544 | 544 | ||
545 | /* | 545 | /* |
546 | Config config("qpe"); | 546 | Config config("qpe"); |
547 | config.setGroup( "Appearance" ); | 547 | config.setGroup( "Appearance" ); |
548 | lang = config.readEntry( "Language", lang ); | 548 | lang = config.readEntry( "Language", lang ); |
549 | */ | 549 | */ |
550 | 550 | ||
551 | QTranslator * trans = new QTranslator(this); | 551 | QTranslator * trans = new QTranslator(this); |
552 | QString tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm"; | 552 | QString tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm"; |
553 | if ( trans->load( tfn )) | 553 | if ( trans->load( tfn )) |
554 | installTranslator( trans ); | 554 | installTranslator( trans ); |
555 | else | 555 | else |
556 | delete trans; | 556 | delete trans; |
557 | 557 | ||
558 | trans = new QTranslator(this); | 558 | trans = new QTranslator(this); |
559 | tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm"; | 559 | tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm"; |
560 | if ( trans->load( tfn )) | 560 | if ( trans->load( tfn )) |
561 | installTranslator( trans ); | 561 | installTranslator( trans ); |
562 | else | 562 | else |
563 | delete trans; | 563 | delete trans; |
564 | 564 | ||
565 | //###language/font hack; should look it up somewhere | 565 | //###language/font hack; should look it up somewhere |
566 | if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { | 566 | if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { |
567 | QFont fn = FontManager::unicodeFont( FontManager::Proportional ); | 567 | QFont fn = FontManager::unicodeFont( FontManager::Proportional ); |
568 | setFont( fn ); | 568 | setFont( fn ); |
569 | } | 569 | } |
570 | } | 570 | } |
571 | #endif | 571 | #endif |
572 | 572 | ||
573 | applyStyle(); | 573 | applyStyle(); |
574 | 574 | ||
575 | if ( type() == GuiServer ) { | 575 | if ( type() == GuiServer ) { |
576 | setScreenSaverInterval(-1); | 576 | setScreenSaverInterval(-1); |
577 | setVolume(); | 577 | setVolume(); |
578 | QWSServer::setScreenSaver(new QPEScreenSaver); | 578 | QWSServer::setScreenSaver(new QPEScreenSaver); |
579 | } | 579 | } |
580 | 580 | ||
581 | installEventFilter( this ); | 581 | installEventFilter( this ); |
582 | 582 | ||
583 | QPEMenuToolFocusManager::initialize(); | 583 | QPEMenuToolFocusManager::initialize(); |
584 | 584 | ||
585 | #ifdef QT_NO_QWS_CURSOR | 585 | #ifdef QT_NO_QWS_CURSOR |
586 | // if we have no cursor, probably don't want tooltips | 586 | // if we have no cursor, probably don't want tooltips |
587 | QToolTip::setEnabled( FALSE ); | 587 | QToolTip::setEnabled( FALSE ); |
588 | #endif | 588 | #endif |
589 | } | 589 | } |
590 | 590 | ||
591 | static QPtrDict<void>* inputMethodDict=0; | 591 | static QPtrDict<void>* inputMethodDict=0; |
592 | static void createInputMethodDict() | 592 | static void createInputMethodDict() |
593 | { | 593 | { |
594 | if ( !inputMethodDict ) | 594 | if ( !inputMethodDict ) |
595 | inputMethodDict = new QPtrDict<void>; | 595 | inputMethodDict = new QPtrDict<void>; |
596 | } | 596 | } |
597 | 597 | ||
598 | /*! | 598 | /*! |
599 | Returns the currently set hint to the system as to whether | 599 | Returns the currently set hint to the system as to whether |
600 | \a w has any use for text input methods. | 600 | \a w has any use for text input methods. |
601 | 601 | ||
602 | \sa setInputMethodHint() | 602 | \sa setInputMethodHint() |
603 | */ | 603 | */ |
604 | QPEApplication::InputMethodHint QPEApplication::inputMethodHint( QWidget* w ) | 604 | QPEApplication::InputMethodHint QPEApplication::inputMethodHint( QWidget* w ) |
605 | { | 605 | { |
606 | if ( inputMethodDict && w ) | 606 | if ( inputMethodDict && w ) |
607 | return (InputMethodHint)(int)inputMethodDict->find(w); | 607 | return (InputMethodHint)(int)inputMethodDict->find(w); |
608 | return Normal; | 608 | return Normal; |
609 | } | 609 | } |
610 | 610 | ||
611 | /*! | 611 | /*! |
612 | \enum QPEApplication::InputMethodHint | 612 | \enum QPEApplication::InputMethodHint |
613 | 613 | ||
614 | \value Normal the application sometimes needs text input (the default). | 614 | \value Normal the application sometimes needs text input (the default). |
615 | \value AlwaysOff the application never needs text input. | 615 | \value AlwaysOff the application never needs text input. |
616 | \value AlwaysOn the application always needs text input. | 616 | \value AlwaysOn the application always needs text input. |
617 | */ | 617 | */ |
618 | 618 | ||
619 | /*! | 619 | /*! |
620 | Hints to the system that \a w has use for text input methods | 620 | Hints to the system that \a w has use for text input methods |
621 | as specified by \a mode. | 621 | as specified by \a mode. |
622 | 622 | ||
623 | \sa inputMethodHint() | 623 | \sa inputMethodHint() |
624 | */ | 624 | */ |
625 | void QPEApplication::setInputMethodHint( QWidget* w, InputMethodHint mode ) | 625 | void QPEApplication::setInputMethodHint( QWidget* w, InputMethodHint mode ) |
626 | { | 626 | { |
627 | createInputMethodDict(); | 627 | createInputMethodDict(); |
628 | if ( mode == Normal ) { | 628 | if ( mode == Normal ) { |
629 | inputMethodDict->remove(w); | 629 | inputMethodDict->remove(w); |
630 | } else { | 630 | } else { |
631 | inputMethodDict->insert(w,(void*)mode); | 631 | inputMethodDict->insert(w,(void*)mode); |
632 | } | 632 | } |
633 | } | 633 | } |
634 | 634 | ||
635 | class HackDialog : public QDialog | 635 | class HackDialog : public QDialog |
636 | { | 636 | { |
637 | public: | 637 | public: |
638 | void acceptIt() { accept(); } | 638 | void acceptIt() { accept(); } |
639 | void rejectIt() { reject(); } | 639 | void rejectIt() { reject(); } |
640 | }; | 640 | }; |
641 | 641 | ||
642 | 642 | ||
643 | void QPEApplication::mapToDefaultAction( QWSKeyEvent *ke, int key ) | 643 | void QPEApplication::mapToDefaultAction( QWSKeyEvent *ke, int key ) |
644 | { | 644 | { |
645 | // specialised actions for certain widgets. May want to | 645 | // specialised actions for certain widgets. May want to |
646 | // add more stuff here. | 646 | // add more stuff here. |
647 | if ( activePopupWidget() && activePopupWidget()->inherits( "QListBox" ) | 647 | if ( activePopupWidget() && activePopupWidget()->inherits( "QListBox" ) |
648 | && activePopupWidget()->parentWidget() | 648 | && activePopupWidget()->parentWidget() |
649 | && activePopupWidget()->parentWidget()->inherits( "QComboBox" ) ) | 649 | && activePopupWidget()->parentWidget()->inherits( "QComboBox" ) ) |
650 | key = Qt::Key_Return; | 650 | key = Qt::Key_Return; |
651 | 651 | ||
652 | if ( activePopupWidget() && activePopupWidget()->inherits( "QPopupMenu" ) ) | 652 | if ( activePopupWidget() && activePopupWidget()->inherits( "QPopupMenu" ) ) |
653 | key = Qt::Key_Return; | 653 | key = Qt::Key_Return; |
654 | 654 | ||
655 | ke->simpleData.keycode = key; | 655 | ke->simpleData.keycode = key; |
656 | } | 656 | } |
657 | 657 | ||
658 | class HackWidget : public QWidget | 658 | class HackWidget : public QWidget |
659 | { | 659 | { |
660 | public: | 660 | public: |
661 | bool needsOk() | 661 | bool needsOk() |
662 | { return (getWState() & WState_Reserved1 ); } | 662 | { return (getWState() & WState_Reserved1 ); } |
663 | }; | 663 | }; |
664 | 664 | ||
665 | /*! | 665 | /*! |
666 | \internal | 666 | \internal |
667 | */ | 667 | */ |
668 | bool QPEApplication::qwsEventFilter( QWSEvent *e ) | 668 | bool QPEApplication::qwsEventFilter( QWSEvent *e ) |
669 | { | 669 | { |
670 | if ( !d->notbusysent && e->type == QWSEvent::Focus ) { | 670 | if ( !d->notbusysent && e->type == QWSEvent::Focus ) { |
671 | if ( qApp->type() != QApplication::GuiServer ) { | 671 | if ( qApp->type() != QApplication::GuiServer ) { |
672 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); | 672 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); |
673 | e << d->appName; | 673 | e << d->appName; |
674 | } | 674 | } |
675 | d->notbusysent=TRUE; | 675 | d->notbusysent=TRUE; |
676 | } | 676 | } |
677 | if ( type() == GuiServer ) { | 677 | if ( type() == GuiServer ) { |
678 | switch ( e->type ) { | 678 | switch ( e->type ) { |
679 | case QWSEvent::Mouse: | 679 | case QWSEvent::Mouse: |
680 | if ( e->asMouse()->simpleData.state && !QWidget::find(e->window()) ) | 680 | if ( e->asMouse()->simpleData.state && !QWidget::find(e->window()) ) |
681 | emit clientMoused(); | 681 | emit clientMoused(); |
682 | } | 682 | } |
683 | } | 683 | } |
684 | if ( e->type == QWSEvent::Key ) { | 684 | if ( e->type == QWSEvent::Key ) { |
685 | if ( d->kbgrabber == 1 ) | 685 | if ( d->kbgrabber == 1 ) |
686 | return TRUE; | 686 | return TRUE; |
687 | QWSKeyEvent *ke = (QWSKeyEvent *)e; | 687 | QWSKeyEvent *ke = (QWSKeyEvent *)e; |
688 | if ( ke->simpleData.keycode == Qt::Key_F33 ) { | 688 | if ( ke->simpleData.keycode == Qt::Key_F33 ) { |
689 | // Use special "OK" key to press "OK" on top level widgets | 689 | // Use special "OK" key to press "OK" on top level widgets |
690 | QWidget *active = activeWindow(); | 690 | QWidget *active = activeWindow(); |
691 | QWidget *popup = 0; | 691 | QWidget *popup = 0; |
692 | if ( active && active->isPopup() ) { | 692 | if ( active && active->isPopup() ) { |
693 | popup = active; | 693 | popup = active; |
694 | active = active->parentWidget(); | 694 | active = active->parentWidget(); |
695 | } | 695 | } |
696 | if ( active && (int)active->winId() == ke->simpleData.window && | 696 | if ( active && (int)active->winId() == ke->simpleData.window && |
697 | !active->testWFlags( WStyle_Customize|WType_Popup|WType_Desktop )) { | 697 | !active->testWFlags( WStyle_Customize|WType_Popup|WType_Desktop )) { |
698 | if ( ke->simpleData.is_press ) { | 698 | if ( ke->simpleData.is_press ) { |
699 | if ( popup ) | 699 | if ( popup ) |
700 | popup->close(); | 700 | popup->close(); |
701 | if ( active->inherits( "QDialog" ) ) { | 701 | if ( active->inherits( "QDialog" ) ) { |
702 | HackDialog *d = (HackDialog *)active; | 702 | HackDialog *d = (HackDialog *)active; |
703 | d->acceptIt(); | 703 | d->acceptIt(); |
704 | return TRUE; | 704 | return TRUE; |
705 | } else if ( ((HackWidget *)active)->needsOk() ) { | 705 | } else if ( ((HackWidget *)active)->needsOk() ) { |
706 | QSignal s; | 706 | QSignal s; |
707 | s.connect( active, SLOT( accept() ) ); | 707 | s.connect( active, SLOT( accept() ) ); |
708 | s.activate(); | 708 | s.activate(); |
709 | } else { | 709 | } else { |
710 | // do the same as with the select key: Map to the default action of the widget: | 710 | // do the same as with the select key: Map to the default action of the widget: |
711 | mapToDefaultAction( ke, Qt::Key_Return ); | 711 | mapToDefaultAction( ke, Qt::Key_Return ); |
712 | } | 712 | } |
713 | } | 713 | } |
714 | } | 714 | } |
715 | } else if ( ke->simpleData.keycode == Qt::Key_F30 ) { | 715 | } else if ( ke->simpleData.keycode == Qt::Key_F30 ) { |
716 | // Use special "select" key to do whatever default action a widget has | 716 | // Use special "select" key to do whatever default action a widget has |
717 | mapToDefaultAction( ke, Qt::Key_Space ); | 717 | mapToDefaultAction( ke, Qt::Key_Space ); |
718 | } else if ( ke->simpleData.keycode == Qt::Key_Escape && | 718 | } else if ( ke->simpleData.keycode == Qt::Key_Escape && |
719 | ke->simpleData.is_press ) { | 719 | ke->simpleData.is_press ) { |
720 | // Escape key closes app if focus on toplevel | 720 | // Escape key closes app if focus on toplevel |
721 | QWidget *active = activeWindow(); | 721 | QWidget *active = activeWindow(); |
722 | if ( active && active->testWFlags( WType_TopLevel ) && | 722 | if ( active && active->testWFlags( WType_TopLevel ) && |
723 | (int)active->winId() == ke->simpleData.window && | 723 | (int)active->winId() == ke->simpleData.window && |
724 | !active->testWFlags( WStyle_Dialog|WStyle_Customize|WType_Popup|WType_Desktop )) { | 724 | !active->testWFlags( WStyle_Dialog|WStyle_Customize|WType_Popup|WType_Desktop )) { |
725 | if ( active->inherits( "QDialog" ) ) { | 725 | if ( active->inherits( "QDialog" ) ) { |
726 | HackDialog *d = (HackDialog *)active; | 726 | HackDialog *d = (HackDialog *)active; |
727 | d->rejectIt(); | 727 | d->rejectIt(); |
728 | return TRUE; | 728 | return TRUE; |
729 | } else if ( strcmp( argv()[0], "embeddedkonsole") != 0 ) { | 729 | } else if ( strcmp( argv()[0], "embeddedkonsole") != 0 ) { |
730 | active->close(); | 730 | active->close(); |
731 | } | 731 | } |
732 | } | 732 | } |
733 | } | 733 | } |
734 | 734 | ||
735 | #if QT_VERSION < 231 | 735 | #if QT_VERSION < 231 |
736 | // Filter out the F4/Launcher key from apps | 736 | // Filter out the F4/Launcher key from apps |
737 | // ### The launcher key may not always be F4 on all devices | 737 | // ### The launcher key may not always be F4 on all devices |
738 | if ( ((QWSKeyEvent *)e)->simpleData.keycode == Qt::Key_F4 ) | 738 | if ( ((QWSKeyEvent *)e)->simpleData.keycode == Qt::Key_F4 ) |
739 | return TRUE; | 739 | return TRUE; |
740 | #endif | 740 | #endif |
741 | } | 741 | } |
742 | if ( e->type == QWSEvent::Focus ) { | 742 | if ( e->type == QWSEvent::Focus ) { |
743 | QWSFocusEvent *fe = (QWSFocusEvent*)e; | 743 | QWSFocusEvent *fe = (QWSFocusEvent*)e; |
744 | QWidget* nfw = QWidget::find(e->window()); | 744 | QWidget* nfw = QWidget::find(e->window()); |
745 | if ( !fe->simpleData.get_focus ) { | 745 | if ( !fe->simpleData.get_focus ) { |
746 | QWidget *active = activeWindow(); | 746 | QWidget *active = activeWindow(); |
747 | while ( active && active->isPopup() ) { | 747 | while ( active && active->isPopup() ) { |
748 | active->close(); | 748 | active->close(); |
749 | active = activeWindow(); | 749 | active = activeWindow(); |
750 | } | 750 | } |
751 | if ( !nfw && d->kbgrabber == 2 ) { | 751 | if ( !nfw && d->kbgrabber == 2 ) { |
752 | ungrabKeyboard(); | 752 | ungrabKeyboard(); |
753 | d->kbregrab = TRUE; // want kb back when we're active | 753 | d->kbregrab = TRUE; // want kb back when we're active |
754 | } | 754 | } |
755 | } else { | 755 | } else { |
756 | // make sure our modal widget is ALWAYS on top | 756 | // make sure our modal widget is ALWAYS on top |
757 | QWidget *topm = activeModalWidget(); | 757 | QWidget *topm = activeModalWidget(); |
758 | if ( topm ) { | 758 | if ( topm ) { |
759 | topm->raise(); | 759 | topm->raise(); |
760 | } | 760 | } |
761 | if ( d->kbregrab ) { | 761 | if ( d->kbregrab ) { |
762 | grabKeyboard(); | 762 | grabKeyboard(); |
763 | d->kbregrab = FALSE; | 763 | d->kbregrab = FALSE; |
764 | } | 764 | } |
765 | } | 765 | } |
766 | if ( fe->simpleData.get_focus && inputMethodDict ) { | 766 | if ( fe->simpleData.get_focus && inputMethodDict ) { |
767 | InputMethodHint m = inputMethodHint( QWidget::find(e->window()) ); | 767 | InputMethodHint m = inputMethodHint( QWidget::find(e->window()) ); |
768 | if ( m == AlwaysOff ) | 768 | if ( m == AlwaysOff ) |
769 | Global::hideInputMethod(); | 769 | Global::hideInputMethod(); |
770 | if ( m == AlwaysOn ) | 770 | if ( m == AlwaysOn ) |
771 | Global::showInputMethod(); | 771 | Global::showInputMethod(); |
772 | } | 772 | } |
773 | } | 773 | } |
774 | return QApplication::qwsEventFilter( e ); | 774 | return QApplication::qwsEventFilter( e ); |
775 | } | 775 | } |
776 | 776 | ||
777 | /*! | 777 | /*! |
778 | Destroys the QPEApplication. | 778 | Destroys the QPEApplication. |
779 | */ | 779 | */ |
780 | QPEApplication::~QPEApplication() | 780 | QPEApplication::~QPEApplication() |
781 | { | 781 | { |
782 | ungrabKeyboard(); | 782 | ungrabKeyboard(); |
783 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 783 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
784 | // Need to delete QCopChannels early, since the display will | 784 | // Need to delete QCopChannels early, since the display will |
785 | // be gone by the time we get to ~QObject(). | 785 | // be gone by the time we get to ~QObject(). |
786 | delete sysChannel; | 786 | delete sysChannel; |
787 | delete pidChannel; | 787 | delete pidChannel; |
788 | #endif | 788 | #endif |
789 | delete d; | 789 | delete d; |
790 | } | 790 | } |
791 | 791 | ||
792 | /*! | 792 | /*! |
793 | Returns <tt>$QPEDIR/</tt>. | 793 | Returns <tt>$OPIEDIR/</tt>. |
794 | */ | 794 | */ |
795 | QString QPEApplication::qpeDir() | 795 | QString QPEApplication::qpeDir() |
796 | { | 796 | { |
797 | const char *base = getenv( "QPEDIR" ); | 797 | const char *base = getenv( "OPIEDIR" ); |
798 | if ( base ) | 798 | if ( base ) |
799 | return QString( base ) + "/"; | 799 | return QString( base ) + "/"; |
800 | 800 | ||
801 | return QString( "../" ); | 801 | return QString( "../" ); |
802 | } | 802 | } |
803 | 803 | ||
804 | /*! | 804 | /*! |
805 | Returns the user's current Document directory. There is a trailing "/". | 805 | Returns the user's current Document directory. There is a trailing "/". |
806 | */ | 806 | */ |
807 | QString QPEApplication::documentDir() | 807 | QString QPEApplication::documentDir() |
808 | { | 808 | { |
809 | const char *base = getenv( "HOME" ); | 809 | const char *base = getenv( "HOME" ); |
810 | if ( base ) | 810 | if ( base ) |
811 | return QString( base ) + "/Documents/"; | 811 | return QString( base ) + "/Documents/"; |
812 | 812 | ||
813 | return QString( "../Documents/" ); | 813 | return QString( "../Documents/" ); |
814 | } | 814 | } |
815 | 815 | ||
816 | static int deforient=-1; | 816 | static int deforient=-1; |
817 | 817 | ||
818 | /*! | 818 | /*! |
819 | \internal | 819 | \internal |
820 | */ | 820 | */ |
821 | int QPEApplication::defaultRotation() | 821 | int QPEApplication::defaultRotation() |
822 | { | 822 | { |
823 | if ( deforient < 0 ) { | 823 | if ( deforient < 0 ) { |
824 | QString d = getenv("QWS_DISPLAY"); | 824 | QString d = getenv("QWS_DISPLAY"); |
825 | if ( d.contains("Rot90") ) { | 825 | if ( d.contains("Rot90") ) { |
826 | deforient = 90; | 826 | deforient = 90; |
827 | } else if ( d.contains("Rot180") ) { | 827 | } else if ( d.contains("Rot180") ) { |
828 | deforient = 180; | 828 | deforient = 180; |
829 | } else if ( d.contains("Rot270") ) { | 829 | } else if ( d.contains("Rot270") ) { |
830 | deforient = 270; | 830 | deforient = 270; |
831 | } else { | 831 | } else { |
832 | deforient=0; | 832 | deforient=0; |
833 | } | 833 | } |
834 | } | 834 | } |
835 | return deforient; | 835 | return deforient; |
836 | } | 836 | } |
837 | 837 | ||
838 | /*! | 838 | /*! |
839 | \internal | 839 | \internal |
840 | */ | 840 | */ |
841 | void QPEApplication::setDefaultRotation(int r) | 841 | void QPEApplication::setDefaultRotation(int r) |
842 | { | 842 | { |
843 | if ( qApp->type() == GuiServer ) { | 843 | if ( qApp->type() == GuiServer ) { |
844 | deforient = r; | 844 | deforient = r; |
845 | setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(r).latin1(), 1); | 845 | setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(r).latin1(), 1); |
846 | } else { | 846 | } else { |
847 | QCopEnvelope("QPE/System", "setDefaultRotation(int)") << r; | 847 | QCopEnvelope("QPE/System", "setDefaultRotation(int)") << r; |
848 | } | 848 | } |
849 | } | 849 | } |
850 | 850 | ||
851 | /*! | 851 | /*! |
852 | \internal | 852 | \internal |
853 | */ | 853 | */ |
854 | void QPEApplication::applyStyle() | 854 | void QPEApplication::applyStyle() |
855 | { | 855 | { |
856 | Config config( "qpe" ); | 856 | Config config( "qpe" ); |
857 | 857 | ||
858 | config.setGroup( "Appearance" ); | 858 | config.setGroup( "Appearance" ); |
859 | 859 | ||
860 | // Widget style | 860 | // Widget style |
861 | QString style = config.readEntry( "Style", "Light" ); | 861 | QString style = config.readEntry( "Style", "Light" ); |
862 | internalSetStyle( style ); | 862 | internalSetStyle( style ); |
863 | 863 | ||
864 | // Colors | 864 | // Colors |
865 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); | 865 | QColor bgcolor( config.readEntry( "Background", "#E5E1D5" ) ); |
866 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); | 866 | QColor btncolor( config.readEntry( "Button", "#D6CDBB" ) ); |
867 | QPalette pal( btncolor, bgcolor ); | 867 | QPalette pal( btncolor, bgcolor ); |
868 | QString color = config.readEntry( "Highlight", "#800000" ); | 868 | QString color = config.readEntry( "Highlight", "#800000" ); |
869 | pal.setColor( QColorGroup::Highlight, QColor(color) ); | 869 | pal.setColor( QColorGroup::Highlight, QColor(color) ); |
870 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 870 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
871 | pal.setColor( QColorGroup::HighlightedText, QColor(color) ); | 871 | pal.setColor( QColorGroup::HighlightedText, QColor(color) ); |
872 | color = config.readEntry( "Text", "#000000" ); | 872 | color = config.readEntry( "Text", "#000000" ); |
873 | pal.setColor( QColorGroup::Text, QColor(color) ); | 873 | pal.setColor( QColorGroup::Text, QColor(color) ); |
874 | color = config.readEntry( "ButtonText", "#000000" ); | 874 | color = config.readEntry( "ButtonText", "#000000" ); |
875 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor(color) ); | 875 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor(color) ); |
876 | color = config.readEntry( "Base", "#FFFFFF" ); | 876 | color = config.readEntry( "Base", "#FFFFFF" ); |
877 | pal.setColor( QColorGroup::Base, QColor(color) ); | 877 | pal.setColor( QColorGroup::Base, QColor(color) ); |
878 | 878 | ||
879 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 879 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
880 | pal.color(QPalette::Active, QColorGroup::Background).dark() ); | 880 | pal.color(QPalette::Active, QColorGroup::Background).dark() ); |
881 | 881 | ||
882 | setPalette( pal, TRUE ); | 882 | setPalette( pal, TRUE ); |
883 | } | 883 | } |
884 | 884 | ||
885 | void QPEApplication::systemMessage( const QCString &msg, const QByteArray &data) | 885 | void QPEApplication::systemMessage( const QCString &msg, const QByteArray &data) |
886 | { | 886 | { |
887 | #ifdef Q_WS_QWS | 887 | #ifdef Q_WS_QWS |
888 | QDataStream stream( data, IO_ReadOnly ); | 888 | QDataStream stream( data, IO_ReadOnly ); |
889 | if ( msg == "applyStyle()" ) { | 889 | if ( msg == "applyStyle()" ) { |
890 | applyStyle(); | 890 | applyStyle(); |
891 | } else if ( msg == "setScreenSaverInterval(int)" ) { | 891 | } else if ( msg == "setScreenSaverInterval(int)" ) { |
892 | if ( type() == GuiServer ) { | 892 | if ( type() == GuiServer ) { |
893 | int time; | 893 | int time; |
894 | stream >> time; | 894 | stream >> time; |
895 | setScreenSaverInterval(time); | 895 | setScreenSaverInterval(time); |
896 | } | 896 | } |
897 | } else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { | 897 | } else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { |
898 | if ( type() == GuiServer ) { | 898 | if ( type() == GuiServer ) { |
899 | int t1,t2,t3; | 899 | int t1,t2,t3; |
900 | stream >> t1 >> t2 >> t3; | 900 | stream >> t1 >> t2 >> t3; |
901 | setScreenSaverIntervals(t1,t2,t3); | 901 | setScreenSaverIntervals(t1,t2,t3); |
902 | } | 902 | } |
903 | } else if ( msg == "setBacklight(int)" ) { | 903 | } else if ( msg == "setBacklight(int)" ) { |
904 | if ( type() == GuiServer ) { | 904 | if ( type() == GuiServer ) { |
905 | int bright; | 905 | int bright; |
906 | stream >> bright; | 906 | stream >> bright; |
907 | setBacklight(bright); | 907 | setBacklight(bright); |
908 | } | 908 | } |
909 | } else if ( msg == "setDefaultRotation(int)" ) { | 909 | } else if ( msg == "setDefaultRotation(int)" ) { |
910 | if ( type() == GuiServer ) { | 910 | if ( type() == GuiServer ) { |
911 | int r; | 911 | int r; |
912 | stream >> r; | 912 | stream >> r; |
913 | setDefaultRotation(r); | 913 | setDefaultRotation(r); |
914 | } | 914 | } |
915 | } else if ( msg == "shutdown()" ) { | 915 | } else if ( msg == "shutdown()" ) { |
916 | if ( type() == GuiServer ) | 916 | if ( type() == GuiServer ) |
917 | shutdown(); | 917 | shutdown(); |
918 | } else if ( msg == "quit()" ) { | 918 | } else if ( msg == "quit()" ) { |
919 | if ( type() != GuiServer ) | 919 | if ( type() != GuiServer ) |
920 | tryQuit(); | 920 | tryQuit(); |
921 | } else if ( msg == "forceQuit()" ) { | 921 | } else if ( msg == "forceQuit()" ) { |
922 | if ( type() != GuiServer ) | 922 | if ( type() != GuiServer ) |
923 | quit(); | 923 | quit(); |
924 | } else if ( msg == "restart()" ) { | 924 | } else if ( msg == "restart()" ) { |
925 | if ( type() == GuiServer ) | 925 | if ( type() == GuiServer ) |
926 | restart(); | 926 | restart(); |
927 | } else if ( msg == "grabKeyboard(QString)" ) { | 927 | } else if ( msg == "grabKeyboard(QString)" ) { |
928 | QString who; | 928 | QString who; |
929 | stream >> who; | 929 | stream >> who; |
930 | if ( who.isEmpty() ) | 930 | if ( who.isEmpty() ) |
931 | d->kbgrabber = 0; | 931 | d->kbgrabber = 0; |
932 | else if ( who != d->appName ) | 932 | else if ( who != d->appName ) |
933 | d->kbgrabber = 1; | 933 | d->kbgrabber = 1; |
934 | else | 934 | else |
935 | d->kbgrabber = 2; | 935 | d->kbgrabber = 2; |
936 | } else if ( msg == "language(QString)" ) { | 936 | } else if ( msg == "language(QString)" ) { |
937 | if ( type() == GuiServer ) { | 937 | if ( type() == GuiServer ) { |
938 | QString l; | 938 | QString l; |
939 | stream >> l; | 939 | stream >> l; |
940 | QString cl = getenv("LANG"); | 940 | QString cl = getenv("LANG"); |
941 | if ( cl != l ) { | 941 | if ( cl != l ) { |
942 | if ( l.isNull() ) | 942 | if ( l.isNull() ) |
943 | unsetenv( "LANG" ); | 943 | unsetenv( "LANG" ); |
944 | else | 944 | else |
945 | setenv( "LANG", l.latin1(), 1 ); | 945 | setenv( "LANG", l.latin1(), 1 ); |
946 | restart(); | 946 | restart(); |
947 | } | 947 | } |
948 | } | 948 | } |
949 | } else if ( msg == "timeChange(QString)" ) { | 949 | } else if ( msg == "timeChange(QString)" ) { |
950 | QString t; | 950 | QString t; |
951 | stream >> t; | 951 | stream >> t; |
952 | if ( t.isNull() ) | 952 | if ( t.isNull() ) |
953 | unsetenv( "TZ" ); | 953 | unsetenv( "TZ" ); |
954 | else | 954 | else |
955 | setenv( "TZ", t.latin1(), 1 ); | 955 | setenv( "TZ", t.latin1(), 1 ); |
956 | // emit the signal so everyone else knows... | 956 | // emit the signal so everyone else knows... |
957 | emit timeChanged(); | 957 | emit timeChanged(); |
958 | } else if ( msg == "execute(QString)" ) { | 958 | } else if ( msg == "execute(QString)" ) { |
959 | if ( type() == GuiServer ) { | 959 | if ( type() == GuiServer ) { |
960 | QString t; | 960 | QString t; |
961 | stream >> t; | 961 | stream >> t; |
962 | Global::execute( t ); | 962 | Global::execute( t ); |
963 | } | 963 | } |
964 | } else if ( msg == "execute(QString,QString)" ) { | 964 | } else if ( msg == "execute(QString,QString)" ) { |
965 | if ( type() == GuiServer ) { | 965 | if ( type() == GuiServer ) { |
966 | QString t,d; | 966 | QString t,d; |
967 | stream >> t >> d; | 967 | stream >> t >> d; |
968 | Global::execute( t, d ); | 968 | Global::execute( t, d ); |
969 | } | 969 | } |
970 | } else if ( msg == "addAlarm(QDateTime,QCString,QCString,int)" ) { | 970 | } else if ( msg == "addAlarm(QDateTime,QCString,QCString,int)" ) { |
971 | if ( type() == GuiServer ) { | 971 | if ( type() == GuiServer ) { |
972 | QDateTime when; | 972 | QDateTime when; |
973 | QCString channel, message; | 973 | QCString channel, message; |
974 | int data; | 974 | int data; |
975 | stream >> when >> channel >> message >> data; | 975 | stream >> when >> channel >> message >> data; |
976 | AlarmServer::addAlarm( when, channel, message, data ); | 976 | AlarmServer::addAlarm( when, channel, message, data ); |
977 | } | 977 | } |
978 | } else if ( msg == "deleteAlarm(QDateTime,QCString,QCString,int)" ) { | 978 | } else if ( msg == "deleteAlarm(QDateTime,QCString,QCString,int)" ) { |
979 | if ( type() == GuiServer ) { | 979 | if ( type() == GuiServer ) { |
980 | QDateTime when; | 980 | QDateTime when; |
981 | QCString channel, message; | 981 | QCString channel, message; |
982 | int data; | 982 | int data; |
983 | stream >> when >> channel >> message >> data; | 983 | stream >> when >> channel >> message >> data; |
984 | AlarmServer::deleteAlarm( when, channel, message, data ); | 984 | AlarmServer::deleteAlarm( when, channel, message, data ); |
985 | } | 985 | } |
986 | } else if ( msg == "clockChange(bool)" ) { | 986 | } else if ( msg == "clockChange(bool)" ) { |
987 | int tmp; | 987 | int tmp; |
988 | stream >> tmp; | 988 | stream >> tmp; |
989 | emit clockChanged( tmp ); | 989 | emit clockChanged( tmp ); |
990 | } else if ( msg == "weekChange(bool)" ) { | 990 | } else if ( msg == "weekChange(bool)" ) { |
991 | int tmp; | 991 | int tmp; |
992 | stream >> tmp; | 992 | stream >> tmp; |
993 | emit weekChanged( tmp ); | 993 | emit weekChanged( tmp ); |
994 | } else if ( msg == "setDateFormat(DateFormat)" ) { | 994 | } else if ( msg == "setDateFormat(DateFormat)" ) { |
995 | DateFormat tmp; | 995 | DateFormat tmp; |
996 | stream >> tmp; | 996 | stream >> tmp; |
997 | emit dateFormatChanged( tmp ); | 997 | emit dateFormatChanged( tmp ); |
998 | } else if ( msg == "setVolume(int,int)" ) { | 998 | } else if ( msg == "setVolume(int,int)" ) { |
999 | int t,v; | 999 | int t,v; |
1000 | stream >> t >> v; | 1000 | stream >> t >> v; |
1001 | setVolume(t,v); | 1001 | setVolume(t,v); |
1002 | emit volumeChanged( muted ); | 1002 | emit volumeChanged( muted ); |
1003 | } else if ( msg == "volumeChange(bool)" ) { | 1003 | } else if ( msg == "volumeChange(bool)" ) { |
1004 | stream >> muted; | 1004 | stream >> muted; |
1005 | setVolume(); | 1005 | setVolume(); |
1006 | emit volumeChanged( muted ); | 1006 | emit volumeChanged( muted ); |
1007 | } else if ( msg == "setScreenSaverMode(int)" ) { | 1007 | } else if ( msg == "setScreenSaverMode(int)" ) { |
1008 | if ( type() == GuiServer ) { | 1008 | if ( type() == GuiServer ) { |
1009 | int old = disable_suspend; | 1009 | int old = disable_suspend; |
1010 | stream >> disable_suspend; | 1010 | stream >> disable_suspend; |
1011 | //qDebug("setScreenSaverMode(%d)", disable_suspend ); | 1011 | //qDebug("setScreenSaverMode(%d)", disable_suspend ); |
1012 | if ( disable_suspend > old ) | 1012 | if ( disable_suspend > old ) |
1013 | setScreenSaverInterval( -1 ); | 1013 | setScreenSaverInterval( -1 ); |
1014 | } | 1014 | } |
1015 | } | 1015 | } |
1016 | #endif | 1016 | #endif |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | /*! | 1019 | /*! |
1020 | \internal | 1020 | \internal |
1021 | */ | 1021 | */ |
1022 | bool QPEApplication::raiseAppropriateWindow() | 1022 | bool QPEApplication::raiseAppropriateWindow() |
1023 | { | 1023 | { |
1024 | bool r=FALSE; | 1024 | bool r=FALSE; |
1025 | // ########## raise()ing main window should raise and set active | 1025 | // ########## raise()ing main window should raise and set active |
1026 | // ########## it and then all childen. This belongs in Qt/Embedded | 1026 | // ########## it and then all childen. This belongs in Qt/Embedded |
1027 | QWidget *top = d->qpe_main_widget; | 1027 | QWidget *top = d->qpe_main_widget; |
1028 | if ( !top ) top =mainWidget(); | 1028 | if ( !top ) top =mainWidget(); |
1029 | if ( top && d->keep_running ) { | 1029 | if ( top && d->keep_running ) { |
1030 | if ( top->isVisible() ) | 1030 | if ( top->isVisible() ) |
1031 | r = TRUE; | 1031 | r = TRUE; |
1032 | #ifdef Q_WS_QWS | 1032 | #ifdef Q_WS_QWS |
1033 | if ( !d->nomaximize ) | 1033 | if ( !d->nomaximize ) |
1034 | top->showMaximized(); | 1034 | top->showMaximized(); |
1035 | else | 1035 | else |
1036 | #endif | 1036 | #endif |
1037 | top->show(); | 1037 | top->show(); |
1038 | top->raise(); | 1038 | top->raise(); |
1039 | top->setActiveWindow(); | 1039 | top->setActiveWindow(); |
1040 | } | 1040 | } |
1041 | QWidget *topm = activeModalWidget(); | 1041 | QWidget *topm = activeModalWidget(); |
1042 | if ( topm && topm != top ) { | 1042 | if ( topm && topm != top ) { |
1043 | topm->show(); | 1043 | topm->show(); |
1044 | topm->raise(); | 1044 | topm->raise(); |
1045 | topm->setActiveWindow(); | 1045 | topm->setActiveWindow(); |
1046 | r = FALSE; | 1046 | r = FALSE; |
1047 | } | 1047 | } |
1048 | return r; | 1048 | return r; |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | void QPEApplication::pidMessage( const QCString &msg, const QByteArray & data) | 1051 | void QPEApplication::pidMessage( const QCString &msg, const QByteArray & data) |
1052 | { | 1052 | { |
1053 | #ifdef Q_WS_QWS | 1053 | #ifdef Q_WS_QWS |
1054 | 1054 | ||
1055 | if ( msg == "quit()" ) { | 1055 | if ( msg == "quit()" ) { |
1056 | tryQuit(); | 1056 | tryQuit(); |
1057 | } else if ( msg == "quitIfInvisible()" ) { | 1057 | } else if ( msg == "quitIfInvisible()" ) { |
1058 | if ( d->qpe_main_widget && !d->qpe_main_widget->isVisible() ) | 1058 | if ( d->qpe_main_widget && !d->qpe_main_widget->isVisible() ) |
1059 | quit(); | 1059 | quit(); |
1060 | } else if ( msg == "close()" ) { | 1060 | } else if ( msg == "close()" ) { |
1061 | hideOrQuit(); | 1061 | hideOrQuit(); |
1062 | } else if ( msg == "disablePreload()" ) { | 1062 | } else if ( msg == "disablePreload()" ) { |
1063 | d->preloaded = FALSE; | 1063 | d->preloaded = FALSE; |
1064 | d->keep_running = TRUE; | 1064 | d->keep_running = TRUE; |
1065 | /* so that quit will quit */ | 1065 | /* so that quit will quit */ |
1066 | } else if ( msg == "enablePreload()" ) { | 1066 | } else if ( msg == "enablePreload()" ) { |
1067 | d->preloaded = TRUE; | 1067 | d->preloaded = TRUE; |
1068 | d->keep_running = TRUE; | 1068 | d->keep_running = TRUE; |
1069 | /* so next quit won't quit */ | 1069 | /* so next quit won't quit */ |
1070 | } else if ( msg == "raise()" ) { | 1070 | } else if ( msg == "raise()" ) { |
1071 | d->keep_running = TRUE; | 1071 | d->keep_running = TRUE; |
1072 | d->notbusysent = FALSE; | 1072 | d->notbusysent = FALSE; |
1073 | raiseAppropriateWindow(); | 1073 | raiseAppropriateWindow(); |
1074 | } else if ( msg == "flush()" ) { | 1074 | } else if ( msg == "flush()" ) { |
1075 | emit flush(); | 1075 | emit flush(); |
1076 | // we need to tell the desktop | 1076 | // we need to tell the desktop |
1077 | QCopEnvelope e( "QPE/Desktop", "flushDone(QString)" ); | 1077 | QCopEnvelope e( "QPE/Desktop", "flushDone(QString)" ); |
1078 | e << d->appName; | 1078 | e << d->appName; |
1079 | } else if ( msg == "reload()" ) { | 1079 | } else if ( msg == "reload()" ) { |
1080 | emit reload(); | 1080 | emit reload(); |
1081 | } else if ( msg == "setDocument(QString)" ) { | 1081 | } else if ( msg == "setDocument(QString)" ) { |
1082 | d->keep_running = TRUE; | 1082 | d->keep_running = TRUE; |
1083 | QDataStream stream( data, IO_ReadOnly ); | 1083 | QDataStream stream( data, IO_ReadOnly ); |
1084 | QString doc; | 1084 | QString doc; |
1085 | stream >> doc; | 1085 | stream >> doc; |
1086 | QWidget *mw = mainWidget(); | 1086 | QWidget *mw = mainWidget(); |
1087 | if ( !mw ) | 1087 | if ( !mw ) |
1088 | mw = d->qpe_main_widget; | 1088 | mw = d->qpe_main_widget; |
1089 | if ( mw ) | 1089 | if ( mw ) |
1090 | Global::setDocument( mw, doc ); | 1090 | Global::setDocument( mw, doc ); |
1091 | } else if ( msg == "nextView()" ) { | 1091 | } else if ( msg == "nextView()" ) { |
1092 | if ( raiseAppropriateWindow() ) | 1092 | if ( raiseAppropriateWindow() ) |
1093 | emit appMessage( msg, data); | 1093 | emit appMessage( msg, data); |
1094 | } else { | 1094 | } else { |
1095 | emit appMessage( msg, data); | 1095 | emit appMessage( msg, data); |
1096 | } | 1096 | } |
1097 | #endif | 1097 | #endif |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | 1100 | ||
1101 | static bool setWidgetCaptionFromAppName( QWidget* /*mw*/, const QString& /*appName*/, const QString& /*appsPath*/ ) | 1101 | static bool setWidgetCaptionFromAppName( QWidget* /*mw*/, const QString& /*appName*/, const QString& /*appsPath*/ ) |
1102 | { | 1102 | { |
1103 | /* | 1103 | /* |
1104 | // This works but disable it for now until it is safe to apply | 1104 | // This works but disable it for now until it is safe to apply |
1105 | // What is does is scan the .desktop files of all the apps for | 1105 | // What is does is scan the .desktop files of all the apps for |
1106 | // the applnk that has the corresponding argv[0] as this program | 1106 | // the applnk that has the corresponding argv[0] as this program |
1107 | // then it uses the name stored in the .desktop file as the caption | 1107 | // then it uses the name stored in the .desktop file as the caption |
1108 | // for the main widget. This saves duplicating translations for | 1108 | // for the main widget. This saves duplicating translations for |
1109 | // the app name in the program and in the .desktop files. | 1109 | // the app name in the program and in the .desktop files. |
1110 | 1110 | ||
1111 | AppLnkSet apps( appsPath ); | 1111 | AppLnkSet apps( appsPath ); |
1112 | 1112 | ||
1113 | QList<AppLnk> appsList = apps.children(); | 1113 | QList<AppLnk> appsList = apps.children(); |
1114 | for ( QListIterator<AppLnk> it(appsList); it.current(); ++it ) { | 1114 | for ( QListIterator<AppLnk> it(appsList); it.current(); ++it ) { |
1115 | if ( (*it)->exec() == appName ) { | 1115 | if ( (*it)->exec() == appName ) { |
1116 | mw->setCaption( (*it)->name() ); | 1116 | mw->setCaption( (*it)->name() ); |
1117 | return TRUE; | 1117 | return TRUE; |
1118 | } | 1118 | } |
1119 | } | 1119 | } |
1120 | */ | 1120 | */ |
1121 | return FALSE; | 1121 | return FALSE; |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | 1124 | ||
1125 | /*! | 1125 | /*! |
1126 | Sets \a mw as the mainWidget() and shows it. For small windows, | 1126 | Sets \a mw as the mainWidget() and shows it. For small windows, |
1127 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1127 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1128 | 1128 | ||
1129 | \sa showMainDocumentWidget() | 1129 | \sa showMainDocumentWidget() |
1130 | */ | 1130 | */ |
1131 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) | 1131 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) |
1132 | { | 1132 | { |
1133 | setWidgetCaptionFromAppName( mw, d->appName, qpeDir() + "apps" ); | 1133 | setWidgetCaptionFromAppName( mw, d->appName, qpeDir() + "apps" ); |
1134 | 1134 | ||
1135 | d->nomaximize = nomaximize; | 1135 | d->nomaximize = nomaximize; |
1136 | d->qpe_main_widget = mw; | 1136 | d->qpe_main_widget = mw; |
1137 | d->sendQCopQ(); | 1137 | d->sendQCopQ(); |
1138 | if ( d->preloaded ) { | 1138 | if ( d->preloaded ) { |
1139 | if(d->forceshow) { | 1139 | if(d->forceshow) { |
1140 | #ifdef Q_WS_QWS | 1140 | #ifdef Q_WS_QWS |
1141 | if ( !nomaximize ) | 1141 | if ( !nomaximize ) |
1142 | mw->showMaximized(); | 1142 | mw->showMaximized(); |
1143 | else | 1143 | else |
1144 | #endif | 1144 | #endif |
1145 | mw->show(); | 1145 | mw->show(); |
1146 | } | 1146 | } |
1147 | } else if ( d->keep_running ) { | 1147 | } else if ( d->keep_running ) { |
1148 | #ifdef Q_WS_QWS | 1148 | #ifdef Q_WS_QWS |
1149 | if ( !nomaximize ) | 1149 | if ( !nomaximize ) |
1150 | mw->showMaximized(); | 1150 | mw->showMaximized(); |
1151 | else | 1151 | else |
1152 | #endif | 1152 | #endif |
1153 | mw->show(); | 1153 | mw->show(); |
1154 | } | 1154 | } |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | /*! | 1157 | /*! |
1158 | Sets \a mw as the mainWidget() and shows it. For small windows, | 1158 | Sets \a mw as the mainWidget() and shows it. For small windows, |
1159 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1159 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1160 | 1160 | ||
1161 | This calls designates the application as | 1161 | This calls designates the application as |
1162 | a \link docwidget.html document-oriented\endlink application. | 1162 | a \link docwidget.html document-oriented\endlink application. |
1163 | 1163 | ||
1164 | The \a mw widget must have a slot: setDocument(const QString&). | 1164 | The \a mw widget must have a slot: setDocument(const QString&). |
1165 | 1165 | ||
1166 | \sa showMainWidget() | 1166 | \sa showMainWidget() |
1167 | */ | 1167 | */ |
1168 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) | 1168 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) |
1169 | { | 1169 | { |
1170 | setWidgetCaptionFromAppName( mw, d->appName, qpeDir() + "apps" ); | 1170 | setWidgetCaptionFromAppName( mw, d->appName, qpeDir() + "apps" ); |
1171 | 1171 | ||
1172 | if ( mw && argc() == 2 ) | 1172 | if ( mw && argc() == 2 ) |
1173 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); | 1173 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); |
1174 | d->nomaximize = nomaximize; | 1174 | d->nomaximize = nomaximize; |
1175 | d->qpe_main_widget = mw; | 1175 | d->qpe_main_widget = mw; |
1176 | d->sendQCopQ(); | 1176 | d->sendQCopQ(); |
1177 | if ( d->preloaded ) { | 1177 | if ( d->preloaded ) { |
1178 | if(d->forceshow) { | 1178 | if(d->forceshow) { |
1179 | #ifdef Q_WS_QWS | 1179 | #ifdef Q_WS_QWS |
1180 | if ( !nomaximize ) | 1180 | if ( !nomaximize ) |
1181 | mw->showMaximized(); | 1181 | mw->showMaximized(); |
1182 | else | 1182 | else |
1183 | #endif | 1183 | #endif |
1184 | mw->show(); | 1184 | mw->show(); |
1185 | } | 1185 | } |
1186 | } else if ( d->keep_running ) { | 1186 | } else if ( d->keep_running ) { |
1187 | #ifdef Q_WS_QWS | 1187 | #ifdef Q_WS_QWS |
1188 | if ( !nomaximize ) | 1188 | if ( !nomaximize ) |
1189 | mw->showMaximized(); | 1189 | mw->showMaximized(); |
1190 | else | 1190 | else |
1191 | #endif | 1191 | #endif |
1192 | mw->show(); | 1192 | mw->show(); |
1193 | } | 1193 | } |
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | 1196 | ||
1197 | /*! | 1197 | /*! |
1198 | Sets that the application should continue running after processing | 1198 | Sets that the application should continue running after processing |
1199 | qcop messages. Normally if an application is started via a qcop message, | 1199 | qcop messages. Normally if an application is started via a qcop message, |
1200 | the application will process the qcop message and then quit. If while | 1200 | the application will process the qcop message and then quit. If while |
1201 | processing the qcop message it calls this function, then the application | 1201 | processing the qcop message it calls this function, then the application |
1202 | will show and start proper once it has finished processing qcop messages. | 1202 | will show and start proper once it has finished processing qcop messages. |
1203 | 1203 | ||
1204 | \sa keepRunning() | 1204 | \sa keepRunning() |
1205 | */ | 1205 | */ |
1206 | void QPEApplication::setKeepRunning() | 1206 | void QPEApplication::setKeepRunning() |
1207 | { | 1207 | { |
1208 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { | 1208 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { |
1209 | QPEApplication *qpeApp = (QPEApplication*)qApp; | 1209 | QPEApplication *qpeApp = (QPEApplication*)qApp; |
1210 | qpeApp->d->keep_running = TRUE; | 1210 | qpeApp->d->keep_running = TRUE; |
1211 | } | 1211 | } |
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | /*! | 1214 | /*! |
1215 | Returns whether the application will quit after processing the current | 1215 | Returns whether the application will quit after processing the current |
1216 | list of qcop messages. | 1216 | list of qcop messages. |
1217 | 1217 | ||
1218 | \sa setKeepRunning() | 1218 | \sa setKeepRunning() |
1219 | */ | 1219 | */ |
1220 | bool QPEApplication::keepRunning() const | 1220 | bool QPEApplication::keepRunning() const |
1221 | { | 1221 | { |
1222 | return d->keep_running; | 1222 | return d->keep_running; |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | /*! | 1225 | /*! |
1226 | \internal | 1226 | \internal |
1227 | */ | 1227 | */ |
1228 | void QPEApplication::internalSetStyle( const QString &style ) | 1228 | void QPEApplication::internalSetStyle( const QString &style ) |
1229 | { | 1229 | { |
1230 | #if QT_VERSION >= 300 | 1230 | #if QT_VERSION >= 300 |
1231 | if ( style == "QPE" ) { | 1231 | if ( style == "QPE" ) { |
1232 | setStyle( new QPEStyle ); | 1232 | setStyle( new QPEStyle ); |
1233 | } else { | 1233 | } else { |
1234 | QStyle *s = QStyleFactory::create(style); | 1234 | QStyle *s = QStyleFactory::create(style); |
1235 | if ( s ) setStyle(s); | 1235 | if ( s ) setStyle(s); |
1236 | } | 1236 | } |
1237 | #else | 1237 | #else |
1238 | if ( style == "Windows" ) { | 1238 | if ( style == "Windows" ) { |
1239 | setStyle( new QWindowsStyle ); | 1239 | setStyle( new QWindowsStyle ); |
1240 | } else if ( style == "QPE" ) { | 1240 | } else if ( style == "QPE" ) { |
1241 | setStyle( new QPEStyle ); | 1241 | setStyle( new QPEStyle ); |
1242 | } else if ( style == "Light" ) { | 1242 | } else if ( style == "Light" ) { |
1243 | setStyle( new LightStyle ); | 1243 | setStyle( new LightStyle ); |
1244 | } | 1244 | } |
1245 | #ifndef QT_NO_STYLE_PLATINUM | 1245 | #ifndef QT_NO_STYLE_PLATINUM |
1246 | else if ( style == "Platinum" ) { | 1246 | else if ( style == "Platinum" ) { |
1247 | setStyle( new QPlatinumStyle ); | 1247 | setStyle( new QPlatinumStyle ); |
1248 | } | 1248 | } |
1249 | #endif | 1249 | #endif |
1250 | #ifndef QT_NO_STYLE_MOTIF | 1250 | #ifndef QT_NO_STYLE_MOTIF |
1251 | else if ( style == "Motif" ) { | 1251 | else if ( style == "Motif" ) { |
1252 | setStyle( new QMotifStyle ); | 1252 | setStyle( new QMotifStyle ); |
1253 | } | 1253 | } |
1254 | #endif | 1254 | #endif |
1255 | #ifndef QT_NO_STYLE_MOTIFPLUS | 1255 | #ifndef QT_NO_STYLE_MOTIFPLUS |
1256 | else if ( style == "MotifPlus" ) { | 1256 | else if ( style == "MotifPlus" ) { |
1257 | setStyle( new QMotifPlusStyle ); | 1257 | setStyle( new QMotifPlusStyle ); |
1258 | } | 1258 | } |
1259 | #endif | 1259 | #endif |
1260 | #endif | 1260 | #endif |
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | /*! | 1263 | /*! |
1264 | \internal | 1264 | \internal |
1265 | */ | 1265 | */ |
1266 | void QPEApplication::prepareForTermination(bool willrestart) | 1266 | void QPEApplication::prepareForTermination(bool willrestart) |
1267 | { | 1267 | { |
1268 | if ( willrestart ) { | 1268 | if ( willrestart ) { |
1269 | // Draw a big wait icon, the image can be altered in later revisions | 1269 | // Draw a big wait icon, the image can be altered in later revisions |
1270 | //QWidget *d = QApplication::desktop(); | 1270 | //QWidget *d = QApplication::desktop(); |
1271 | QImage img = Resource::loadImage( "wait" ); | 1271 | QImage img = Resource::loadImage( "wait" ); |
1272 | QPixmap pix; | 1272 | QPixmap pix; |
1273 | pix.convertFromImage(img.smoothScale(3*img.width(), 3*img.height())); | 1273 | pix.convertFromImage(img.smoothScale(3*img.width(), 3*img.height())); |
1274 | QLabel *lblWait = new QLabel(0, "wait hack!", QWidget::WStyle_Customize | | 1274 | QLabel *lblWait = new QLabel(0, "wait hack!", QWidget::WStyle_Customize | |
1275 | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool ); | 1275 | QWidget::WStyle_NoBorder | QWidget::WStyle_Tool ); |
1276 | lblWait->setPixmap( pix ); | 1276 | lblWait->setPixmap( pix ); |
1277 | lblWait->setAlignment( QWidget::AlignCenter ); | 1277 | lblWait->setAlignment( QWidget::AlignCenter ); |
1278 | lblWait->show(); | 1278 | lblWait->show(); |
1279 | lblWait->showMaximized(); | 1279 | lblWait->showMaximized(); |
1280 | } | 1280 | } |
1281 | #ifndef SINGLE_APP | 1281 | #ifndef SINGLE_APP |
1282 | { QCopEnvelope envelope("QPE/System", "forceQuit()"); } | 1282 | { QCopEnvelope envelope("QPE/System", "forceQuit()"); } |
1283 | processEvents(); // ensure the message goes out. | 1283 | processEvents(); // ensure the message goes out. |
1284 | sleep(1); // You have 1 second to comply. | 1284 | sleep(1); // You have 1 second to comply. |
1285 | #endif | 1285 | #endif |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | /*! | 1288 | /*! |
1289 | \internal | 1289 | \internal |
1290 | */ | 1290 | */ |
1291 | void QPEApplication::shutdown() | 1291 | void QPEApplication::shutdown() |
1292 | { | 1292 | { |
1293 | // Implement in server's QPEApplication subclass | 1293 | // Implement in server's QPEApplication subclass |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | /*! | 1296 | /*! |
1297 | \internal | 1297 | \internal |
1298 | */ | 1298 | */ |
1299 | void QPEApplication::restart() | 1299 | void QPEApplication::restart() |
1300 | { | 1300 | { |
1301 | // Implement in server's QPEApplication subclass | 1301 | // Implement in server's QPEApplication subclass |
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | static QPtrDict<void>* stylusDict=0; | 1304 | static QPtrDict<void>* stylusDict=0; |
1305 | static void createDict() | 1305 | static void createDict() |
1306 | { | 1306 | { |
1307 | if ( !stylusDict ) | 1307 | if ( !stylusDict ) |
1308 | stylusDict = new QPtrDict<void>; | 1308 | stylusDict = new QPtrDict<void>; |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | /*! | 1311 | /*! |
1312 | Returns the current StylusMode for \a w. | 1312 | Returns the current StylusMode for \a w. |
1313 | 1313 | ||
1314 | \sa setStylusOperation() | 1314 | \sa setStylusOperation() |
1315 | */ | 1315 | */ |
1316 | QPEApplication::StylusMode QPEApplication::stylusOperation( QWidget* w ) | 1316 | QPEApplication::StylusMode QPEApplication::stylusOperation( QWidget* w ) |
1317 | { | 1317 | { |
1318 | if ( stylusDict ) | 1318 | if ( stylusDict ) |
1319 | return (StylusMode)(int)stylusDict->find(w); | 1319 | return (StylusMode)(int)stylusDict->find(w); |
1320 | return LeftOnly; | 1320 | return LeftOnly; |
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | /*! | 1323 | /*! |
1324 | \enum QPEApplication::StylusMode | 1324 | \enum QPEApplication::StylusMode |
1325 | 1325 | ||
1326 | \value LeftOnly the stylus only generates LeftButton | 1326 | \value LeftOnly the stylus only generates LeftButton |
1327 | events (the default). | 1327 | events (the default). |
1328 | \value RightOnHold the stylus generates RightButton events | 1328 | \value RightOnHold the stylus generates RightButton events |
1329 | if the user uses the press-and-hold gesture. | 1329 | if the user uses the press-and-hold gesture. |
1330 | 1330 | ||
1331 | See setStylusOperation(). | 1331 | See setStylusOperation(). |
1332 | */ | 1332 | */ |
1333 | 1333 | ||
1334 | /*! | 1334 | /*! |
1335 | Causes \a w to receive mouse events according to \a mode. | 1335 | Causes \a w to receive mouse events according to \a mode. |
1336 | 1336 | ||
1337 | \sa stylusOperation() | 1337 | \sa stylusOperation() |
1338 | */ | 1338 | */ |
1339 | void QPEApplication::setStylusOperation( QWidget* w, StylusMode mode ) | 1339 | void QPEApplication::setStylusOperation( QWidget* w, StylusMode mode ) |
1340 | { | 1340 | { |
1341 | createDict(); | 1341 | createDict(); |
1342 | if ( mode == LeftOnly ) { | 1342 | if ( mode == LeftOnly ) { |
1343 | stylusDict->remove(w); | 1343 | stylusDict->remove(w); |
1344 | w->removeEventFilter(qApp); | 1344 | w->removeEventFilter(qApp); |
1345 | } else { | 1345 | } else { |
1346 | stylusDict->insert(w,(void*)mode); | 1346 | stylusDict->insert(w,(void*)mode); |
1347 | connect(w,SIGNAL(destroyed()),qApp,SLOT(removeSenderFromStylusDict())); | 1347 | connect(w,SIGNAL(destroyed()),qApp,SLOT(removeSenderFromStylusDict())); |
1348 | w->installEventFilter(qApp); | 1348 | w->installEventFilter(qApp); |
1349 | } | 1349 | } |
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | 1352 | ||
1353 | /*! | 1353 | /*! |
1354 | \reimp | 1354 | \reimp |
1355 | */ | 1355 | */ |
1356 | bool QPEApplication::eventFilter( QObject *o, QEvent *e ) | 1356 | bool QPEApplication::eventFilter( QObject *o, QEvent *e ) |
1357 | { | 1357 | { |
1358 | if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) { | 1358 | if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) { |
1359 | QMouseEvent* me = (QMouseEvent*)e; | 1359 | QMouseEvent* me = (QMouseEvent*)e; |
1360 | if ( me->button() == LeftButton ) { | 1360 | if ( me->button() == LeftButton ) { |
1361 | StylusMode mode = (StylusMode)(int)stylusDict->find(o); | 1361 | StylusMode mode = (StylusMode)(int)stylusDict->find(o); |
1362 | switch (mode) { | 1362 | switch (mode) { |
1363 | case RightOnHold: | 1363 | case RightOnHold: |
1364 | switch ( me->type() ) { | 1364 | switch ( me->type() ) { |
1365 | case QEvent::MouseButtonPress: | 1365 | case QEvent::MouseButtonPress: |
1366 | d->presstimer = startTimer(500); // #### pref. | 1366 | d->presstimer = startTimer(500); // #### pref. |
1367 | d->presswidget = (QWidget*)o; | 1367 | d->presswidget = (QWidget*)o; |
1368 | d->presspos = me->pos(); | 1368 | d->presspos = me->pos(); |
1369 | d->rightpressed = FALSE; | 1369 | d->rightpressed = FALSE; |
1370 | break; | 1370 | break; |
1371 | case QEvent::MouseButtonRelease: | 1371 | case QEvent::MouseButtonRelease: |
1372 | if ( d->presstimer ) { | 1372 | if ( d->presstimer ) { |
1373 | killTimer(d->presstimer); | 1373 | killTimer(d->presstimer); |
1374 | d->presstimer = 0; | 1374 | d->presstimer = 0; |
1375 | } | 1375 | } |
1376 | if ( d->rightpressed && d->presswidget ) { | 1376 | if ( d->rightpressed && d->presswidget ) { |
1377 | // Right released | 1377 | // Right released |
1378 | postEvent( d->presswidget, | 1378 | postEvent( d->presswidget, |
1379 | new QMouseEvent( QEvent::MouseButtonRelease, me->pos(), | 1379 | new QMouseEvent( QEvent::MouseButtonRelease, me->pos(), |
1380 | RightButton, LeftButton+RightButton ) ); | 1380 | RightButton, LeftButton+RightButton ) ); |
1381 | // Left released, off-widget | 1381 | // Left released, off-widget |
1382 | postEvent( d->presswidget, | 1382 | postEvent( d->presswidget, |
1383 | new QMouseEvent( QEvent::MouseMove, QPoint(-1,-1), | 1383 | new QMouseEvent( QEvent::MouseMove, QPoint(-1,-1), |
1384 | LeftButton, LeftButton ) ); | 1384 | LeftButton, LeftButton ) ); |
1385 | postEvent( d->presswidget, | 1385 | postEvent( d->presswidget, |
1386 | new QMouseEvent( QEvent::MouseButtonRelease, QPoint(-1,-1), | 1386 | new QMouseEvent( QEvent::MouseButtonRelease, QPoint(-1,-1), |
1387 | LeftButton, LeftButton ) ); | 1387 | LeftButton, LeftButton ) ); |
1388 | d->rightpressed = FALSE; | 1388 | d->rightpressed = FALSE; |
1389 | return TRUE; // don't send the real Left release | 1389 | return TRUE; // don't send the real Left release |
1390 | } | 1390 | } |
1391 | break; | 1391 | break; |
1392 | default: | 1392 | default: |
1393 | break; | 1393 | break; |
1394 | } | 1394 | } |
1395 | break; | 1395 | break; |
1396 | default: | 1396 | default: |
1397 | ; | 1397 | ; |
1398 | } | 1398 | } |
1399 | } | 1399 | } |
1400 | } else if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { | 1400 | } else if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { |
1401 | QKeyEvent *ke = (QKeyEvent *)e; | 1401 | QKeyEvent *ke = (QKeyEvent *)e; |
1402 | if ( ke->key() == Key_Enter ) { | 1402 | if ( ke->key() == Key_Enter ) { |
1403 | if ( o->isA( "QRadioButton" ) || o->isA( "QCheckBox" ) ) { | 1403 | if ( o->isA( "QRadioButton" ) || o->isA( "QCheckBox" ) ) { |
1404 | postEvent( o, new QKeyEvent( e->type(), Key_Space, ' ', | 1404 | postEvent( o, new QKeyEvent( e->type(), Key_Space, ' ', |
1405 | ke->state(), " ", ke->isAutoRepeat(), ke->count() ) ); | 1405 | ke->state(), " ", ke->isAutoRepeat(), ke->count() ) ); |
1406 | return TRUE; | 1406 | return TRUE; |
1407 | } | 1407 | } |
1408 | } | 1408 | } |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | return FALSE; | 1411 | return FALSE; |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | /*! | 1414 | /*! |
1415 | \reimp | 1415 | \reimp |
1416 | */ | 1416 | */ |
1417 | void QPEApplication::timerEvent( QTimerEvent *e ) | 1417 | void QPEApplication::timerEvent( QTimerEvent *e ) |
1418 | { | 1418 | { |
1419 | if ( e->timerId() == d->presstimer && d->presswidget ) { | 1419 | if ( e->timerId() == d->presstimer && d->presswidget ) { |
1420 | // Right pressed | 1420 | // Right pressed |
1421 | postEvent( d->presswidget, | 1421 | postEvent( d->presswidget, |
1422 | new QMouseEvent( QEvent::MouseButtonPress, d->presspos, | 1422 | new QMouseEvent( QEvent::MouseButtonPress, d->presspos, |
1423 | RightButton, LeftButton ) ); | 1423 | RightButton, LeftButton ) ); |
1424 | killTimer( d->presstimer ); | 1424 | killTimer( d->presstimer ); |
1425 | d->presstimer = 0; | 1425 | d->presstimer = 0; |
1426 | d->rightpressed = TRUE; | 1426 | d->rightpressed = TRUE; |
1427 | } | 1427 | } |
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | void QPEApplication::removeSenderFromStylusDict() | 1430 | void QPEApplication::removeSenderFromStylusDict() |
1431 | { | 1431 | { |
1432 | stylusDict->remove((void*)sender()); | 1432 | stylusDict->remove((void*)sender()); |
1433 | if ( d->presswidget == sender() ) | 1433 | if ( d->presswidget == sender() ) |
1434 | d->presswidget = 0; | 1434 | d->presswidget = 0; |
1435 | } | 1435 | } |
1436 | 1436 | ||
1437 | /*! | 1437 | /*! |
1438 | \internal | 1438 | \internal |
1439 | */ | 1439 | */ |
1440 | bool QPEApplication::keyboardGrabbed() const | 1440 | bool QPEApplication::keyboardGrabbed() const |
1441 | { | 1441 | { |
1442 | return d->kbgrabber; | 1442 | return d->kbgrabber; |
1443 | } | 1443 | } |
1444 | 1444 | ||
1445 | 1445 | ||
1446 | /*! | 1446 | /*! |
1447 | Reverses the effect of grabKeyboard(). This is called automatically | 1447 | Reverses the effect of grabKeyboard(). This is called automatically |
1448 | on program exit. | 1448 | on program exit. |
1449 | */ | 1449 | */ |
1450 | void QPEApplication::ungrabKeyboard() | 1450 | void QPEApplication::ungrabKeyboard() |
1451 | { | 1451 | { |
1452 | QPEApplicationData* d = ((QPEApplication*)qApp)->d; | 1452 | QPEApplicationData* d = ((QPEApplication*)qApp)->d; |
1453 | if ( d->kbgrabber == 2 ) { | 1453 | if ( d->kbgrabber == 2 ) { |
1454 | QCopEnvelope e("QPE/System", "grabKeyboard(QString)" ); | 1454 | QCopEnvelope e("QPE/System", "grabKeyboard(QString)" ); |
1455 | e << QString::null; | 1455 | e << QString::null; |
1456 | d->kbregrab = FALSE; | 1456 | d->kbregrab = FALSE; |
1457 | d->kbgrabber = 0; | 1457 | d->kbgrabber = 0; |
1458 | } | 1458 | } |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | /*! | 1461 | /*! |
1462 | Grabs the keyboard such that the system's application launching | 1462 | Grabs the keyboard such that the system's application launching |
1463 | keys no longer work, and instead they are receivable by this | 1463 | keys no longer work, and instead they are receivable by this |
1464 | application. | 1464 | application. |
1465 | 1465 | ||
1466 | \sa ungrabKeyboard() | 1466 | \sa ungrabKeyboard() |
1467 | */ | 1467 | */ |
1468 | void QPEApplication::grabKeyboard() | 1468 | void QPEApplication::grabKeyboard() |
1469 | { | 1469 | { |
1470 | QPEApplicationData* d = ((QPEApplication*)qApp)->d; | 1470 | QPEApplicationData* d = ((QPEApplication*)qApp)->d; |
1471 | if ( qApp->type() == QApplication::GuiServer ) | 1471 | if ( qApp->type() == QApplication::GuiServer ) |
1472 | d->kbgrabber = 0; | 1472 | d->kbgrabber = 0; |
1473 | else { | 1473 | else { |
1474 | QCopEnvelope e("QPE/System", "grabKeyboard(QString)" ); | 1474 | QCopEnvelope e("QPE/System", "grabKeyboard(QString)" ); |
1475 | e << d->appName; | 1475 | e << d->appName; |
1476 | d->kbgrabber = 2; // me | 1476 | d->kbgrabber = 2; // me |
1477 | } | 1477 | } |
1478 | } | 1478 | } |
1479 | 1479 | ||
1480 | /*! | 1480 | /*! |
1481 | \reimp | 1481 | \reimp |
1482 | */ | 1482 | */ |
1483 | int QPEApplication::exec() | 1483 | int QPEApplication::exec() |
1484 | { | 1484 | { |
1485 | d->sendQCopQ(); | 1485 | d->sendQCopQ(); |
1486 | if ( d->keep_running) | 1486 | if ( d->keep_running) |
1487 | //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) | 1487 | //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) |
1488 | return QApplication::exec(); | 1488 | return QApplication::exec(); |
1489 | 1489 | ||
1490 | { | 1490 | { |
1491 | QCopEnvelope e("QPE/System", "closing(QString)" ); | 1491 | QCopEnvelope e("QPE/System", "closing(QString)" ); |
1492 | e << d->appName; | 1492 | e << d->appName; |
1493 | } | 1493 | } |
1494 | processEvents(); | 1494 | processEvents(); |
1495 | return 0; | 1495 | return 0; |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | /*! | 1498 | /*! |
1499 | \internal | 1499 | \internal |
1500 | External request for application to quit. Quits if possible without | 1500 | External request for application to quit. Quits if possible without |
1501 | loosing state. | 1501 | loosing state. |
1502 | */ | 1502 | */ |
1503 | void QPEApplication::tryQuit() | 1503 | void QPEApplication::tryQuit() |
1504 | { | 1504 | { |
1505 | if ( activeModalWidget() || strcmp( argv()[0], "embeddedkonsole") == 0 ) | 1505 | if ( activeModalWidget() || strcmp( argv()[0], "embeddedkonsole") == 0 ) |
1506 | return; // Inside modal loop or konsole. Too hard to save state. | 1506 | return; // Inside modal loop or konsole. Too hard to save state. |
1507 | { | 1507 | { |
1508 | QCopEnvelope e("QPE/System", "closing(QString)" ); | 1508 | QCopEnvelope e("QPE/System", "closing(QString)" ); |
1509 | e << d->appName; | 1509 | e << d->appName; |
1510 | } | 1510 | } |
1511 | processEvents(); | 1511 | processEvents(); |
1512 | 1512 | ||
1513 | quit(); | 1513 | quit(); |
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | /*! | 1516 | /*! |
1517 | \internal | 1517 | \internal |
1518 | User initiated quit. Makes the window 'Go Away'. If preloaded this means | 1518 | User initiated quit. Makes the window 'Go Away'. If preloaded this means |
1519 | hiding the window. If not it means quitting the application. | 1519 | hiding the window. If not it means quitting the application. |
1520 | As this is user initiated we don't need to check state. | 1520 | As this is user initiated we don't need to check state. |
1521 | */ | 1521 | */ |
1522 | void QPEApplication::hideOrQuit() | 1522 | void QPEApplication::hideOrQuit() |
1523 | { | 1523 | { |
1524 | // notify of our demise :) | 1524 | // notify of our demise :) |
1525 | { | 1525 | { |
1526 | QCopEnvelope e("QPE/System", "closing(QString)" ); | 1526 | QCopEnvelope e("QPE/System", "closing(QString)" ); |
1527 | e << d->appName; | 1527 | e << d->appName; |
1528 | } | 1528 | } |
1529 | processEvents(); | 1529 | processEvents(); |
1530 | if ( d->preloaded && d->qpe_main_widget ) | 1530 | if ( d->preloaded && d->qpe_main_widget ) |
1531 | d->qpe_main_widget->hide(); | 1531 | d->qpe_main_widget->hide(); |
1532 | else | 1532 | else |
1533 | quit(); | 1533 | quit(); |
1534 | } | 1534 | } |
1535 | 1535 | ||
1536 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) | 1536 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) |
1537 | 1537 | ||
1538 | // The libraries with the skiff package (and possibly others) have | 1538 | // The libraries with the skiff package (and possibly others) have |
1539 | // completely useless implementations of builtin new and delete that | 1539 | // completely useless implementations of builtin new and delete that |
1540 | // use about 50% of your CPU. Here we revert to the simple libc | 1540 | // use about 50% of your CPU. Here we revert to the simple libc |
1541 | // functions. | 1541 | // functions. |
1542 | 1542 | ||
1543 | void* operator new[](size_t size) | 1543 | void* operator new[](size_t size) |
1544 | { | 1544 | { |
1545 | return malloc(size); | 1545 | return malloc(size); |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | void* operator new(size_t size) | 1548 | void* operator new(size_t size) |
1549 | { | 1549 | { |
1550 | return malloc(size); | 1550 | return malloc(size); |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | void operator delete[](void* p) | 1553 | void operator delete[](void* p) |
1554 | { | 1554 | { |
1555 | free(p); | 1555 | free(p); |
1556 | } | 1556 | } |
1557 | 1557 | ||
1558 | void operator delete[](void* p, size_t /*size*/) | 1558 | void operator delete[](void* p, size_t /*size*/) |
1559 | { | 1559 | { |
1560 | free(p); | 1560 | free(p); |
1561 | } | 1561 | } |
1562 | 1562 | ||
1563 | void operator delete(void* p) | 1563 | void operator delete(void* p) |
1564 | { | 1564 | { |
1565 | free(p); | 1565 | free(p); |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | void operator delete(void* p, size_t /*size*/) | 1568 | void operator delete(void* p, size_t /*size*/) |
1569 | { | 1569 | { |
1570 | free(p); | 1570 | free(p); |
1571 | } | 1571 | } |
1572 | 1572 | ||
1573 | #endif | 1573 | #endif |
1574 | 1574 | ||
1575 | #if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP) | 1575 | #if ( QT_VERSION <= 230 ) && !defined(SINGLE_APP) |
1576 | #include <qwidgetlist.h> | 1576 | #include <qwidgetlist.h> |
1577 | #include <qgfx_qws.h> | 1577 | #include <qgfx_qws.h> |
1578 | extern QRect qt_maxWindowRect; | 1578 | extern QRect qt_maxWindowRect; |
1579 | void qt_setMaxWindowRect(const QRect& r) | 1579 | void qt_setMaxWindowRect(const QRect& r) |
1580 | { | 1580 | { |
1581 | qt_maxWindowRect = qt_screen->mapFromDevice(r, | 1581 | qt_maxWindowRect = qt_screen->mapFromDevice(r, |
1582 | qt_screen->mapToDevice(QSize(qt_screen->width(),qt_screen->height()))); | 1582 | qt_screen->mapToDevice(QSize(qt_screen->width(),qt_screen->height()))); |
1583 | // Re-resize any maximized windows | 1583 | // Re-resize any maximized windows |
1584 | QWidgetList* l = QApplication::topLevelWidgets(); | 1584 | QWidgetList* l = QApplication::topLevelWidgets(); |
1585 | if ( l ) { | 1585 | if ( l ) { |
1586 | QWidget *w = l->first(); | 1586 | QWidget *w = l->first(); |
1587 | while ( w ) { | 1587 | while ( w ) { |
1588 | if ( w->isVisible() && w->isMaximized() ) | 1588 | if ( w->isVisible() && w->isMaximized() ) |
1589 | { | 1589 | { |
1590 | w->showMaximized(); | 1590 | w->showMaximized(); |
1591 | } | 1591 | } |
1592 | w = l->next(); | 1592 | w = l->next(); |
1593 | } | 1593 | } |
1594 | delete l; | 1594 | delete l; |
1595 | } | 1595 | } |
1596 | } | 1596 | } |
1597 | #endif | 1597 | #endif |