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
@@ -243,97 +243,97 @@
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>
@@ -495,98 +495,98 @@
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>
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,142 +1,142 @@
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}
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