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
@@ -1,627 +1,627 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>DateEntryBase</class> 2<class>DateEntryBase</class>
3<comment>********************************************************************* 3<comment>*********************************************************************
4** Copyright (C) 2000 Trolltech AS. All rights reserved. 4** Copyright (C) 2000 Trolltech AS. All rights reserved.
5** 5**
6** This file is part of Qtopia Environment. 6** This file is part of Qtopia Environment.
7** 7**
8** This file may be distributed and/or modified under the terms of the 8** This file may be distributed and/or modified under the terms of the
9** GNU General Public License version 2 as published by the Free Software 9** GNU General Public License version 2 as published by the Free Software
10** Foundation and appearing in the file LICENSE.GPL included in the 10** Foundation and appearing in the file LICENSE.GPL included in the
11** packaging of this file. 11** packaging of this file.
12** 12**
13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15** 15**
16** See http://www.trolltech.com/gpl/ for GPL licensing information. 16** See http://www.trolltech.com/gpl/ for GPL licensing information.
17** 17**
18** Contact info@trolltech.com if any conditions of this licensing are 18** Contact info@trolltech.com if any conditions of this licensing are
19** not clear to you. 19** not clear to you.
20** 20**
21** $Id$ 21** $Id$
22** 22**
23*********************************************************************</comment> 23*********************************************************************</comment>
24<widget> 24<widget>
25 <class>QWidget</class> 25 <class>QWidget</class>
26 <property stdset="1"> 26 <property stdset="1">
27 <name>name</name> 27 <name>name</name>
28 <cstring>DateEntryBase</cstring> 28 <cstring>DateEntryBase</cstring>
29 </property> 29 </property>
30 <property stdset="1"> 30 <property stdset="1">
31 <name>geometry</name> 31 <name>geometry</name>
32 <rect> 32 <rect>
33 <x>0</x> 33 <x>0</x>
34 <y>0</y> 34 <y>0</y>
35 <width>242</width> 35 <width>242</width>
36 <height>339</height> 36 <height>339</height>
37 </rect> 37 </rect>
38 </property> 38 </property>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>caption</name> 40 <name>caption</name>
41 <string>New Event</string> 41 <string>New Event</string>
42 </property> 42 </property>
43 <grid> 43 <grid>
44 <property stdset="1"> 44 <property stdset="1">
45 <name>margin</name> 45 <name>margin</name>
46 <number>2</number> 46 <number>2</number>
47 </property> 47 </property>
48 <property stdset="1"> 48 <property stdset="1">
49 <name>spacing</name> 49 <name>spacing</name>
50 <number>0</number> 50 <number>0</number>
51 </property> 51 </property>
52 <widget row="1" column="0" > 52 <widget row="1" column="0" >
53 <class>QLabel</class> 53 <class>QLabel</class>
54 <property stdset="1"> 54 <property stdset="1">
55 <name>name</name> 55 <name>name</name>
56 <cstring>TextLabel2</cstring> 56 <cstring>TextLabel2</cstring>
57 </property> 57 </property>
58 <property stdset="1"> 58 <property stdset="1">
59 <name>frameShape</name> 59 <name>frameShape</name>
60 <enum>MShape</enum> 60 <enum>MShape</enum>
61 </property> 61 </property>
62 <property stdset="1"> 62 <property stdset="1">
63 <name>frameShadow</name> 63 <name>frameShadow</name>
64 <enum>MShadow</enum> 64 <enum>MShadow</enum>
65 </property> 65 </property>
66 <property stdset="1"> 66 <property stdset="1">
67 <name>text</name> 67 <name>text</name>
68 <string>Location</string> 68 <string>Location</string>
69 </property> 69 </property>
70 </widget> 70 </widget>
71 <widget row="2" column="0" > 71 <widget row="2" column="0" >
72 <class>QLabel</class> 72 <class>QLabel</class>
73 <property stdset="1"> 73 <property stdset="1">
74 <name>name</name> 74 <name>name</name>
75 <cstring>TextLabel2_2</cstring> 75 <cstring>TextLabel2_2</cstring>
76 </property> 76 </property>
77 <property stdset="1"> 77 <property stdset="1">
78 <name>text</name> 78 <name>text</name>
79 <string>Category</string> 79 <string>Category</string>
80 </property> 80 </property>
81 <property> 81 <property>
82 <name>buddy</name> 82 <name>buddy</name>
83 <cstring>comboPriority</cstring> 83 <cstring>comboPriority</cstring>
84 </property> 84 </property>
85 </widget> 85 </widget>
86 <widget row="0" column="1" rowspan="1" colspan="3" > 86 <widget row="0" column="1" rowspan="1" colspan="3" >
87 <class>QComboBox</class> 87 <class>QComboBox</class>
88 <item> 88 <item>
89 <property> 89 <property>
90 <name>text</name> 90 <name>text</name>
91 <string></string> 91 <string></string>
92 </property> 92 </property>
93 </item> 93 </item>
94 <item> 94 <item>
95 <property> 95 <property>
96 <name>text</name> 96 <name>text</name>
97 <string>Meeting</string> 97 <string>Meeting</string>
98 </property> 98 </property>
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,574 +1,574 @@
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 {
287 if ( hour == 12 ) 287 if ( hour == 12 )
288 hour = 0; 288 hour = 0;
289 } 289 }
290 l[1] = digits; 290 l[1] = digits;
291 } 291 }
292 int minute = l[1].toInt(); 292 int minute = l[1].toInt();
293 if ( minute > 59 ) 293 if ( minute > 59 )
294 minute = 59; 294 minute = 59;
295 else if ( minute < 0 ) 295 else if ( minute < 0 )
296 minute = 0; 296 minute = 0;
297 if ( hour > 23 ) { 297 if ( hour > 23 ) {
298 hour = 23; 298 hour = 23;
299 minute = 59; 299 minute = 59;
300 } else if ( hour < 0 ) 300 } else if ( hour < 0 )
301 hour = 0; 301 hour = 0;
302 tmpTime.setHMS( hour, minute, 0 ); 302 tmpTime.setHMS( hour, minute, 0 );
303 return tmpTime; 303 return tmpTime;
304} 304}
305 305
306/* 306/*
307 * public slot 307 * public slot
308 */ 308 */
309void DateEntry::endTimeChanged( const QString &s ) 309void DateEntry::endTimeChanged( const QString &s )
310{ 310{
311 endTimeChanged( parseTime(s,ampm) ); 311 endTimeChanged( parseTime(s,ampm) );
312} 312}
313 313
314void DateEntry::endTimeChanged( const QTime &t ) { 314void DateEntry::endTimeChanged( const QTime &t ) {
315 if ( endDate > startDate || t >= startTime ) { 315 if ( endDate > startDate || t >= startTime ) {
316 endTime = t; 316 endTime = t;
317 } else { 317 } else {
318 endTime = startTime; 318 endTime = startTime;
319 //comboEnd->setCurrentItem( comboStart->currentItem() ); 319 //comboEnd->setCurrentItem( comboStart->currentItem() );
320 } 320 }
321 timePickerStart->setHour(endTime.hour()); 321 timePickerStart->setHour(endTime.hour());
322 timePickerStart->setMinute(endTime.minute()); 322 timePickerStart->setMinute(endTime.minute());
323} 323}
324 324
325/* 325/*
326 * public slot 326 * public slot
327 */ 327 */
328void DateEntry::startDateChanged( int y, int m, int d ) 328void DateEntry::startDateChanged( int y, int m, int d )
329{ 329{
330 QDate prev = startDate; 330 QDate prev = startDate;
331 startDate.setYMD( y, m, d ); 331 startDate.setYMD( y, m, d );
332 if ( rp.type == Event::Weekly && 332 if ( rp.type == Event::Weekly &&
333 startDate.dayOfWeek() != prev.dayOfWeek() ) { 333 startDate.dayOfWeek() != prev.dayOfWeek() ) {
334 // if we change the start of a weekly repeating event 334 // if we change the start of a weekly repeating event
335 // set the repeating day appropriately 335 // set the repeating day appropriately
336 char mask = 1 << (prev.dayOfWeek()-1); 336 char mask = 1 << (prev.dayOfWeek()-1);
337 rp.days &= (~mask); 337 rp.days &= (~mask);
338 rp.days |= 1 << (startDate.dayOfWeek()-1); 338 rp.days |= 1 << (startDate.dayOfWeek()-1);
339 } 339 }
340 340
341 buttonStart->setText( TimeString::shortDate( startDate ) ); 341 buttonStart->setText( TimeString::shortDate( startDate ) );
342 342
343 // our pickers must be reset... 343 // our pickers must be reset...
344 startPicker->setDate( y, m, d ); 344 startPicker->setDate( y, m, d );
345 endPicker->setDate( y, m, d ); 345 endPicker->setDate( y, m, d );
346} 346}
347 347
348/* 348/*
349 * public slot 349 * public slot
350 */ 350 */
351void DateEntry::startTimeEdited( const QString &s ) 351void DateEntry::startTimeEdited( const QString &s )
352{ 352{
353 startTimeChanged(parseTime(s,ampm)); 353 startTimeChanged(parseTime(s,ampm));
354 updateTimeEdit(false,true); 354 updateTimeEdit(false,true);
355 timePickerStart->setHour(startTime.hour()); 355 timePickerStart->setHour(startTime.hour());
356 timePickerStart->setMinute(startTime.minute()); 356 timePickerStart->setMinute(startTime.minute());
357} 357}
358 358
359void DateEntry::startTimeChanged( const QTime &t ) 359void DateEntry::startTimeChanged( const QTime &t )
360{ 360{
361 int duration=startTime.secsTo(endTime); 361 int duration=startTime.secsTo(endTime);
362 startTime = t; 362 startTime = t;
363 endTime=t.addSecs(duration); 363 endTime=t.addSecs(duration);
364} 364}
365void DateEntry::startTimePicked( const QTime &t ) { 365void DateEntry::startTimePicked( const QTime &t ) {
366 if(m_showStart ){ 366 if(m_showStart ){
367 startTimeChanged(t); 367 startTimeChanged(t);
368 updateTimeEdit(true,true); 368 updateTimeEdit(true,true);
369 }else{ 369 }else{
370 endTimeChanged(t); 370 endTimeChanged(t);
371 updateTimeEdit(false, true ); 371 updateTimeEdit(false, true );
372 } 372 }
373} 373}
374 374
375/* 375/*
376 * public slot 376 * public slot
377 */ 377 */
378void DateEntry::typeChanged( const QString &s ) 378void DateEntry::typeChanged( const QString &s )
379{ 379{
380 bool b = s != "All Day"; 380 bool b = s != "All Day";
381 buttonStart->setEnabled( b ); 381 buttonStart->setEnabled( b );
382 comboStart->setEnabled( b ); 382 comboStart->setEnabled( b );
383 comboEnd->setEnabled( b ); 383 comboEnd->setEnabled( b );
384} 384}
385 385
386void DateEntry::slotRepeat() 386void DateEntry::slotRepeat()
387{ 387{
388 // Work around for compiler Bug.. 388 // Work around for compiler Bug..
389 RepeatEntry *e; 389 RepeatEntry *e;
390 390
391 // it is better in my opinion to just grab this from the mother, 391 // it is better in my opinion to just grab this from the mother,
392 // since, this dialog doesn't need to keep track of it... 392 // since, this dialog doesn't need to keep track of it...
393 if ( rp.type != Event::NoRepeat ) 393 if ( rp.type != Event::NoRepeat )
394 e = new RepeatEntry( startWeekOnMonday, rp, startDate, this); 394 e = new RepeatEntry( startWeekOnMonday, rp, startDate, this);
395 else 395 else
396 e = new RepeatEntry( startWeekOnMonday, startDate, this ); 396 e = new RepeatEntry( startWeekOnMonday, startDate, this );
397 397
398#if defined(Q_WS_QWS) || defined(_WS_QWS_) 398#if defined(Q_WS_QWS) || defined(_WS_QWS_)
399 e->showMaximized(); 399 e->showMaximized();
400#endif 400#endif
401 if ( e->exec() ) { 401 if ( e->exec() ) {
402 rp = e->repeatPattern(); 402 rp = e->repeatPattern();
403 setRepeatLabel(); 403 setRepeatLabel();
404 } 404 }
405} 405}
406 406
407void DateEntry::slotChangeStartOfWeek( bool onMonday ) 407void DateEntry::slotChangeStartOfWeek( bool onMonday )
408{ 408{
409 startWeekOnMonday = onMonday; 409 startWeekOnMonday = onMonday;
410} 410}
411 411
412Event DateEntry::event() 412Event DateEntry::event()
413{ 413{
414 Event ev; 414 Event ev;
415 Event::SoundTypeChoice st; 415 Event::SoundTypeChoice st;
416 ev.setDescription( comboDescription->currentText() ); 416 ev.setDescription( comboDescription->currentText() );
417 ev.setLocation( comboLocation->currentText() ); 417 ev.setLocation( comboLocation->currentText() );
418 ev.setCategories( comboCategory->currentCategories() ); 418 ev.setCategories( comboCategory->currentCategories() );
419 ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal ); 419 ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal );
420 if ( startDate > endDate ) { 420 if ( startDate > endDate ) {
421 QDate tmp = endDate; 421 QDate tmp = endDate;
422 endDate = startDate; 422 endDate = startDate;
423 startDate = tmp; 423 startDate = tmp;
424 } 424 }
425 425
426 // This is now done in the changed slots 426 // This is now done in the changed slots
427 // startTime = parseTime( comboStart->text(), ampm ); 427 // startTime = parseTime( comboStart->text(), ampm );
428 //endTime = parseTime( comboEnd->text(), ampm ); 428 //endTime = parseTime( comboEnd->text(), ampm );
429 429
430 if ( startTime > endTime && endDate == startDate ) { 430 if ( startTime > endTime && endDate == startDate ) {
431 QTime tmp = endTime; 431 QTime tmp = endTime;
432 endTime = startTime; 432 endTime = startTime;
433 startTime = tmp; 433 startTime = tmp;
434 } 434 }
435 // don't set the time if theres no need too 435 // don't set the time if theres no need too
436 if ( ev.type() == Event::AllDay ) { 436 if ( ev.type() == Event::AllDay ) {
437 startTime.setHMS( 0, 0, 0 ); 437 startTime.setHMS( 0, 0, 0 );
438 endTime.setHMS( 23, 59, 59 ); 438 endTime.setHMS( 23, 59, 59 );
439 } 439 }
440 440
441 // adjust start and end times based on timezone 441 // adjust start and end times based on timezone
442 QDateTime start( startDate, startTime ); 442 QDateTime start( startDate, startTime );
443 QDateTime end( endDate, endTime ); 443 QDateTime end( endDate, endTime );
444 time_t start_utc, end_utc; 444 time_t start_utc, end_utc;
445 445
446// qDebug( "tz: %s", timezone->currentZone().latin1() ); 446// qDebug( "tz: %s", timezone->currentZone().latin1() );
447 447
448 // get real timezone 448 // get real timezone
449 QString realTZ; 449 QString realTZ;
450 realTZ = QString::fromLocal8Bit( getenv("TZ") ); 450 realTZ = QString::fromLocal8Bit( getenv("TZ") );
451 451
452 // set timezone 452 // set timezone
453 if ( setenv( "TZ", timezone->currentZone(), true ) != 0 ) 453 if ( setenv( "TZ", timezone->currentZone(), true ) != 0 )
454 qWarning( "There was a problem setting the timezone." ); 454 qWarning( "There was a problem setting the timezone." );
455 455
456 // convert to UTC based on selected TZ (calling tzset internally) 456 // convert to UTC based on selected TZ (calling tzset internally)
457 start_utc = TimeConversion::toUTC( start ); 457 start_utc = TimeConversion::toUTC( start );
458 end_utc = TimeConversion::toUTC( end ); 458 end_utc = TimeConversion::toUTC( end );
459 459
460 // done playing around... put it all back 460 // done playing around... put it all back
461 unsetenv( "TZ" ); 461 unsetenv( "TZ" );
462 if ( !realTZ.isNull() ) 462 if ( !realTZ.isNull() )
463 if ( setenv( "TZ", realTZ, true ) != 0 ) 463 if ( setenv( "TZ", realTZ, true ) != 0 )
464 qWarning( "There was a problem setting the timezone." ); 464 qWarning( "There was a problem setting the timezone." );
465 465
466 // convert UTC to local time (calling tzset internally) 466 // convert UTC to local time (calling tzset internally)
467 ev.setStart( TimeConversion::fromUTC( start_utc ) ); 467 ev.setStart( TimeConversion::fromUTC( start_utc ) );
468 ev.setEnd( TimeConversion::fromUTC( end_utc ) ); 468 ev.setEnd( TimeConversion::fromUTC( end_utc ) );
469 469
470 // we only have one type of sound at the moment... LOUD!!! 470 // we only have one type of sound at the moment... LOUD!!!
471 if ( comboSound->currentItem() != 0 ) 471 if ( comboSound->currentItem() != 0 )
472 st = Event::Loud; 472 st = Event::Loud;
473 else 473 else
474 st = Event::Silent; 474 st = Event::Silent;
475 ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st ); 475 ev.setAlarm( checkAlarm->isChecked(), spinAlarm->value(), st );
476 if ( rp.type != Event::NoRepeat ) 476 if ( rp.type != Event::NoRepeat )
477 ev.setRepeat( TRUE, rp ); 477 ev.setRepeat( TRUE, rp );
478 ev.setNotes( noteStr ); 478 ev.setNotes( noteStr );
479 479
480 //cout << "Start: " << comboStart->currentText() << endl; 480 //cout << "Start: " << comboStart->currentText() << endl;
481 481
482 return ev; 482 return ev;
483} 483}
484 484
485void DateEntry::setRepeatLabel() 485void DateEntry::setRepeatLabel()
486{ 486{
487 487
488 switch( rp.type ) { 488 switch( rp.type ) {
489 case Event::Daily: 489 case Event::Daily:
490 cmdRepeat->setText( tr("Daily...") ); 490 cmdRepeat->setText( tr("Daily...") );
491 break; 491 break;
492 case Event::Weekly: 492 case Event::Weekly:
493 cmdRepeat->setText( tr("Weekly...") ); 493 cmdRepeat->setText( tr("Weekly...") );
494 break; 494 break;
495 case Event::MonthlyDay: 495 case Event::MonthlyDay:
496 case Event::MonthlyDate: 496 case Event::MonthlyDate:
497 cmdRepeat->setText( tr("Monthly...") ); 497 cmdRepeat->setText( tr("Monthly...") );
498 break; 498 break;
499 case Event::Yearly: 499 case Event::Yearly:
500 cmdRepeat->setText( tr("Yearly...") ); 500 cmdRepeat->setText( tr("Yearly...") );
501 break; 501 break;
502 default: 502 default:
503 cmdRepeat->setText( tr("No Repeat...") ); 503 cmdRepeat->setText( tr("No Repeat...") );
504 } 504 }
505} 505}
506 506
507void DateEntry::setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice sound ) 507void DateEntry::setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice sound )
508{ 508{
509 checkAlarm->setChecked( alarmPreset ); 509 checkAlarm->setChecked( alarmPreset );
510 spinAlarm->setValue( presetTime ); 510 spinAlarm->setValue( presetTime );
511 if ( sound != Event::Silent ) 511 if ( sound != Event::Silent )
512 comboSound->setCurrentItem( 1 ); 512 comboSound->setCurrentItem( 1 );
513 else 513 else
514 comboSound->setCurrentItem( 0 ); 514 comboSound->setCurrentItem( 0 );
515} 515}
516 516
517void DateEntry::initCombos() 517void DateEntry::initCombos()
518{ 518{
519 /* 519 /*
520 comboStart->clear(); 520 comboStart->clear();
521 comboEnd->clear(); 521 comboEnd->clear();
522 if ( ampm ) { 522 if ( ampm ) {
523 for ( int i = 0; i < 24; i++ ) { 523 for ( int i = 0; i < 24; i++ ) {
524 if ( i == 0 ) { 524 if ( i == 0 ) {
525 comboStart->insertItem( "12:00 AM" ); 525 comboStart->insertItem( "12:00 AM" );
526 comboStart->insertItem( "12:30 AM" ); 526 comboStart->insertItem( "12:30 AM" );
527 comboEnd->insertItem( "12:00 AM" ); 527 comboEnd->insertItem( "12:00 AM" );
528 comboEnd->insertItem( "12:30 AM" ); 528 comboEnd->insertItem( "12:30 AM" );
529 } else if ( i == 12 ) { 529 } else if ( i == 12 ) {
530 comboStart->insertItem( "12:00 PM" ); 530 comboStart->insertItem( "12:00 PM" );
531 comboStart->insertItem( "12:30 PM" ); 531 comboStart->insertItem( "12:30 PM" );
532 comboEnd->insertItem( "12:00 PM" ); 532 comboEnd->insertItem( "12:00 PM" );
533 comboEnd->insertItem( "12:30 PM" ); 533 comboEnd->insertItem( "12:30 PM" );
534 } else if ( i > 12 ) { 534 } else if ( i > 12 ) {
535 comboStart->insertItem( QString::number( i - 12 ) + ":00 PM" ); 535 comboStart->insertItem( QString::number( i - 12 ) + ":00 PM" );
536 comboStart->insertItem( QString::number( i - 12 ) + ":30 PM" ); 536 comboStart->insertItem( QString::number( i - 12 ) + ":30 PM" );
537 comboEnd->insertItem( QString::number( i - 12 ) + ":00 PM" ); 537 comboEnd->insertItem( QString::number( i - 12 ) + ":00 PM" );
538 comboEnd->insertItem( QString::number( i - 12 ) + ":30 PM" ); 538 comboEnd->insertItem( QString::number( i - 12 ) + ":30 PM" );
539 } else { 539 } else {
540 comboStart->insertItem( QString::number( i) + ":00 AM" ); 540 comboStart->insertItem( QString::number( i) + ":00 AM" );
541 comboStart->insertItem( QString::number( i ) + ":30 AM" ); 541 comboStart->insertItem( QString::number( i ) + ":30 AM" );
542 comboEnd->insertItem( QString::number( i ) + ":00 AM" ); 542 comboEnd->insertItem( QString::number( i ) + ":00 AM" );
543 comboEnd->insertItem( QString::number( i ) + ":30 AM" ); 543 comboEnd->insertItem( QString::number( i ) + ":30 AM" );
544 } 544 }
545 } 545 }
546 } else { 546 } else {
547 for ( int i = 0; i < 24; i++ ) { 547 for ( int i = 0; i < 24; i++ ) {
548 if ( i < 10 ) { 548 if ( i < 10 ) {
549 comboStart->insertItem( QString("0") 549 comboStart->insertItem( QString("0")
550 + QString::number(i) + ":00" ); 550 + QString::number(i) + ":00" );
551 comboStart->insertItem( QString("0") 551 comboStart->insertItem( QString("0")
552 + QString::number(i) + ":30" ); 552 + QString::number(i) + ":30" );
553 comboEnd->insertItem( QString("0") 553 comboEnd->insertItem( QString("0")
554 + QString::number(i) + ":00" ); 554 + QString::number(i) + ":00" );
555 comboEnd->insertItem( QString("0") 555 comboEnd->insertItem( QString("0")
556 + QString::number(i) + ":30" ); 556 + QString::number(i) + ":30" );
557 } else { 557 } else {
558 comboStart->insertItem( QString::number(i) + ":00" ); 558 comboStart->insertItem( QString::number(i) + ":00" );
559 comboStart->insertItem( QString::number(i) + ":30" ); 559 comboStart->insertItem( QString::number(i) + ":30" );
560 comboEnd->insertItem( QString::number(i) + ":00" ); 560 comboEnd->insertItem( QString::number(i) + ":00" );
561 comboEnd->insertItem( QString::number(i) + ":30" ); 561 comboEnd->insertItem( QString::number(i) + ":30" );
562 } 562 }
563 } 563 }
564 } 564 }
565 */ 565 */
566} 566}
567 567
568void DateEntry::slotChangeClock( bool whichClock ) 568void DateEntry::slotChangeClock( bool whichClock )
569{ 569{
570 ampm = whichClock; 570 ampm = whichClock;
571 initCombos(); 571 initCombos();
572 setDates( QDateTime( startDate, startTime ), QDateTime( endDate, endTime ) ); 572 setDates( QDateTime( startDate, startTime ), QDateTime( endDate, endTime ) );
573} 573}
574 574
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