-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 24 | ||||
-rw-r--r-- | core/pim/datebook/dateentryimpl.h | 7 |
2 files changed, 28 insertions, 3 deletions
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index 403378e..f2f17c6 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp | |||
@@ -30,4 +30,5 @@ | |||
30 | #include <qpe/tzselect.h> | 30 | #include <qpe/tzselect.h> |
31 | 31 | ||
32 | #include <qevent.h> | ||
32 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
33 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
@@ -64,4 +65,18 @@ DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, | |||
64 | } | 65 | } |
65 | 66 | ||
67 | bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) | ||
68 | { | ||
69 | if( ev->type() == QEvent::FocusIn ){ | ||
70 | if( obj == comboStart ){ | ||
71 | TextLabel3_2->setText( tr("Start Time" ) ); | ||
72 | m_showStart= true; | ||
73 | }else if( obj == comboEnd ){ | ||
74 | TextLabel3_2->setText( tr("End Time") ); | ||
75 | m_showStart = false; | ||
76 | } | ||
77 | } | ||
78 | return false; | ||
79 | } | ||
80 | |||
66 | static void addOrPick( QComboBox* combo, const QString& t ) | 81 | static void addOrPick( QComboBox* combo, const QString& t ) |
67 | { | 82 | { |
@@ -187,4 +202,7 @@ void DateEntry::init() | |||
187 | this, SLOT( startTimePicked(const QTime &) )); | 202 | this, SLOT( startTimePicked(const QTime &) )); |
188 | editNote->setFixedVisibleLines(3); | 203 | editNote->setFixedVisibleLines(3); |
204 | // install eventFilters | ||
205 | comboEnd->installEventFilter( this ); | ||
206 | comboStart->installEventFilter( this ); | ||
189 | } | 207 | } |
190 | 208 | ||
@@ -305,6 +323,12 @@ void DateEntry::startTimeChanged( const QTime &t ) | |||
305 | } | 323 | } |
306 | void DateEntry::startTimePicked( const QTime &t ) { | 324 | void DateEntry::startTimePicked( const QTime &t ) { |
325 | if(m_showStart ){ | ||
307 | startTimeChanged(t); | 326 | startTimeChanged(t); |
308 | updateTimeEdit(true,true); | 327 | updateTimeEdit(true,true); |
328 | }else{ | ||
329 | endTime = t; | ||
330 | updateTimeEdit(false, true ); | ||
331 | |||
332 | } | ||
309 | } | 333 | } |
310 | 334 | ||
diff --git a/core/pim/datebook/dateentryimpl.h b/core/pim/datebook/dateentryimpl.h index bde3119..4eb24b4 100644 --- a/core/pim/datebook/dateentryimpl.h +++ b/core/pim/datebook/dateentryimpl.h | |||
@@ -43,5 +43,5 @@ public: | |||
43 | Event event(); | 43 | Event event(); |
44 | void setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice ); | 44 | void setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice ); |
45 | 45 | virtual bool eventFilter( QObject *, QEvent * ); | |
46 | public slots: | 46 | public slots: |
47 | void endDateChanged( int, int, int ); | 47 | void endDateChanged( int, int, int ); |
@@ -68,6 +68,7 @@ private: | |||
68 | QTime startTime, endTime; | 68 | QTime startTime, endTime; |
69 | Event::RepeatPattern rp; | 69 | Event::RepeatPattern rp; |
70 | bool ampm; | 70 | bool ampm:1; |
71 | bool startWeekOnMonday; | 71 | bool startWeekOnMonday:1; |
72 | bool m_showStart:1; | ||
72 | }; | 73 | }; |
73 | 74 | ||