summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.pro2
-rw-r--r--core/pim/datebook/dateentry.ui6
-rw-r--r--core/pim/datebook/dateentryimpl.cpp22
-rw-r--r--core/pim/datebook/timepicker.cpp119
-rw-r--r--core/pim/datebook/timepicker.h32
5 files changed, 14 insertions, 167 deletions
diff --git a/core/pim/datebook/datebook.pro b/core/pim/datebook/datebook.pro
index b4206a9..a6ee799 100644
--- a/core/pim/datebook/datebook.pro
+++ b/core/pim/datebook/datebook.pro
@@ -1,62 +1,60 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on release 2 CONFIG += qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin 3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS= datebookday.h \ 4 HEADERS= datebookday.h \
5 datebook.h \ 5 datebook.h \
6 dateentryimpl.h \ 6 dateentryimpl.h \
7 datebookdayheaderimpl.h \ 7 datebookdayheaderimpl.h \
8 datebooksettings.h \ 8 datebooksettings.h \
9 datebookweek.h \ 9 datebookweek.h \
10 datebookweeklst.h \ 10 datebookweeklst.h \
11 datebookweekheaderimpl.h \ 11 datebookweekheaderimpl.h \
12 repeatentry.h \ 12 repeatentry.h \
13 timepicker.h \
14 noteentryimpl.h \ 13 noteentryimpl.h \
15 onoteedit.h 14 onoteedit.h
16 SOURCES= main.cpp \ 15 SOURCES= main.cpp \
17 datebookday.cpp \ 16 datebookday.cpp \
18 datebook.cpp \ 17 datebook.cpp \
19 dateentryimpl.cpp \ 18 dateentryimpl.cpp \
20 datebookdayheaderimpl.cpp \ 19 datebookdayheaderimpl.cpp \
21 datebooksettings.cpp \ 20 datebooksettings.cpp \
22 datebookweek.cpp \ 21 datebookweek.cpp \
23 datebookweeklst.cpp \ 22 datebookweeklst.cpp \
24 datebookweekheaderimpl.cpp \ 23 datebookweekheaderimpl.cpp \
25 repeatentry.cpp \ 24 repeatentry.cpp \
26 timepicker.cpp \
27 noteentryimpl.cpp \ 25 noteentryimpl.cpp \
28 onoteedit.cpp 26 onoteedit.cpp
29 INTERFACES= dateentry.ui \ 27 INTERFACES= dateentry.ui \
30 datebookdayheader.ui \ 28 datebookdayheader.ui \
31 datebookweekheader.ui \ 29 datebookweekheader.ui \
32 datebookweeklstheader.ui \ 30 datebookweeklstheader.ui \
33 datebookweeklstdayhdr.ui \ 31 datebookweeklstdayhdr.ui \
34 repeatentrybase.ui \ 32 repeatentrybase.ui \
35 datebooksettingsbase.ui \ 33 datebooksettingsbase.ui \
36 noteentry.ui 34 noteentry.ui
37INCLUDEPATH += $(OPIEDIR)/include 35INCLUDEPATH += $(OPIEDIR)/include
38 DEPENDPATH+= $(OPIEDIR)/include 36 DEPENDPATH+= $(OPIEDIR)/include
39LIBS += -lqpe -lopie 37LIBS += -lqpe -lopie
40 TARGET = datebook 38 TARGET = datebook
41 39
42TRANSLATIONS = ../../../i18n/de/datebook.ts \ 40TRANSLATIONS = ../../../i18n/de/datebook.ts \
43 ../../../i18n/xx/datebook.ts \ 41 ../../../i18n/xx/datebook.ts \
44 ../../../i18n/en/datebook.ts \ 42 ../../../i18n/en/datebook.ts \
45 ../../../i18n/es/datebook.ts \ 43 ../../../i18n/es/datebook.ts \
46 ../../../i18n/fr/datebook.ts \ 44 ../../../i18n/fr/datebook.ts \
47 ../../../i18n/hu/datebook.ts \ 45 ../../../i18n/hu/datebook.ts \
48 ../../../i18n/ja/datebook.ts \ 46 ../../../i18n/ja/datebook.ts \
49 ../../../i18n/ko/datebook.ts \ 47 ../../../i18n/ko/datebook.ts \
50 ../../../i18n/no/datebook.ts \ 48 ../../../i18n/no/datebook.ts \
51 ../../../i18n/pl/datebook.ts \ 49 ../../../i18n/pl/datebook.ts \
52 ../../../i18n/pt/datebook.ts \ 50 ../../../i18n/pt/datebook.ts \
53 ../../../i18n/pt_BR/datebook.ts \ 51 ../../../i18n/pt_BR/datebook.ts \
54 ../../../i18n/sl/datebook.ts \ 52 ../../../i18n/sl/datebook.ts \
55 ../../../i18n/zh_CN/datebook.ts \ 53 ../../../i18n/zh_CN/datebook.ts \
56 ../../../i18n/it/datebook.ts \ 54 ../../../i18n/it/datebook.ts \
57 ../../../i18n/zh_TW/datebook.ts \ 55 ../../../i18n/zh_TW/datebook.ts \
58 ../../../i18n/da/datebook.ts 56 ../../../i18n/da/datebook.ts
59 57
60 58
61 59
62include ( $(OPIEDIR)/include.pro ) 60include ( $(OPIEDIR)/include.pro )
diff --git a/core/pim/datebook/dateentry.ui b/core/pim/datebook/dateentry.ui
index fadbc35..197eb30 100644
--- a/core/pim/datebook/dateentry.ui
+++ b/core/pim/datebook/dateentry.ui
@@ -99,529 +99,529 @@
99 </item> 99 </item>
100 <item> 100 <item>
101 <property> 101 <property>
102 <name>text</name> 102 <name>text</name>
103 <string>Lunch</string> 103 <string>Lunch</string>
104 </property> 104 </property>
105 </item> 105 </item>
106 <item> 106 <item>
107 <property> 107 <property>
108 <name>text</name> 108 <name>text</name>
109 <string>Dinner</string> 109 <string>Dinner</string>
110 </property> 110 </property>
111 </item> 111 </item>
112 <item> 112 <item>
113 <property> 113 <property>
114 <name>text</name> 114 <name>text</name>
115 <string>Travel</string> 115 <string>Travel</string>
116 </property> 116 </property>
117 </item> 117 </item>
118 <property stdset="1"> 118 <property stdset="1">
119 <name>name</name> 119 <name>name</name>
120 <cstring>comboDescription</cstring> 120 <cstring>comboDescription</cstring>
121 </property> 121 </property>
122 <property stdset="1"> 122 <property stdset="1">
123 <name>sizePolicy</name> 123 <name>sizePolicy</name>
124 <sizepolicy> 124 <sizepolicy>
125 <hsizetype>7</hsizetype> 125 <hsizetype>7</hsizetype>
126 <vsizetype>0</vsizetype> 126 <vsizetype>0</vsizetype>
127 </sizepolicy> 127 </sizepolicy>
128 </property> 128 </property>
129 <property stdset="1"> 129 <property stdset="1">
130 <name>editable</name> 130 <name>editable</name>
131 <bool>true</bool> 131 <bool>true</bool>
132 </property> 132 </property>
133 <property stdset="1"> 133 <property stdset="1">
134 <name>currentItem</name> 134 <name>currentItem</name>
135 <number>0</number> 135 <number>0</number>
136 </property> 136 </property>
137 <property stdset="1"> 137 <property stdset="1">
138 <name>duplicatesEnabled</name> 138 <name>duplicatesEnabled</name>
139 <bool>false</bool> 139 <bool>false</bool>
140 </property> 140 </property>
141 </widget> 141 </widget>
142 <widget row="0" column="0" > 142 <widget row="0" column="0" >
143 <class>QLabel</class> 143 <class>QLabel</class>
144 <property stdset="1"> 144 <property stdset="1">
145 <name>name</name> 145 <name>name</name>
146 <cstring>TextLabel1</cstring> 146 <cstring>TextLabel1</cstring>
147 </property> 147 </property>
148 <property stdset="1"> 148 <property stdset="1">
149 <name>text</name> 149 <name>text</name>
150 <string>Description </string> 150 <string>Description </string>
151 </property> 151 </property>
152 </widget> 152 </widget>
153 <widget row="1" column="1" rowspan="1" colspan="3" > 153 <widget row="1" column="1" rowspan="1" colspan="3" >
154 <class>QComboBox</class> 154 <class>QComboBox</class>
155 <item> 155 <item>
156 <property> 156 <property>
157 <name>text</name> 157 <name>text</name>
158 <string></string> 158 <string></string>
159 </property> 159 </property>
160 </item> 160 </item>
161 <item> 161 <item>
162 <property> 162 <property>
163 <name>text</name> 163 <name>text</name>
164 <string>Office</string> 164 <string>Office</string>
165 </property> 165 </property>
166 </item> 166 </item>
167 <item> 167 <item>
168 <property> 168 <property>
169 <name>text</name> 169 <name>text</name>
170 <string>Home</string> 170 <string>Home</string>
171 </property> 171 </property>
172 </item> 172 </item>
173 <property stdset="1"> 173 <property stdset="1">
174 <name>name</name> 174 <name>name</name>
175 <cstring>comboLocation</cstring> 175 <cstring>comboLocation</cstring>
176 </property> 176 </property>
177 <property stdset="1"> 177 <property stdset="1">
178 <name>sizePolicy</name> 178 <name>sizePolicy</name>
179 <sizepolicy> 179 <sizepolicy>
180 <hsizetype>7</hsizetype> 180 <hsizetype>7</hsizetype>
181 <vsizetype>0</vsizetype> 181 <vsizetype>0</vsizetype>
182 </sizepolicy> 182 </sizepolicy>
183 </property> 183 </property>
184 <property stdset="1"> 184 <property stdset="1">
185 <name>editable</name> 185 <name>editable</name>
186 <bool>true</bool> 186 <bool>true</bool>
187 </property> 187 </property>
188 <property stdset="1"> 188 <property stdset="1">
189 <name>currentItem</name> 189 <name>currentItem</name>
190 <number>0</number> 190 <number>0</number>
191 </property> 191 </property>
192 <property stdset="1"> 192 <property stdset="1">
193 <name>duplicatesEnabled</name> 193 <name>duplicatesEnabled</name>
194 <bool>false</bool> 194 <bool>false</bool>
195 </property> 195 </property>
196 </widget> 196 </widget>
197 <widget row="2" column="1" rowspan="1" colspan="3" > 197 <widget row="2" column="1" rowspan="1" colspan="3" >
198 <class>CategorySelect</class> 198 <class>CategorySelect</class>
199 <property stdset="1"> 199 <property stdset="1">
200 <name>name</name> 200 <name>name</name>
201 <cstring>comboCategory</cstring> 201 <cstring>comboCategory</cstring>
202 </property> 202 </property>
203 </widget> 203 </widget>
204 <widget row="3" column="0" rowspan="2"> 204 <widget row="3" column="0" rowspan="2">
205 <class>QLabel</class> 205 <class>QLabel</class>
206 <property stdset="1"> 206 <property stdset="1">
207 <name>name</name> 207 <name>name</name>
208 <cstring>TextLabel3</cstring> 208 <cstring>TextLabel3</cstring>
209 </property> 209 </property>
210 <property stdset="1"> 210 <property stdset="1">
211 <name>text</name> 211 <name>text</name>
212 <string>Start - End </string> 212 <string>Start - End </string>
213 </property> 213 </property>
214 </widget> 214 </widget>
215 <widget row="3" column="1" > 215 <widget row="3" column="1" >
216 <class>QPushButton</class> 216 <class>QPushButton</class>
217 <property stdset="1"> 217 <property stdset="1">
218 <name>name</name> 218 <name>name</name>
219 <cstring>buttonStart</cstring> 219 <cstring>buttonStart</cstring>
220 </property> 220 </property>
221 <property stdset="1"> 221 <property stdset="1">
222 <name>text</name> 222 <name>text</name>
223 <string>Jan 02 00</string> 223 <string>Jan 02 00</string>
224 </property> 224 </property>
225 <property stdset="1"> 225 <property stdset="1">
226 <name>minimumSize</name> 226 <name>minimumSize</name>
227 <size> 227 <size>
228 <width>70</width> 228 <width>70</width>
229 <height>0</height> 229 <height>0</height>
230 </size> 230 </size>
231 </property> 231 </property>
232 <property stdset="1"> 232 <property stdset="1">
233 <name>maximumSize</name> 233 <name>maximumSize</name>
234 <size> 234 <size>
235 <width>70</width> 235 <width>70</width>
236 <height>32767</height> 236 <height>32767</height>
237 </size> 237 </size>
238 </property> 238 </property>
239 </widget> 239 </widget>
240 <widget row="4" column="1" rowspan="1" colspan="1" > 240 <widget row="4" column="1" rowspan="1" colspan="1" >
241 <class>QLineEdit</class> 241 <class>QLineEdit</class>
242 <property stdset="1"> 242 <property stdset="1">
243 <name>name</name> 243 <name>name</name>
244 <cstring>comboStart</cstring> 244 <cstring>comboStart</cstring>
245 </property> 245 </property>
246 <property stdset="1"> 246 <property stdset="1">
247 <name>minimumSize</name> 247 <name>minimumSize</name>
248 <size> 248 <size>
249 <width>70</width> 249 <width>70</width>
250 <height>0</height> 250 <height>0</height>
251 </size> 251 </size>
252 </property> 252 </property>
253 <property stdset="1"> 253 <property stdset="1">
254 <name>maximumSize</name> 254 <name>maximumSize</name>
255 <size> 255 <size>
256 <width>70</width> 256 <width>70</width>
257 <height>32767</height> 257 <height>32767</height>
258 </size> 258 </size>
259 </property> 259 </property>
260 <property stdset="1"> 260 <property stdset="1">
261 <name>alignment</name> 261 <name>alignment</name>
262 <set>AlignHCenter</set> 262 <set>AlignHCenter</set>
263 </property> 263 </property>
264 <property> 264 <property>
265 <name>hAlign</name> 265 <name>hAlign</name>
266 </property> 266 </property>
267 </widget> 267 </widget>
268 <spacer row="3" column="2" rowspan="2" colspan="1" > 268 <spacer row="3" column="2" rowspan="2" colspan="1" >
269 <property> 269 <property>
270 <name>name</name> 270 <name>name</name>
271 <cstring>Spacer1_2</cstring> 271 <cstring>Spacer1_2</cstring>
272 </property> 272 </property>
273 <property stdset="1"> 273 <property stdset="1">
274 <name>orientation</name> 274 <name>orientation</name>
275 <enum>Horizontal</enum> 275 <enum>Horizontal</enum>
276 </property> 276 </property>
277 <property stdset="1"> 277 <property stdset="1">
278 <name>sizeType</name> 278 <name>sizeType</name>
279 <enum>Expanding</enum> 279 <enum>Expanding</enum>
280 </property> 280 </property>
281 <property> 281 <property>
282 <name>sizeHint</name> 282 <name>sizeHint</name>
283 <size> 283 <size>
284 <width>20</width> 284 <width>20</width>
285 <height>20</height> 285 <height>20</height>
286 </size> 286 </size>
287 </property> 287 </property>
288 </spacer> 288 </spacer>
289 289
290 <widget row="5" column="1" colspan="3"> 290 <widget row="5" column="1" colspan="3">
291 <class>TimePicker</class> 291 <class>OTimePicker</class>
292 <property stdset="1"> 292 <property stdset="1">
293 <name>name</name> 293 <name>name</name>
294 <cstring>timePickerStart</cstring> 294 <cstring>timePickerStart</cstring>
295 </property> 295 </property>
296 </widget> 296 </widget>
297 <widget row="3" column="3" colspan="1"> 297 <widget row="3" column="3" colspan="1">
298 <class>QPushButton</class> 298 <class>QPushButton</class>
299 <property stdset="1"> 299 <property stdset="1">
300 <name>name</name> 300 <name>name</name>
301 <cstring>buttonEnd</cstring> 301 <cstring>buttonEnd</cstring>
302 </property> 302 </property>
303 <property stdset="1"> 303 <property stdset="1">
304 <name>text</name> 304 <name>text</name>
305 <string>Jan 02 00</string> 305 <string>Jan 02 00</string>
306 </property> 306 </property>
307 <property stdset="1"> 307 <property stdset="1">
308 <name>minimumSize</name> 308 <name>minimumSize</name>
309 <size> 309 <size>
310 <width>70</width> 310 <width>70</width>
311 <height>0</height> 311 <height>0</height>
312 </size> 312 </size>
313 </property> 313 </property>
314 <property stdset="1"> 314 <property stdset="1">
315 <name>maximumSize</name> 315 <name>maximumSize</name>
316 <size> 316 <size>
317 <width>70</width> 317 <width>70</width>
318 <height>32767</height> 318 <height>32767</height>
319 </size> 319 </size>
320 </property> 320 </property>
321 </widget> 321 </widget>
322 <widget row="4" column="3" colspan="1"> 322 <widget row="4" column="3" colspan="1">
323 <class>QLineEdit</class> 323 <class>QLineEdit</class>
324 <property stdset="1"> 324 <property stdset="1">
325 <name>name</name> 325 <name>name</name>
326 <cstring>comboEnd</cstring> 326 <cstring>comboEnd</cstring>
327 </property> 327 </property>
328 <property stdset="1"> 328 <property stdset="1">
329 <name>minimumSize</name> 329 <name>minimumSize</name>
330 <size> 330 <size>
331 <width>70</width> 331 <width>70</width>
332 <height>0</height> 332 <height>0</height>
333 </size> 333 </size>
334 </property> 334 </property>
335 <property stdset="1"> 335 <property stdset="1">
336 <name>maximumSize</name> 336 <name>maximumSize</name>
337 <size> 337 <size>
338 <width>70</width> 338 <width>70</width>
339 <height>32767</height> 339 <height>32767</height>
340 </size> 340 </size>
341 </property> 341 </property>
342 <property stdset="1"> 342 <property stdset="1">
343 <name>alignment</name> 343 <name>alignment</name>
344 <set>AlignHCenter</set> 344 <set>AlignHCenter</set>
345 </property> 345 </property>
346 <property> 346 <property>
347 <name>hAlign</name> 347 <name>hAlign</name>
348 </property> 348 </property>
349 </widget> 349 </widget>
350 <widget row="5" column="0" > 350 <widget row="5" column="0" >
351 <class>QLabel</class> 351 <class>QLabel</class>
352 <property stdset="1"> 352 <property stdset="1">
353 <name>name</name> 353 <name>name</name>
354 <cstring>TimePickerLabel</cstring> 354 <cstring>TimePickerLabel</cstring>
355 </property> 355 </property>
356 <property stdset="1"> 356 <property stdset="1">
357 <name>text</name> 357 <name>text</name>
358 <string>Start time</string> 358 <string>Start time</string>
359 </property> 359 </property>
360 </widget> 360 </widget>
361 <widget row="6" column="0" > 361 <widget row="6" column="0" >
362 <class>QCheckBox</class> 362 <class>QCheckBox</class>
363 <property stdset="1"> 363 <property stdset="1">
364 <name>name</name> 364 <name>name</name>
365 <cstring>checkAllDay</cstring> 365 <cstring>checkAllDay</cstring>
366 </property> 366 </property>
367 <property stdset="1"> 367 <property stdset="1">
368 <name>text</name> 368 <name>text</name>
369 <string>All day</string> 369 <string>All day</string>
370 </property> 370 </property>
371 </widget> 371 </widget>
372 <widget row="7" column="0" > 372 <widget row="7" column="0" >
373 <class>QLabel</class> 373 <class>QLabel</class>
374 <property stdset="1"> 374 <property stdset="1">
375 <name>name</name> 375 <name>name</name>
376 <cstring>TextLabel3_2_2</cstring> 376 <cstring>TextLabel3_2_2</cstring>
377 </property> 377 </property>
378 <property stdset="1"> 378 <property stdset="1">
379 <name>text</name> 379 <name>text</name>
380 <string>Time zone</string> 380 <string>Time zone</string>
381 </property> 381 </property>
382 </widget> 382 </widget>
383 <widget row="7" column="1" rowspan="1" colspan="3" > 383 <widget row="7" column="1" rowspan="1" colspan="3" >
384 <class>TimeZoneSelector</class> 384 <class>TimeZoneSelector</class>
385 <property stdset="1"> 385 <property stdset="1">
386 <name>name</name> 386 <name>name</name>
387 <cstring>timezone</cstring> 387 <cstring>timezone</cstring>
388 </property> 388 </property>
389 </widget> 389 </widget>
390 <widget row="8" column="0" > 390 <widget row="8" column="0" >
391 <class>QCheckBox</class> 391 <class>QCheckBox</class>
392 <property stdset="1"> 392 <property stdset="1">
393 <name>name</name> 393 <name>name</name>
394 <cstring>checkAlarm</cstring> 394 <cstring>checkAlarm</cstring>
395 </property> 395 </property>
396 <property stdset="1"> 396 <property stdset="1">
397 <name>enabled</name> 397 <name>enabled</name>
398 <bool>true</bool> 398 <bool>true</bool>
399 </property> 399 </property>
400 <property stdset="1"> 400 <property stdset="1">
401 <name>autoMask</name> 401 <name>autoMask</name>
402 <bool>false</bool> 402 <bool>false</bool>
403 </property> 403 </property>
404 <property stdset="1"> 404 <property stdset="1">
405 <name>text</name> 405 <name>text</name>
406 <string>&amp;Alarm</string> 406 <string>&amp;Alarm</string>
407 </property> 407 </property>
408 <property stdset="1"> 408 <property stdset="1">
409 <name>checked</name> 409 <name>checked</name>
410 <bool>false</bool> 410 <bool>false</bool>
411 </property> 411 </property>
412 </widget> 412 </widget>
413 <widget row="8" column="1" rowspan="1" colspan="2" > 413 <widget row="8" column="1" rowspan="1" colspan="2" >
414 <class>QSpinBox</class> 414 <class>QSpinBox</class>
415 <property stdset="1"> 415 <property stdset="1">
416 <name>name</name> 416 <name>name</name>
417 <cstring>spinAlarm</cstring> 417 <cstring>spinAlarm</cstring>
418 </property> 418 </property>
419 <property stdset="1"> 419 <property stdset="1">
420 <name>enabled</name> 420 <name>enabled</name>
421 <bool>false</bool> 421 <bool>false</bool>
422 </property> 422 </property>
423 <property stdset="1"> 423 <property stdset="1">
424 <name>suffix</name> 424 <name>suffix</name>
425 <string> minutes</string> 425 <string> minutes</string>
426 </property> 426 </property>
427 <property stdset="1"> 427 <property stdset="1">
428 <name>maxValue</name> 428 <name>maxValue</name>
429 <number>180</number> 429 <number>180</number>
430 </property> 430 </property>
431 <property stdset="1"> 431 <property stdset="1">
432 <name>minValue</name> 432 <name>minValue</name>
433 <number>0</number> 433 <number>0</number>
434 </property> 434 </property>
435 <property stdset="1"> 435 <property stdset="1">
436 <name>lineStep</name> 436 <name>lineStep</name>
437 <number>5</number> 437 <number>5</number>
438 </property> 438 </property>
439 <property stdset="1"> 439 <property stdset="1">
440 <name>value</name> 440 <name>value</name>
441 <number>5</number> 441 <number>5</number>
442 </property> 442 </property>
443 </widget> 443 </widget>
444 <widget row="8" column="3" > 444 <widget row="8" column="3" >
445 <class>QComboBox</class> 445 <class>QComboBox</class>
446 <item> 446 <item>
447 <property> 447 <property>
448 <name>text</name> 448 <name>text</name>
449 <string>Silent</string> 449 <string>Silent</string>
450 </property> 450 </property>
451 </item> 451 </item>
452 <item> 452 <item>
453 <property> 453 <property>
454 <name>text</name> 454 <name>text</name>
455 <string>Loud</string> 455 <string>Loud</string>
456 </property> 456 </property>
457 </item> 457 </item>
458 <property stdset="1"> 458 <property stdset="1">
459 <name>name</name> 459 <name>name</name>
460 <cstring>comboSound</cstring> 460 <cstring>comboSound</cstring>
461 </property> 461 </property>
462 <property stdset="1"> 462 <property stdset="1">
463 <name>enabled</name> 463 <name>enabled</name>
464 <bool>false</bool> 464 <bool>false</bool>
465 </property> 465 </property>
466 </widget> 466 </widget>
467 <widget row="9" column="0" > 467 <widget row="9" column="0" >
468 <class>QLabel</class> 468 <class>QLabel</class>
469 <property stdset="1"> 469 <property stdset="1">
470 <name>name</name> 470 <name>name</name>
471 <cstring>lblRepeat</cstring> 471 <cstring>lblRepeat</cstring>
472 </property> 472 </property>
473 <property stdset="1"> 473 <property stdset="1">
474 <name>text</name> 474 <name>text</name>
475 <string>Repeat</string> 475 <string>Repeat</string>
476 </property> 476 </property>
477 </widget> 477 </widget>
478 <widget row="9" column="1" rowspan="1" colspan="3" > 478 <widget row="9" column="1" rowspan="1" colspan="3" >
479 <class>QToolButton</class> 479 <class>QToolButton</class>
480 <property stdset="1"> 480 <property stdset="1">
481 <name>name</name> 481 <name>name</name>
482 <cstring>cmdRepeat</cstring> 482 <cstring>cmdRepeat</cstring>
483 </property> 483 </property>
484 <property stdset="1"> 484 <property stdset="1">
485 <name>focusPolicy</name> 485 <name>focusPolicy</name>
486 <enum>TabFocus</enum> 486 <enum>TabFocus</enum>
487 </property> 487 </property>
488 <property stdset="1"> 488 <property stdset="1">
489 <name>text</name> 489 <name>text</name>
490 <string>No Repeat...</string> 490 <string>No Repeat...</string>
491 </property> 491 </property>
492 <property stdset="1"> 492 <property stdset="1">
493 <name>sizePolicy</name> 493 <name>sizePolicy</name>
494 <sizepolicy> 494 <sizepolicy>
495 <hsizetype>7</hsizetype> 495 <hsizetype>7</hsizetype>
496 <vsizetype>0</vsizetype> 496 <vsizetype>0</vsizetype>
497 </sizepolicy> 497 </sizepolicy>
498 </property> 498 </property>
499 </widget> 499 </widget>
500 <widget row="10" column="0" rowspan="1" colspan="4" > 500 <widget row="10" column="0" rowspan="1" colspan="4" >
501 <class>QToolButton</class> 501 <class>QToolButton</class>
502 <property stdset="1"> 502 <property stdset="1">
503 <name>name</name> 503 <name>name</name>
504 <cstring>editNote</cstring> 504 <cstring>editNote</cstring>
505 </property> 505 </property>
506 <property stdset="1"> 506 <property stdset="1">
507 <name>text</name> 507 <name>text</name>
508 <string>Note...</string> 508 <string>Note...</string>
509 </property> 509 </property>
510 </widget> 510 </widget>
511 </grid> 511 </grid>
512</widget> 512</widget>
513<customwidgets> 513<customwidgets>
514 <customwidget> 514 <customwidget>
515 <class>TimeZoneSelector</class> 515 <class>TimeZoneSelector</class>
516 <header location="global">qpe/tzselect.h</header> 516 <header location="global">qpe/tzselect.h</header>
517 <sizehint> 517 <sizehint>
518 <width>21</width> 518 <width>21</width>
519 <height>10</height> 519 <height>10</height>
520 </sizehint> 520 </sizehint>
521 <container>0</container> 521 <container>0</container>
522 <sizepolicy> 522 <sizepolicy>
523 <hordata>7</hordata> 523 <hordata>7</hordata>
524 <verdata>1</verdata> 524 <verdata>1</verdata>
525 </sizepolicy> 525 </sizepolicy>
526 <pixmap>image0</pixmap> 526 <pixmap>image0</pixmap>
527 </customwidget> 527 </customwidget>
528 <customwidget> 528 <customwidget>
529 <class>CategorySelect</class> 529 <class>CategorySelect</class>
530 <header location="global">qpe/categoryselect.h</header> 530 <header location="global">qpe/categoryselect.h</header>
531 <sizehint> 531 <sizehint>
532 <width>-1</width> 532 <width>-1</width>
533 <height>-1</height> 533 <height>-1</height>
534 </sizehint> 534 </sizehint>
535 <container>0</container> 535 <container>0</container>
536 <sizepolicy> 536 <sizepolicy>
537 <hordata>7</hordata> 537 <hordata>7</hordata>
538 <verdata>1</verdata> 538 <verdata>1</verdata>
539 </sizepolicy> 539 </sizepolicy>
540 <pixmap>image1</pixmap> 540 <pixmap>image1</pixmap>
541 </customwidget> 541 </customwidget>
542 <customwidget> 542 <customwidget>
543 <class>TimePicker</class> 543 <class>OTimePicker</class>
544 <header location="local">timepicker.h</header> 544 <header location="local">opie/otimepicker.h</header>
545 <sizehint> 545 <sizehint>
546 <width>-1</width> 546 <width>-1</width>
547 <height>-1</height> 547 <height>-1</height>
548 </sizehint> 548 </sizehint>
549 <container>0</container> 549 <container>0</container>
550 <sizepolicy> 550 <sizepolicy>
551 <hordata>7</hordata> 551 <hordata>7</hordata>
552 <verdata>1</verdata> 552 <verdata>1</verdata>
553 </sizepolicy> 553 </sizepolicy>
554 <pixmap>image1</pixmap> 554 <pixmap>image1</pixmap>
555 </customwidget> 555 </customwidget>
556</customwidgets> 556</customwidgets>
557<images> 557<images>
558 <image> 558 <image>
559 <name>image0</name> 559 <name>image0</name>
560 <data format="XPM.GZ" length="45">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f</data> 560 <data format="XPM.GZ" length="45">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523250004143a55a6b2e0026630c4f</data>
561 </image> 561 </image>
562 <image> 562 <image>
563 <name>image1</name> 563 <name>image1</name>
564 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 564 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
565 </image> 565 </image>
566</images> 566</images>
567<connections> 567<connections>
568 <connection> 568 <connection>
569 <sender>checkAlarm</sender> 569 <sender>checkAlarm</sender>
570 <signal>toggled(bool)</signal> 570 <signal>toggled(bool)</signal>
571 <receiver>spinAlarm</receiver> 571 <receiver>spinAlarm</receiver>
572 <slot>setEnabled(bool)</slot> 572 <slot>setEnabled(bool)</slot>
573 </connection> 573 </connection>
574 <connection> 574 <connection>
575 <sender>comboEnd</sender> 575 <sender>comboEnd</sender>
576 <signal>textChanged(const QString&amp;)</signal> 576 <signal>textChanged(const QString&amp;)</signal>
577 <receiver>DateEntryBase</receiver> 577 <receiver>DateEntryBase</receiver>
578 <slot>endTimeChanged( const QString &amp; )</slot> 578 <slot>endTimeChanged( const QString &amp; )</slot>
579 </connection> 579 </connection>
580 <connection> 580 <connection>
581 <sender>cmdRepeat</sender> 581 <sender>cmdRepeat</sender>
582 <signal>clicked()</signal> 582 <signal>clicked()</signal>
583 <receiver>DateEntryBase</receiver> 583 <receiver>DateEntryBase</receiver>
584 <slot>slotRepeat()</slot> 584 <slot>slotRepeat()</slot>
585 </connection> 585 </connection>
586 <connection> 586 <connection>
587 <sender>comboStart</sender> 587 <sender>comboStart</sender>
588 <signal>textChanged(const QString &amp;)</signal> 588 <signal>textChanged(const QString &amp;)</signal>
589 <receiver>DateEntryBase</receiver> 589 <receiver>DateEntryBase</receiver>
590 <slot>startTimeEdited( const QString &amp; )</slot> 590 <slot>startTimeEdited( const QString &amp; )</slot>
591 </connection> 591 </connection>
592 <connection> 592 <connection>
593 <sender>checkAllDay</sender> 593 <sender>checkAllDay</sender>
594 <signal>toggled(bool)</signal> 594 <signal>toggled(bool)</signal>
595 <receiver>comboEnd</receiver> 595 <receiver>comboEnd</receiver>
596 <slot>setDisabled(bool)</slot> 596 <slot>setDisabled(bool)</slot>
597 </connection> 597 </connection>
598 <connection> 598 <connection>
599 <sender>checkAllDay</sender> 599 <sender>checkAllDay</sender>
600 <signal>toggled(bool)</signal> 600 <signal>toggled(bool)</signal>
601 <receiver>timePickerStart</receiver> 601 <receiver>timePickerStart</receiver>
602 <slot>setDisabled(bool)</slot> 602 <slot>setDisabled(bool)</slot>
603 </connection> 603 </connection>
604 <connection> 604 <connection>
605 <sender>checkAlarm</sender> 605 <sender>checkAlarm</sender>
606 <signal>toggled(bool)</signal> 606 <signal>toggled(bool)</signal>
607 <receiver>comboSound</receiver> 607 <receiver>comboSound</receiver>
608 <slot>setEnabled(bool)</slot> 608 <slot>setEnabled(bool)</slot>
609 </connection> 609 </connection>
610 <connection> 610 <connection>
611 <sender>checkAllDay</sender> 611 <sender>checkAllDay</sender>
612 <signal>toggled(bool)</signal> 612 <signal>toggled(bool)</signal>
613 <receiver>comboStart</receiver> 613 <receiver>comboStart</receiver>
614 <slot>setDisabled(bool)</slot> 614 <slot>setDisabled(bool)</slot>
615 </connection> 615 </connection>
616 <slot access="public">endDateChanged( const QString &amp; )</slot> 616 <slot access="public">endDateChanged( const QString &amp; )</slot>
617 <slot access="public">endDateChanged( int, int, int )</slot> 617 <slot access="public">endDateChanged( int, int, int )</slot>
618 <slot access="public">endTimeChanged( const QString &amp; )</slot> 618 <slot access="public">endTimeChanged( const QString &amp; )</slot>
619 <slot access="public">slotRepeat()</slot> 619 <slot access="public">slotRepeat()</slot>
620 <slot access="public">slotWait( int )</slot> 620 <slot access="public">slotWait( int )</slot>
621 <slot access="public">startDateChanged( const QString &amp; )</slot> 621 <slot access="public">startDateChanged( const QString &amp; )</slot>
622 <slot access="public">startDateChanged(int, int, int)</slot> 622 <slot access="public">startDateChanged(int, int, int)</slot>
623 <slot access="public">startTimeEdited( const QString &amp; )</slot> 623 <slot access="public">startTimeEdited( const QString &amp; )</slot>
624 <slot access="public">typeChanged( const QString &amp; )</slot> 624 <slot access="public">typeChanged( const QString &amp; )</slot>
625 <slot access="public">tzexecute(void)</slot> 625 <slot access="public">tzexecute(void)</slot>
626</connections> 626</connections>
627</UI> 627</UI>
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index 33b9d9b..13d2ce2 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -1,286 +1,286 @@
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 20
21#include "dateentryimpl.h" 21#include "dateentryimpl.h"
22#include "repeatentry.h" 22#include "repeatentry.h"
23 23
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/categoryselect.h> 25#include <qpe/categoryselect.h>
26#include <qpe/datebookmonth.h> 26#include <qpe/datebookmonth.h>
27#include <qpe/global.h> 27#include <qpe/global.h>
28#include <qpe/timeconversion.h> 28#include <qpe/timeconversion.h>
29#include <qpe/timestring.h> 29#include <qpe/timestring.h>
30#include <qpe/tzselect.h> 30#include <qpe/tzselect.h>
31 31
32#include <qevent.h> 32#include <qevent.h>
33#include <qcheckbox.h> 33#include <qcheckbox.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qmultilineedit.h> 37#include <qmultilineedit.h>
38#include <qpopupmenu.h> 38#include <qpopupmenu.h>
39#include <qscrollview.h> 39#include <qscrollview.h>
40#include <qspinbox.h> 40#include <qspinbox.h>
41#include <qtoolbutton.h> 41#include <qtoolbutton.h>
42 42
43#include "timepicker.h" 43#include <opie/otimepicker.h>
44#include "onoteedit.h" 44#include "onoteedit.h"
45 45
46#include <stdlib.h> 46#include <stdlib.h>
47#include <stdio.h> 47#include <stdio.h>
48 48
49/* 49/*
50 * Constructs a DateEntry which is a child of 'parent', with the 50 * Constructs a DateEntry which is a child of 'parent', with the
51 * name 'name' and widget flags set to 'f' 51 * name 'name' and widget flags set to 'f'
52 * 52 *
53 * The dialog will by default be modeless, unless you set 'modal' to 53 * The dialog will by default be modeless, unless you set 'modal' to
54 * TRUE to construct a modal dialog. 54 * TRUE to construct a modal dialog.
55 */ 55 */
56 56
57DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, 57DateEntry::DateEntry( bool startOnMonday, const QDateTime &start,
58 const QDateTime &end, bool whichClock, QWidget* parent, 58 const QDateTime &end, bool whichClock, QWidget* parent,
59 const char* name ) 59 const char* name )
60 : DateEntryBase( parent, name ), 60 : DateEntryBase( parent, name ),
61 ampm( whichClock ), 61 ampm( whichClock ),
62 startWeekOnMonday( startOnMonday ), 62 startWeekOnMonday( startOnMonday ),
63 m_showStart(true) 63 m_showStart(true)
64{ 64{
65 init(); 65 init();
66 setDates(start,end); 66 setDates(start,end);
67 setFocusProxy(comboDescription); 67 setFocusProxy(comboDescription);
68} 68}
69 69
70bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) 70bool DateEntry::eventFilter(QObject *obj, QEvent *ev )
71{ 71{
72 if( ev->type() == QEvent::FocusIn ){ 72 if( ev->type() == QEvent::FocusIn ){
73 if( obj == comboStart ){ 73 if( obj == comboStart ){
74 timePickerStart->setHour(startTime.hour()); 74 timePickerStart->setHour(startTime.hour());
75 timePickerStart->setMinute(startTime.minute()); 75 timePickerStart->setMinute(startTime.minute());
76 TimePickerLabel->setText( tr("Start Time" ) ); 76 TimePickerLabel->setText( tr("Start Time" ) );
77 m_showStart= true; 77 m_showStart= true;
78 }else if( obj == comboEnd ){ 78 }else if( obj == comboEnd ){
79 timePickerStart->setHour(endTime.hour()); 79 timePickerStart->setHour(endTime.hour());
80 timePickerStart->setMinute(endTime.minute()); 80 timePickerStart->setMinute(endTime.minute());
81 TimePickerLabel->setText( tr("End Time") ); 81 TimePickerLabel->setText( tr("End Time") );
82 m_showStart = false; 82 m_showStart = false;
83 } 83 }
84 } else if( ev->type() == QEvent::FocusOut ){ 84 } else if( ev->type() == QEvent::FocusOut ){
85 if( obj == comboEnd ){ 85// if( obj == comboEnd ){
86 QString s; 86// QString s;
87 s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute()); 87// s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute());
88 comboEnd->setText(s); 88// comboEnd->setText(s);
89 } 89// }
90 else if( obj == comboStart ){ 90// else if( obj == comboStart ){
91 QString s; 91// QString s;
92 s.sprintf("%.2d:%.2d",startTime.hour(), startTime.minute()); 92// s.sprintf("%.2d:%.2d",startTime.hour(), startTime.minute());
93 comboStart->setText(s); 93// comboStart->setText(s);
94 } 94// }
95 } 95 }
96 96
97 return false; 97 return false;
98} 98}
99 99
100static void addOrPick( QComboBox* combo, const QString& t ) 100static void addOrPick( QComboBox* combo, const QString& t )
101{ 101{
102 // Pick an item if one excists 102 // Pick an item if one excists
103 for (int i=0; i<combo->count(); i++) { 103 for (int i=0; i<combo->count(); i++) {
104 if ( combo->text(i) == t ) { 104 if ( combo->text(i) == t ) {
105 combo->setCurrentItem(i); 105 combo->setCurrentItem(i);
106 return; 106 return;
107 } 107 }
108 } 108 }
109 109
110 // Else add one 110 // Else add one
111 combo->insertItem(t); 111 combo->insertItem(t);
112 combo->setCurrentItem(combo->count()-1); 112 combo->setCurrentItem(combo->count()-1);
113} 113}
114 114
115DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock, 115DateEntry::DateEntry( bool startOnMonday, const Event &event, bool whichClock,
116 QWidget* parent, const char* name ) 116 QWidget* parent, const char* name )
117 : DateEntryBase( parent, name ), 117 : DateEntryBase( parent, name ),
118 ampm( whichClock ), 118 ampm( whichClock ),
119 startWeekOnMonday( startOnMonday ), 119 startWeekOnMonday( startOnMonday ),
120 m_showStart(true) 120 m_showStart(true)
121 121
122{ 122{
123 init(); 123 init();
124 setDates(event.start(),event.end()); 124 setDates(event.start(),event.end());
125 comboCategory->setCategories( event.categories(), "Calendar", tr("Calendar") ); 125 comboCategory->setCategories( event.categories(), "Calendar", tr("Calendar") );
126 if(!event.description().isEmpty()) 126 if(!event.description().isEmpty())
127 addOrPick( comboDescription, event.description() ); 127 addOrPick( comboDescription, event.description() );
128 if(!event.location().isEmpty()) 128 if(!event.location().isEmpty())
129 addOrPick( comboLocation, event.location() ); 129 addOrPick( comboLocation, event.location() );
130 checkAlarm->setChecked( event.hasAlarm() ); 130 checkAlarm->setChecked( event.hasAlarm() );
131 checkAllDay->setChecked( event.type() == Event::AllDay ); 131 checkAllDay->setChecked( event.type() == Event::AllDay );
132 if(!event.notes().isEmpty()) noteStr=event.notes(); 132 if(!event.notes().isEmpty()) noteStr=event.notes();
133 else noteStr=""; 133 else noteStr="";
134 spinAlarm->setValue(event.alarmTime()); 134 spinAlarm->setValue(event.alarmTime());
135 if ( event.alarmSound() != Event::Silent ) 135 if ( event.alarmSound() != Event::Silent )
136 comboSound->setCurrentItem( 1 ); 136 comboSound->setCurrentItem( 1 );
137 if ( event.hasRepeat() ) { 137 if ( event.hasRepeat() ) {
138 rp = event.repeatPattern(); 138 rp = event.repeatPattern();
139 cmdRepeat->setText( tr("Repeat...") ); 139 cmdRepeat->setText( tr("Repeat...") );
140 } 140 }
141 setRepeatLabel(); 141 setRepeatLabel();
142} 142}
143 143
144void DateEntry::setDates( const QDateTime& s, const QDateTime& e ) 144void DateEntry::setDates( const QDateTime& s, const QDateTime& e )
145{ 145{
146 startDate = s.date(); 146 startDate = s.date();
147 endDate = e.date(); 147 endDate = e.date();
148 startTime = s.time(); 148 startTime = s.time();
149 endTime = e.time(); 149 endTime = e.time();
150 150
151 startDateChanged( s.date().year(), s.date().month(), s.date().day() ); 151 startDateChanged( s.date().year(), s.date().month(), s.date().day() );
152 endDateChanged( e.date().year(), e.date().month(), e.date().day() ); 152 endDateChanged( e.date().year(), e.date().month(), e.date().day() );
153 153
154 updateTimeEdit(true,true); 154 updateTimeEdit(true,true);
155} 155}
156 156
157void DateEntry::updateTimeEdit(bool s, bool e) { 157void DateEntry::updateTimeEdit(bool s, bool e) {
158 158
159 // Comboboxes 159 // Comboboxes
160 QString strStart, strEnd; 160 QString strStart, strEnd;
161 int shour, ehour; 161 int shour, ehour;
162 if ( ampm ) { 162 if ( ampm ) {
163 shour = startTime.hour(); 163 shour = startTime.hour();
164 ehour = endTime.hour(); 164 ehour = endTime.hour();
165 if ( shour >= 12 ) { 165 if ( shour >= 12 ) {
166 if ( shour > 12 ) 166 if ( shour > 12 )
167 shour -= 12; 167 shour -= 12;
168 strStart.sprintf( "%d:%02d PM", shour, startTime.minute() ); 168 strStart.sprintf( "%d:%02d PM", shour, startTime.minute() );
169 } else { 169 } else {
170 if ( shour == 0 ) 170 if ( shour == 0 )
171 shour = 12; 171 shour = 12;
172 strStart.sprintf( "%d:%02d AM", shour, startTime.minute() ); 172 strStart.sprintf( "%d:%02d AM", shour, startTime.minute() );
173 } 173 }
174 if ( ehour == 24 && endTime.minute() == 0 ) { 174 if ( ehour == 24 && endTime.minute() == 0 ) {
175 strEnd = "11:59 PM"; // or "midnight" 175 strEnd = "11:59 PM"; // or "midnight"
176 } else if ( ehour >= 12 ) { 176 } else if ( ehour >= 12 ) {
177 if ( ehour > 12 ) 177 if ( ehour > 12 )
178 ehour -= 12; 178 ehour -= 12;
179 strEnd.sprintf( "%d:%02d PM", ehour, endTime.minute() ); 179 strEnd.sprintf( "%d:%02d PM", ehour, endTime.minute() );
180 } else { 180 } else {
181 if ( ehour == 0 ) 181 if ( ehour == 0 )
182 ehour = 12; 182 ehour = 12;
183 strEnd.sprintf( "%d:%02d AM", ehour, endTime.minute() ); 183 strEnd.sprintf( "%d:%02d AM", ehour, endTime.minute() );
184 } 184 }
185 } else { 185 } else {
186 strStart.sprintf( "%02d:%02d", startTime.hour(), startTime.minute() ); 186 strStart.sprintf( "%02d:%02d", startTime.hour(), startTime.minute() );
187 strEnd.sprintf( "%02d:%02d", endTime.hour(), endTime.minute() ); 187 strEnd.sprintf( "%02d:%02d", endTime.hour(), endTime.minute() );
188 } 188 }
189 189
190 if (s) comboStart->setText(strStart); 190 if (s) comboStart->setText(strStart);
191 if (e) comboEnd->setText(strEnd); 191 if (e) comboEnd->setText(strEnd);
192} 192}
193 193
194void DateEntry::init() 194void DateEntry::init()
195{ 195{
196 comboDescription->setInsertionPolicy(QComboBox::AtCurrent); 196 comboDescription->setInsertionPolicy(QComboBox::AtCurrent);
197 comboLocation->setInsertionPolicy(QComboBox::AtCurrent); 197 comboLocation->setInsertionPolicy(QComboBox::AtCurrent);
198 198
199 initCombos(); 199 initCombos();
200 QPopupMenu *m1 = new QPopupMenu( this ); 200 QPopupMenu *m1 = new QPopupMenu( this );
201 startPicker = new DateBookMonth( m1, 0, TRUE ); 201 startPicker = new DateBookMonth( m1, 0, TRUE );
202 m1->insertItem( startPicker ); 202 m1->insertItem( startPicker );
203 buttonStart->setPopup( m1 ); 203 buttonStart->setPopup( m1 );
204 connect( startPicker, SIGNAL( dateClicked( int, int, int ) ), 204 connect( startPicker, SIGNAL( dateClicked( int, int, int ) ),
205 this, SLOT( startDateChanged( int, int, int ) ) ); 205 this, SLOT( startDateChanged( int, int, int ) ) );
206 206
207 //Let start button change both start and end dates 207 //Let start button change both start and end dates
208 connect( startPicker, SIGNAL( dateClicked( int, int, int ) ), 208 connect( startPicker, SIGNAL( dateClicked( int, int, int ) ),
209 this, SLOT( endDateChanged( int, int, int ) ) ); 209 this, SLOT( endDateChanged( int, int, int ) ) );
210 connect( qApp, SIGNAL( clockChanged( bool ) ), 210 connect( qApp, SIGNAL( clockChanged( bool ) ),
211 this, SLOT( slotChangeClock( bool ) ) ); 211 this, SLOT( slotChangeClock( bool ) ) );
212 connect( qApp, SIGNAL(weekChanged(bool)), 212 connect( qApp, SIGNAL(weekChanged(bool)),
213 this, SLOT(slotChangeStartOfWeek(bool)) ); 213 this, SLOT(slotChangeStartOfWeek(bool)) );
214 214
215 connect( editNote, SIGNAL(clicked()), 215 connect( editNote, SIGNAL(clicked()),
216 this, SLOT(slotEditNote()) ); 216 this, SLOT(slotEditNote()) );
217 217
218 QPopupMenu *m2 = new QPopupMenu( this ); 218 QPopupMenu *m2 = new QPopupMenu( this );
219 endPicker = new DateBookMonth( m2, 0, TRUE ); 219 endPicker = new DateBookMonth( m2, 0, TRUE );
220 m2->insertItem( endPicker ); 220 m2->insertItem( endPicker );
221 buttonEnd->setPopup( m2 ); 221 buttonEnd->setPopup( m2 );
222 connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), 222 connect( endPicker, SIGNAL( dateClicked( int, int, int ) ),
223 this, SLOT( endDateChanged( int, int, int ) ) ); 223 this, SLOT( endDateChanged( int, int, int ) ) );
224 224
225 connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ), 225 connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ),
226 this, SLOT( startTimePicked(const QTime &) )); 226 this, SLOT( startTimePicked(const QTime &) ));
227 // install eventFilters 227 // install eventFilters
228 comboEnd->installEventFilter( this ); 228 comboEnd->installEventFilter( this );
229 comboStart->installEventFilter( this ); 229 comboStart->installEventFilter( this );
230} 230}
231 231
232/* 232/*
233 * Destroys the object and frees any allocated resources 233 * Destroys the object and frees any allocated resources
234 */ 234 */
235DateEntry::~DateEntry() 235DateEntry::~DateEntry()
236{ 236{
237 // no need to delete child widgets, Qt does it all for us 237 // no need to delete child widgets, Qt does it all for us
238 //cout << "Del: " << comboStart->currentText() << endl; 238 //cout << "Del: " << comboStart->currentText() << endl;
239} 239}
240 240
241/* 241/*
242 * public slot 242 * public slot
243 */ 243 */
244 244
245void DateEntry::slotEditNote() { 245void DateEntry::slotEditNote() {
246 QString s; 246 QString s;
247 s = "<B>"+ TimeString::longDateString( startDate ) + "</B>"; 247 s = "<B>"+ TimeString::longDateString( startDate ) + "</B>";
248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month()); 248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month());
249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, 249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr,
250 this,0,TRUE); 250 this,0,TRUE);
251 251
252#if defined(Q_WS_QWS) || defined(_WS_QWS_) 252#if defined(Q_WS_QWS) || defined(_WS_QWS_)
253 noteDlg.showMaximized(); 253 noteDlg.showMaximized();
254#endif 254#endif
255 if (noteDlg.exec() ) { 255 if (noteDlg.exec() ) {
256 noteStr=noteDlg.note->text(); 256 noteStr=noteDlg.note->text();
257 } 257 }
258 258
259} 259}
260 260
261void DateEntry::endDateChanged( int y, int m, int d ) 261void DateEntry::endDateChanged( int y, int m, int d )
262{ 262{
263 endDate.setYMD( y, m, d ); 263 endDate.setYMD( y, m, d );
264 if ( endDate < startDate ) { 264 if ( endDate < startDate ) {
265 endDate = startDate; 265 endDate = startDate;
266 } 266 }
267 267
268 buttonEnd->setText( TimeString::shortDate( endDate ) ); 268 buttonEnd->setText( TimeString::shortDate( endDate ) );
269 269
270 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() ); 270 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() );
271} 271}
272 272
273static QTime parseTime( const QString& s, bool ampm ) 273static QTime parseTime( const QString& s, bool ampm )
274{ 274{
275 QTime tmpTime; 275 QTime tmpTime;
276 QStringList l = QStringList::split( ':', s ); 276 QStringList l = QStringList::split( ':', s );
277 int hour = l[0].toInt(); 277 int hour = l[0].toInt();
278 if ( ampm ) { 278 if ( ampm ) {
279 int i=0; 279 int i=0;
280 while (i<int(l[1].length()) && l[1][i]>='0' && l[1][i]<='9') 280 while (i<int(l[1].length()) && l[1][i]>='0' && l[1][i]<='9')
281 i++; 281 i++;
282 QString digits = l[1].left(i); 282 QString digits = l[1].left(i);
283 if ( l[1].contains( "PM", FALSE ) ) { 283 if ( l[1].contains( "PM", FALSE ) ) {
284 if ( hour != 12 ) 284 if ( hour != 12 )
285 hour += 12; 285 hour += 12;
286 } else { 286 } else {
diff --git a/core/pim/datebook/timepicker.cpp b/core/pim/datebook/timepicker.cpp
deleted file mode 100644
index f2cb71d..0000000
--- a/core/pim/datebook/timepicker.cpp
+++ b/dev/null
@@ -1,119 +0,0 @@
1#include "timepicker.h"
2
3#include <qbuttongroup.h>
4#include <qtoolbutton.h>
5#include <qlayout.h>
6#include <qstring.h>
7#include <stdio.h>
8
9TimePicker::TimePicker(QWidget* parent, const char* name,
10 WFlags fl) :
11 QWidget(parent,name,fl)
12{
13 QVBoxLayout *vbox=new QVBoxLayout(this);
14
15 OClickableLabel *r;
16 QString s;
17
18 // Hour Row
19 QWidget *row=new QWidget(this);
20 QHBoxLayout *l=new QHBoxLayout(row);
21 vbox->addWidget(row);
22
23
24 for (int i=0; i<24; i++) {
25 r=new OClickableLabel(row);
26 hourLst.append(r);
27 s.sprintf("%.2d",i);
28 r->setText(s);
29 r->setToggleButton(true);
30 r->setAlignment(AlignHCenter | AlignVCenter);
31 l->addWidget(r);
32 connect(r, SIGNAL(toggled(bool)),
33 this, SLOT(slotHour(bool)));
34
35 if (i==11) { // Second row
36 row=new QWidget(this);
37 l=new QHBoxLayout(row);
38 vbox->addWidget(row);
39 }
40 }
41
42 // Minute Row
43 row=new QWidget(this);
44 l=new QHBoxLayout(row);
45 vbox->addWidget(row);
46
47 for (int i=0; i<60; i+=5) {
48 r=new OClickableLabel(row);
49 minuteLst.append(r);
50 s.sprintf("%.2d",i);
51 r->setText(s);
52 r->setToggleButton(true);
53 r->setAlignment(AlignHCenter | AlignVCenter);
54 l->addWidget(r);
55 connect(r, SIGNAL(toggled(bool)),
56 this, SLOT(slotMinute(bool)));
57 }
58}
59
60void TimePicker::slotHour(bool b) {
61
62 OClickableLabel *r = (OClickableLabel *) sender();
63
64 if (b) {
65 QValueListIterator<OClickableLabel *> it;
66 for (it=hourLst.begin(); it!=hourLst.end(); it++) {
67 if (*it != r) (*it)->setOn(false);
68 else tm.setHMS((*it)->text().toInt(), tm.minute(), 0);
69 }
70 emit timeChanged(tm);
71 } else {
72 r->setOn(true);
73 }
74
75}
76
77void TimePicker::slotMinute(bool b) {
78
79 OClickableLabel *r = (OClickableLabel *) sender();
80
81 if (b) {
82 QValueListIterator<OClickableLabel *> it;
83 for (it=minuteLst.begin(); it!=minuteLst.end(); it++) {
84 if (*it != r) (*it)->setOn(false);
85 else tm.setHMS(tm.hour(),(*it)->text().toInt(), 0);
86 }
87 emit timeChanged(tm);
88 } else {
89 r->setOn(true);
90 }
91
92}
93
94void TimePicker::setMinute(int m) {
95
96 QString minute;
97 minute.sprintf("%.2d",m);
98
99 QValueListIterator<OClickableLabel *> it;
100 for (it=minuteLst.begin(); it!=minuteLst.end(); it++) {
101 if ((*it)->text() == minute) (*it)->setOn(true);
102 else (*it)->setOn(false);
103 }
104
105 tm.setHMS(tm.hour(),m,0);
106}
107
108void TimePicker::setHour(int h) {
109
110 QString hour;
111 hour.sprintf("%.2d",h);
112
113 QValueListIterator<OClickableLabel *> it;
114 for (it=hourLst.begin(); it!=hourLst.end(); it++) {
115 if ((*it)->text() == hour) (*it)->setOn(true);
116 else (*it)->setOn(false);
117 }
118 tm.setHMS(h,tm.minute(),0);
119}
diff --git a/core/pim/datebook/timepicker.h b/core/pim/datebook/timepicker.h
deleted file mode 100644
index 1c35600..0000000
--- a/core/pim/datebook/timepicker.h
+++ b/dev/null
@@ -1,32 +0,0 @@
1#ifndef TIMEPICKER_H
2#define TIMEPICKER_H
3
4#include <qwidget.h>
5#include <qvaluelist.h>
6#include <opie/oclickablelabel.h>
7#include <qdatetime.h>
8
9class TimePicker: public QWidget {
10 Q_OBJECT
11
12 public:
13 TimePicker(QWidget* parent = 0, const char* name = 0,
14 WFlags fl = 0);
15 void setHour(int h);
16 void setMinute(int m);
17
18 private:
19 QValueList<OClickableLabel *> hourLst;
20 QValueList<OClickableLabel *> minuteLst;
21 QTime tm;
22
23 private slots:
24 void slotHour(bool b);
25 void slotMinute(bool b);
26
27 signals:
28 void timeChanged(const QTime &);
29};
30
31
32#endif