-rw-r--r-- | noncore/tools/clock/alarmdlgbase.ui | 490 | ||||
-rw-r--r-- | noncore/tools/clock/clock.cpp | 19 | ||||
-rw-r--r-- | noncore/tools/clock/clock.h | 1 |
3 files changed, 494 insertions, 16 deletions
diff --git a/noncore/tools/clock/alarmdlgbase.ui b/noncore/tools/clock/alarmdlgbase.ui index 63759f3..944f532 100644 --- a/noncore/tools/clock/alarmdlgbase.ui +++ b/noncore/tools/clock/alarmdlgbase.ui | |||
@@ -1,73 +1,73 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>AlarmDlgBase</class> | 2 | <class>AlarmDlgBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>AlarmDlgBase</cstring> | 7 | <cstring>AlarmDlgBase</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>124</width> | 14 | <width>199</width> |
15 | <height>92</height> | 15 | <height>243</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Form1</string> | 20 | <string>Form1</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <vbox> | 25 | <vbox> |
26 | <property stdset="1"> | 26 | <property stdset="1"> |
27 | <name>margin</name> | 27 | <name>margin</name> |
28 | <number>6</number> | 28 | <number>11</number> |
29 | </property> | 29 | </property> |
30 | <property stdset="1"> | 30 | <property stdset="1"> |
31 | <name>spacing</name> | 31 | <name>spacing</name> |
32 | <number>6</number> | 32 | <number>6</number> |
33 | </property> | 33 | </property> |
34 | <widget> | 34 | <widget> |
35 | <class>QLayoutWidget</class> | 35 | <class>QLayoutWidget</class> |
36 | <property stdset="1"> | 36 | <property stdset="1"> |
37 | <name>name</name> | 37 | <name>name</name> |
38 | <cstring>Layout1</cstring> | 38 | <cstring>Layout1</cstring> |
39 | </property> | 39 | </property> |
40 | <hbox> | 40 | <hbox> |
41 | <property stdset="1"> | 41 | <property stdset="1"> |
42 | <name>margin</name> | 42 | <name>margin</name> |
43 | <number>0</number> | 43 | <number>0</number> |
44 | </property> | 44 | </property> |
45 | <property stdset="1"> | 45 | <property stdset="1"> |
46 | <name>spacing</name> | 46 | <name>spacing</name> |
47 | <number>6</number> | 47 | <number>6</number> |
48 | </property> | 48 | </property> |
49 | <widget> | 49 | <widget> |
50 | <class>QLabel</class> | 50 | <class>QLabel</class> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>name</name> | 52 | <name>name</name> |
53 | <cstring>pixmap</cstring> | 53 | <cstring>pixmap</cstring> |
54 | </property> | 54 | </property> |
55 | <property stdset="1"> | 55 | <property stdset="1"> |
56 | <name>scaledContents</name> | 56 | <name>scaledContents</name> |
57 | <bool>true</bool> | 57 | <bool>false</bool> |
58 | </property> | 58 | </property> |
59 | </widget> | 59 | </widget> |
60 | <spacer> | 60 | <spacer> |
61 | <property> | 61 | <property> |
62 | <name>name</name> | 62 | <name>name</name> |
63 | <cstring>Spacer1</cstring> | 63 | <cstring>Spacer1</cstring> |
64 | </property> | 64 | </property> |
65 | <property stdset="1"> | 65 | <property stdset="1"> |
66 | <name>orientation</name> | 66 | <name>orientation</name> |
67 | <enum>Horizontal</enum> | 67 | <enum>Horizontal</enum> |
68 | </property> | 68 | </property> |
69 | <property stdset="1"> | 69 | <property stdset="1"> |
70 | <name>sizeType</name> | 70 | <name>sizeType</name> |
71 | <enum>Expanding</enum> | 71 | <enum>Expanding</enum> |
72 | </property> | 72 | </property> |
73 | <property> | 73 | <property> |
@@ -75,32 +75,36 @@ | |||
75 | <size> | 75 | <size> |
76 | <width>20</width> | 76 | <width>20</width> |
77 | <height>20</height> | 77 | <height>20</height> |
78 | </size> | 78 | </size> |
79 | </property> | 79 | </property> |
80 | </spacer> | 80 | </spacer> |
81 | <widget> | 81 | <widget> |
82 | <class>QLabel</class> | 82 | <class>QLabel</class> |
83 | <property stdset="1"> | 83 | <property stdset="1"> |
84 | <name>name</name> | 84 | <name>name</name> |
85 | <cstring>alarmDlgLabel</cstring> | 85 | <cstring>alarmDlgLabel</cstring> |
86 | </property> | 86 | </property> |
87 | <property stdset="1"> | 87 | <property stdset="1"> |
88 | <name>text</name> | 88 | <name>text</name> |
89 | <string>TextLabel1</string> | 89 | <string>TextLabel1</string> |
90 | </property> | 90 | </property> |
91 | <property stdset="1"> | ||
92 | <name>scaledContents</name> | ||
93 | <bool>false</bool> | ||
94 | </property> | ||
91 | </widget> | 95 | </widget> |
92 | </hbox> | 96 | </hbox> |
93 | </widget> | 97 | </widget> |
94 | <widget> | 98 | <widget> |
95 | <class>QLayoutWidget</class> | 99 | <class>QLayoutWidget</class> |
96 | <property stdset="1"> | 100 | <property stdset="1"> |
97 | <name>name</name> | 101 | <name>name</name> |
98 | <cstring>Layout2</cstring> | 102 | <cstring>Layout2</cstring> |
99 | </property> | 103 | </property> |
100 | <hbox> | 104 | <hbox> |
101 | <property stdset="1"> | 105 | <property stdset="1"> |
102 | <name>margin</name> | 106 | <name>margin</name> |
103 | <number>0</number> | 107 | <number>0</number> |
104 | </property> | 108 | </property> |
105 | <property stdset="1"> | 109 | <property stdset="1"> |
106 | <name>spacing</name> | 110 | <name>spacing</name> |
@@ -111,44 +115,522 @@ | |||
111 | <property stdset="1"> | 115 | <property stdset="1"> |
112 | <name>name</name> | 116 | <name>name</name> |
113 | <cstring>TextLabel2</cstring> | 117 | <cstring>TextLabel2</cstring> |
114 | </property> | 118 | </property> |
115 | <property stdset="1"> | 119 | <property stdset="1"> |
116 | <name>text</name> | 120 | <name>text</name> |
117 | <string>Snooze</string> | 121 | <string>Snooze</string> |
118 | </property> | 122 | </property> |
119 | </widget> | 123 | </widget> |
120 | <widget> | 124 | <widget> |
121 | <class>QSpinBox</class> | 125 | <class>QSpinBox</class> |
122 | <property stdset="1"> | 126 | <property stdset="1"> |
123 | <name>name</name> | 127 | <name>name</name> |
124 | <cstring>snoozeTime</cstring> | 128 | <cstring>snoozeTime</cstring> |
125 | </property> | 129 | </property> |
126 | <property stdset="1"> | 130 | <property stdset="1"> |
131 | <name>caption</name> | ||
132 | <string></string> | ||
133 | </property> | ||
134 | <property stdset="1"> | ||
127 | <name>suffix</name> | 135 | <name>suffix</name> |
128 | <string> mins</string> | 136 | <string> mins</string> |
129 | </property> | 137 | </property> |
130 | <property stdset="1"> | 138 | <property stdset="1"> |
131 | <name>maxValue</name> | 139 | <name>maxValue</name> |
132 | <number>60</number> | 140 | <number>60</number> |
133 | </property> | 141 | </property> |
134 | <property stdset="1"> | 142 | <property stdset="1"> |
135 | <name>lineStep</name> | 143 | <name>lineStep</name> |
136 | <number>5</number> | 144 | <number>5</number> |
137 | </property> | 145 | </property> |
146 | <property stdset="1"> | ||
147 | <name>value</name> | ||
148 | <number>5</number> | ||
149 | </property> | ||
150 | <property> | ||
151 | <name>layoutMargin</name> | ||
152 | </property> | ||
138 | </widget> | 153 | </widget> |
139 | </hbox> | 154 | </hbox> |
140 | </widget> | 155 | </widget> |
141 | <widget> | 156 | <widget> |
142 | <class>QPushButton</class> | 157 | <class>QPushButton</class> |
143 | <property stdset="1"> | 158 | <property stdset="1"> |
144 | <name>name</name> | 159 | <name>name</name> |
160 | <cstring>cmdSnooze</cstring> | ||
161 | </property> | ||
162 | <property stdset="1"> | ||
163 | <name>minimumSize</name> | ||
164 | <size> | ||
165 | <width>0</width> | ||
166 | <height>100</height> | ||
167 | </size> | ||
168 | </property> | ||
169 | <property stdset="1"> | ||
170 | <name>palette</name> | ||
171 | <palette> | ||
172 | <active> | ||
173 | <color> | ||
174 | <red>0</red> | ||
175 | <green>0</green> | ||
176 | <blue>0</blue> | ||
177 | </color> | ||
178 | <color> | ||
179 | <red>255</red> | ||
180 | <green>128</green> | ||
181 | <blue>128</blue> | ||
182 | </color> | ||
183 | <color> | ||
184 | <red>255</red> | ||
185 | <green>255</green> | ||
186 | <blue>255</blue> | ||
187 | </color> | ||
188 | <color> | ||
189 | <red>255</red> | ||
190 | <green>191</green> | ||
191 | <blue>191</blue> | ||
192 | </color> | ||
193 | <color> | ||
194 | <red>127</red> | ||
195 | <green>64</green> | ||
196 | <blue>64</blue> | ||
197 | </color> | ||
198 | <color> | ||
199 | <red>170</red> | ||
200 | <green>85</green> | ||
201 | <blue>85</blue> | ||
202 | </color> | ||
203 | <color> | ||
204 | <red>0</red> | ||
205 | <green>0</green> | ||
206 | <blue>0</blue> | ||
207 | </color> | ||
208 | <color> | ||
209 | <red>255</red> | ||
210 | <green>255</green> | ||
211 | <blue>255</blue> | ||
212 | </color> | ||
213 | <color> | ||
214 | <red>0</red> | ||
215 | <green>0</green> | ||
216 | <blue>0</blue> | ||
217 | </color> | ||
218 | <color> | ||
219 | <red>255</red> | ||
220 | <green>255</green> | ||
221 | <blue>255</blue> | ||
222 | </color> | ||
223 | <color> | ||
224 | <red>238</red> | ||
225 | <green>238</green> | ||
226 | <blue>230</blue> | ||
227 | </color> | ||
228 | <color> | ||
229 | <red>0</red> | ||
230 | <green>0</green> | ||
231 | <blue>0</blue> | ||
232 | </color> | ||
233 | <color> | ||
234 | <red>255</red> | ||
235 | <green>221</green> | ||
236 | <blue>118</blue> | ||
237 | </color> | ||
238 | <color> | ||
239 | <red>0</red> | ||
240 | <green>0</green> | ||
241 | <blue>0</blue> | ||
242 | </color> | ||
243 | </active> | ||
244 | <disabled> | ||
245 | <color> | ||
246 | <red>128</red> | ||
247 | <green>128</green> | ||
248 | <blue>128</blue> | ||
249 | </color> | ||
250 | <color> | ||
251 | <red>255</red> | ||
252 | <green>128</green> | ||
253 | <blue>128</blue> | ||
254 | </color> | ||
255 | <color> | ||
256 | <red>255</red> | ||
257 | <green>255</green> | ||
258 | <blue>255</blue> | ||
259 | </color> | ||
260 | <color> | ||
261 | <red>255</red> | ||
262 | <green>166</green> | ||
263 | <blue>166</blue> | ||
264 | </color> | ||
265 | <color> | ||
266 | <red>127</red> | ||
267 | <green>64</green> | ||
268 | <blue>64</blue> | ||
269 | </color> | ||
270 | <color> | ||
271 | <red>170</red> | ||
272 | <green>85</green> | ||
273 | <blue>85</blue> | ||
274 | </color> | ||
275 | <color> | ||
276 | <red>0</red> | ||
277 | <green>0</green> | ||
278 | <blue>0</blue> | ||
279 | </color> | ||
280 | <color> | ||
281 | <red>255</red> | ||
282 | <green>255</green> | ||
283 | <blue>255</blue> | ||
284 | </color> | ||
285 | <color> | ||
286 | <red>128</red> | ||
287 | <green>128</green> | ||
288 | <blue>128</blue> | ||
289 | </color> | ||
290 | <color> | ||
291 | <red>255</red> | ||
292 | <green>255</green> | ||
293 | <blue>255</blue> | ||
294 | </color> | ||
295 | <color> | ||
296 | <red>238</red> | ||
297 | <green>238</green> | ||
298 | <blue>230</blue> | ||
299 | </color> | ||
300 | <color> | ||
301 | <red>0</red> | ||
302 | <green>0</green> | ||
303 | <blue>0</blue> | ||
304 | </color> | ||
305 | <color> | ||
306 | <red>255</red> | ||
307 | <green>221</green> | ||
308 | <blue>118</blue> | ||
309 | </color> | ||
310 | <color> | ||
311 | <red>0</red> | ||
312 | <green>0</green> | ||
313 | <blue>0</blue> | ||
314 | </color> | ||
315 | </disabled> | ||
316 | <inactive> | ||
317 | <color> | ||
318 | <red>0</red> | ||
319 | <green>0</green> | ||
320 | <blue>0</blue> | ||
321 | </color> | ||
322 | <color> | ||
323 | <red>255</red> | ||
324 | <green>128</green> | ||
325 | <blue>128</blue> | ||
326 | </color> | ||
327 | <color> | ||
328 | <red>255</red> | ||
329 | <green>255</green> | ||
330 | <blue>255</blue> | ||
331 | </color> | ||
332 | <color> | ||
333 | <red>255</red> | ||
334 | <green>166</green> | ||
335 | <blue>166</blue> | ||
336 | </color> | ||
337 | <color> | ||
338 | <red>127</red> | ||
339 | <green>64</green> | ||
340 | <blue>64</blue> | ||
341 | </color> | ||
342 | <color> | ||
343 | <red>170</red> | ||
344 | <green>85</green> | ||
345 | <blue>85</blue> | ||
346 | </color> | ||
347 | <color> | ||
348 | <red>0</red> | ||
349 | <green>0</green> | ||
350 | <blue>0</blue> | ||
351 | </color> | ||
352 | <color> | ||
353 | <red>255</red> | ||
354 | <green>255</green> | ||
355 | <blue>255</blue> | ||
356 | </color> | ||
357 | <color> | ||
358 | <red>0</red> | ||
359 | <green>0</green> | ||
360 | <blue>0</blue> | ||
361 | </color> | ||
362 | <color> | ||
363 | <red>255</red> | ||
364 | <green>255</green> | ||
365 | <blue>255</blue> | ||
366 | </color> | ||
367 | <color> | ||
368 | <red>238</red> | ||
369 | <green>238</green> | ||
370 | <blue>230</blue> | ||
371 | </color> | ||
372 | <color> | ||
373 | <red>0</red> | ||
374 | <green>0</green> | ||
375 | <blue>0</blue> | ||
376 | </color> | ||
377 | <color> | ||
378 | <red>255</red> | ||
379 | <green>221</green> | ||
380 | <blue>118</blue> | ||
381 | </color> | ||
382 | <color> | ||
383 | <red>0</red> | ||
384 | <green>0</green> | ||
385 | <blue>0</blue> | ||
386 | </color> | ||
387 | </inactive> | ||
388 | </palette> | ||
389 | </property> | ||
390 | <property stdset="1"> | ||
391 | <name>text</name> | ||
392 | <string>Snooze</string> | ||
393 | </property> | ||
394 | </widget> | ||
395 | <widget> | ||
396 | <class>QPushButton</class> | ||
397 | <property stdset="1"> | ||
398 | <name>name</name> | ||
145 | <cstring>cmdOk</cstring> | 399 | <cstring>cmdOk</cstring> |
146 | </property> | 400 | </property> |
147 | <property stdset="1"> | 401 | <property stdset="1"> |
402 | <name>minimumSize</name> | ||
403 | <size> | ||
404 | <width>0</width> | ||
405 | <height>32</height> | ||
406 | </size> | ||
407 | </property> | ||
408 | <property stdset="1"> | ||
409 | <name>palette</name> | ||
410 | <palette> | ||
411 | <active> | ||
412 | <color> | ||
413 | <red>0</red> | ||
414 | <green>0</green> | ||
415 | <blue>0</blue> | ||
416 | </color> | ||
417 | <color> | ||
418 | <red>192</red> | ||
419 | <green>255</green> | ||
420 | <blue>192</blue> | ||
421 | </color> | ||
422 | <color> | ||
423 | <red>255</red> | ||
424 | <green>255</green> | ||
425 | <blue>255</blue> | ||
426 | </color> | ||
427 | <color> | ||
428 | <red>223</red> | ||
429 | <green>255</green> | ||
430 | <blue>223</blue> | ||
431 | </color> | ||
432 | <color> | ||
433 | <red>96</red> | ||
434 | <green>127</green> | ||
435 | <blue>96</blue> | ||
436 | </color> | ||
437 | <color> | ||
438 | <red>128</red> | ||
439 | <green>170</green> | ||
440 | <blue>128</blue> | ||
441 | </color> | ||
442 | <color> | ||
443 | <red>0</red> | ||
444 | <green>0</green> | ||
445 | <blue>0</blue> | ||
446 | </color> | ||
447 | <color> | ||
448 | <red>255</red> | ||
449 | <green>255</green> | ||
450 | <blue>255</blue> | ||
451 | </color> | ||
452 | <color> | ||
453 | <red>0</red> | ||
454 | <green>0</green> | ||
455 | <blue>0</blue> | ||
456 | </color> | ||
457 | <color> | ||
458 | <red>255</red> | ||
459 | <green>255</green> | ||
460 | <blue>255</blue> | ||
461 | </color> | ||
462 | <color> | ||
463 | <red>238</red> | ||
464 | <green>238</green> | ||
465 | <blue>230</blue> | ||
466 | </color> | ||
467 | <color> | ||
468 | <red>0</red> | ||
469 | <green>0</green> | ||
470 | <blue>0</blue> | ||
471 | </color> | ||
472 | <color> | ||
473 | <red>255</red> | ||
474 | <green>221</green> | ||
475 | <blue>118</blue> | ||
476 | </color> | ||
477 | <color> | ||
478 | <red>0</red> | ||
479 | <green>0</green> | ||
480 | <blue>0</blue> | ||
481 | </color> | ||
482 | </active> | ||
483 | <disabled> | ||
484 | <color> | ||
485 | <red>128</red> | ||
486 | <green>128</green> | ||
487 | <blue>128</blue> | ||
488 | </color> | ||
489 | <color> | ||
490 | <red>192</red> | ||
491 | <green>255</green> | ||
492 | <blue>192</blue> | ||
493 | </color> | ||
494 | <color> | ||
495 | <red>255</red> | ||
496 | <green>255</green> | ||
497 | <blue>255</blue> | ||
498 | </color> | ||
499 | <color> | ||
500 | <red>230</red> | ||
501 | <green>255</green> | ||
502 | <blue>230</blue> | ||
503 | </color> | ||
504 | <color> | ||
505 | <red>96</red> | ||
506 | <green>127</green> | ||
507 | <blue>96</blue> | ||
508 | </color> | ||
509 | <color> | ||
510 | <red>128</red> | ||
511 | <green>170</green> | ||
512 | <blue>128</blue> | ||
513 | </color> | ||
514 | <color> | ||
515 | <red>0</red> | ||
516 | <green>0</green> | ||
517 | <blue>0</blue> | ||
518 | </color> | ||
519 | <color> | ||
520 | <red>255</red> | ||
521 | <green>255</green> | ||
522 | <blue>255</blue> | ||
523 | </color> | ||
524 | <color> | ||
525 | <red>128</red> | ||
526 | <green>128</green> | ||
527 | <blue>128</blue> | ||
528 | </color> | ||
529 | <color> | ||
530 | <red>255</red> | ||
531 | <green>255</green> | ||
532 | <blue>255</blue> | ||
533 | </color> | ||
534 | <color> | ||
535 | <red>238</red> | ||
536 | <green>238</green> | ||
537 | <blue>230</blue> | ||
538 | </color> | ||
539 | <color> | ||
540 | <red>0</red> | ||
541 | <green>0</green> | ||
542 | <blue>0</blue> | ||
543 | </color> | ||
544 | <color> | ||
545 | <red>255</red> | ||
546 | <green>221</green> | ||
547 | <blue>118</blue> | ||
548 | </color> | ||
549 | <color> | ||
550 | <red>0</red> | ||
551 | <green>0</green> | ||
552 | <blue>0</blue> | ||
553 | </color> | ||
554 | </disabled> | ||
555 | <inactive> | ||
556 | <color> | ||
557 | <red>0</red> | ||
558 | <green>0</green> | ||
559 | <blue>0</blue> | ||
560 | </color> | ||
561 | <color> | ||
562 | <red>192</red> | ||
563 | <green>255</green> | ||
564 | <blue>192</blue> | ||
565 | </color> | ||
566 | <color> | ||
567 | <red>255</red> | ||
568 | <green>255</green> | ||
569 | <blue>255</blue> | ||
570 | </color> | ||
571 | <color> | ||
572 | <red>230</red> | ||
573 | <green>255</green> | ||
574 | <blue>230</blue> | ||
575 | </color> | ||
576 | <color> | ||
577 | <red>96</red> | ||
578 | <green>127</green> | ||
579 | <blue>96</blue> | ||
580 | </color> | ||
581 | <color> | ||
582 | <red>128</red> | ||
583 | <green>170</green> | ||
584 | <blue>128</blue> | ||
585 | </color> | ||
586 | <color> | ||
587 | <red>0</red> | ||
588 | <green>0</green> | ||
589 | <blue>0</blue> | ||
590 | </color> | ||
591 | <color> | ||
592 | <red>255</red> | ||
593 | <green>255</green> | ||
594 | <blue>255</blue> | ||
595 | </color> | ||
596 | <color> | ||
597 | <red>0</red> | ||
598 | <green>0</green> | ||
599 | <blue>0</blue> | ||
600 | </color> | ||
601 | <color> | ||
602 | <red>255</red> | ||
603 | <green>255</green> | ||
604 | <blue>255</blue> | ||
605 | </color> | ||
606 | <color> | ||
607 | <red>238</red> | ||
608 | <green>238</green> | ||
609 | <blue>230</blue> | ||
610 | </color> | ||
611 | <color> | ||
612 | <red>0</red> | ||
613 | <green>0</green> | ||
614 | <blue>0</blue> | ||
615 | </color> | ||
616 | <color> | ||
617 | <red>255</red> | ||
618 | <green>221</green> | ||
619 | <blue>118</blue> | ||
620 | </color> | ||
621 | <color> | ||
622 | <red>0</red> | ||
623 | <green>0</green> | ||
624 | <blue>0</blue> | ||
625 | </color> | ||
626 | </inactive> | ||
627 | </palette> | ||
628 | </property> | ||
629 | <property stdset="1"> | ||
148 | <name>text</name> | 630 | <name>text</name> |
149 | <string>Close</string> | 631 | <string>Close</string> |
150 | </property> | 632 | </property> |
151 | </widget> | 633 | </widget> |
152 | </vbox> | 634 | </vbox> |
153 | </widget> | 635 | </widget> |
154 | </UI> | 636 | </UI> |
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index 9b324e0..325a307 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -89,41 +89,46 @@ static void startPlayer() | |||
89 | 89 | ||
90 | class MySpinBox : public QSpinBox | 90 | class MySpinBox : public QSpinBox |
91 | { | 91 | { |
92 | public: | 92 | public: |
93 | QLineEdit *lineEdit() const { | 93 | QLineEdit *lineEdit() const { |
94 | return editor(); | 94 | return editor(); |
95 | } | 95 | } |
96 | }; | 96 | }; |
97 | 97 | ||
98 | // | 98 | // |
99 | // | 99 | // |
100 | // | 100 | // |
101 | AlarmDlg::AlarmDlg(QWidget *parent, const char *name, bool modal, | 101 | AlarmDlg::AlarmDlg(QWidget *parent, const char *name, bool modal, |
102 | const QString &txt) : | 102 | const QString &txt) : |
103 | AlarmDlgBase(parent, name, modal) | 103 | AlarmDlgBase(parent, name, modal) |
104 | { | 104 | { |
105 | // Increase font size to make it a little more readable | ||
106 | QFont f(font()); | ||
107 | f.setPointSize((int)(f.pointSize() * 1.7)); | ||
108 | setFont(f); | ||
109 | |||
105 | setCaption( tr("Clock") ); | 110 | setCaption( tr("Clock") ); |
106 | pixmap->setPixmap( Opie::Core::OResource::loadPixmap("clock/alarmbell") ); | 111 | pixmap->setPixmap( Opie::Core::OResource::loadPixmap("clock/alarmbell") ); |
107 | alarmDlgLabel->setText(txt); | 112 | alarmDlgLabel->setText(txt); |
108 | 113 | ||
109 | connect(snoozeTime, SIGNAL(valueChanged(int)), this, | 114 | connect(cmdSnooze, SIGNAL(clicked()), this, SLOT(checkSnooze())); |
110 | SLOT(changePrompt(int))); | 115 | connect(cmdOk, SIGNAL(clicked()), this, SLOT(accept())); |
111 | connect(cmdOk, SIGNAL(clicked()), this, SLOT(checkSnooze())); | ||
112 | } | 116 | } |
113 | 117 | ||
118 | |||
114 | // | 119 | // |
115 | // | 120 | // |
116 | // | 121 | // |
117 | void | 122 | void |
118 | AlarmDlg::setText(const QString &txt) | 123 | AlarmDlg::setText(const QString &txt) |
119 | { | 124 | { |
120 | alarmDlgLabel->setText(txt); | 125 | alarmDlgLabel->setText(txt); |
121 | } | 126 | } |
122 | 127 | ||
123 | // | 128 | // |
124 | // | 129 | // |
125 | // | 130 | // |
126 | void | 131 | void |
127 | AlarmDlg::checkSnooze(void) | 132 | AlarmDlg::checkSnooze(void) |
128 | { | 133 | { |
129 | // | 134 | // |
@@ -131,40 +136,32 @@ AlarmDlg::checkSnooze(void) | |||
131 | // | 136 | // |
132 | AlarmServer::deleteAlarm(QDateTime(), ALARM_CLOCK_CHANNEL, | 137 | AlarmServer::deleteAlarm(QDateTime(), ALARM_CLOCK_CHANNEL, |
133 | ALARM_CLOCK_MESSAGE, magic_snooze); | 138 | ALARM_CLOCK_MESSAGE, magic_snooze); |
134 | 139 | ||
135 | if (snoozeTime->value() > 0) { | 140 | if (snoozeTime->value() > 0) { |
136 | QDateTime wake = QDateTime::currentDateTime(); | 141 | QDateTime wake = QDateTime::currentDateTime(); |
137 | wake = wake.addSecs(snoozeTime->value() * 60); // snoozeTime in minutes | 142 | wake = wake.addSecs(snoozeTime->value() * 60); // snoozeTime in minutes |
138 | 143 | ||
139 | AlarmServer::addAlarm(wake, ALARM_CLOCK_CHANNEL, | 144 | AlarmServer::addAlarm(wake, ALARM_CLOCK_CHANNEL, |
140 | ALARM_CLOCK_MESSAGE, magic_snooze); | 145 | ALARM_CLOCK_MESSAGE, magic_snooze); |
141 | } | 146 | } |
142 | accept(); | 147 | accept(); |
143 | } | 148 | } |
144 | 149 | ||
145 | 150 | ||
146 | 151 | ||
147 | void | ||
148 | AlarmDlg::changePrompt(int mins) | ||
149 | { | ||
150 | cmdOk->setText(mins > 0 ? tr("Snooze") : tr("Close") ); | ||
151 | } | ||
152 | |||
153 | |||
154 | |||
155 | Clock::Clock( QWidget * parent, const char *, WFlags f ) | 152 | Clock::Clock( QWidget * parent, const char *, WFlags f ) |
156 | : ClockBase( parent, "clock", f ), swatch_splitms(99), init(FALSE) // No tr | 153 | : ClockBase( parent, "clock", f ), swatch_splitms(99), init(FALSE) // No tr |
157 | { | 154 | { |
158 | alarmDlg = 0; | 155 | alarmDlg = 0; |
159 | swLayout = 0; | 156 | swLayout = 0; |
160 | dayBtn = new QToolButton * [7]; | 157 | dayBtn = new QToolButton * [7]; |
161 | 158 | ||
162 | Config config( "qpe" ); | 159 | Config config( "qpe" ); |
163 | config.setGroup("Time"); | 160 | config.setGroup("Time"); |
164 | ampm = config.readBoolEntry( "AMPM", TRUE ); | 161 | ampm = config.readBoolEntry( "AMPM", TRUE ); |
165 | onMonday = config.readBoolEntry( "MONDAY" ); | 162 | onMonday = config.readBoolEntry( "MONDAY" ); |
166 | 163 | ||
167 | connect( tabs, SIGNAL(currentChanged(QWidget*)), | 164 | connect( tabs, SIGNAL(currentChanged(QWidget*)), |
168 | this, SLOT(tabChanged(QWidget*)) ); | 165 | this, SLOT(tabChanged(QWidget*)) ); |
169 | 166 | ||
170 | analogStopwatch = new AnalogClock( swFrame ); | 167 | analogStopwatch = new AnalogClock( swFrame ); |
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index c063a9b..10bbfef 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -31,33 +31,32 @@ class AnalogClock; | |||
31 | class QBoxLayout; | 31 | class QBoxLayout; |
32 | class QToolButton; | 32 | class QToolButton; |
33 | 33 | ||
34 | class AlarmDlg: public AlarmDlgBase | 34 | class AlarmDlg: public AlarmDlgBase |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | AlarmDlg(QWidget *parent = 0, const char *name = 0, bool modal = TRUE, | 39 | AlarmDlg(QWidget *parent = 0, const char *name = 0, bool modal = TRUE, |
40 | const QString &txt = "Alarm"); | 40 | const QString &txt = "Alarm"); |
41 | 41 | ||
42 | void setText(const QString &txt); | 42 | void setText(const QString &txt); |
43 | 43 | ||
44 | 44 | ||
45 | private slots: | 45 | private slots: |
46 | void checkSnooze(void); | 46 | void checkSnooze(void); |
47 | void changePrompt(int minutes); | ||
48 | }; | 47 | }; |
49 | 48 | ||
50 | class Clock : public ClockBase | 49 | class Clock : public ClockBase |
51 | { | 50 | { |
52 | Q_OBJECT | 51 | Q_OBJECT |
53 | 52 | ||
54 | public: | 53 | public: |
55 | Clock( QWidget *parent=0, const char *name=0, WFlags fl=0 ); | 54 | Clock( QWidget *parent=0, const char *name=0, WFlags fl=0 ); |
56 | ~Clock(); | 55 | ~Clock(); |
57 | QDateTime when; | 56 | QDateTime when; |
58 | bool bSound; | 57 | bool bSound; |
59 | int hour, minute, snoozeTime; | 58 | int hour, minute, snoozeTime; |
60 | static QString appName() { return QString::fromLatin1("clock"); } | 59 | static QString appName() { return QString::fromLatin1("clock"); } |
61 | 60 | ||
62 | private slots: | 61 | private slots: |
63 | void stopStartStopWatch(); | 62 | void stopStartStopWatch(); |