author | zecke <zecke> | 2002-04-15 22:40:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-04-15 22:40:49 (UTC) |
commit | 38052b763f7d248023024487a7e645b46637c76b (patch) (side-by-side diff) | |
tree | dc6131bc2f56ea2aaab7c75364a979d117a52915 | |
parent | a91544d04ed391bbdc0c6f95ff8a80d35190788c (diff) | |
download | opie-38052b763f7d248023024487a7e645b46637c76b.zip opie-38052b763f7d248023024487a7e645b46637c76b.tar.gz opie-38052b763f7d248023024487a7e645b46637c76b.tar.bz2 |
-fix handling of the kewl timepicker
click in a lineedit and the focus will change
ARDO FEEL FREE TO REVERT IT WANTED TO GET THIS INTO THE FEED
-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 @@ #include <qpe/tzselect.h> +#include <qevent.h> #include <qcheckbox.h> #include <qcombobox.h> @@ -64,4 +65,18 @@ DateEntry::DateEntry( bool startOnMonday, const QDateTime &start, } +bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) +{ + if( ev->type() == QEvent::FocusIn ){ + if( obj == comboStart ){ + TextLabel3_2->setText( tr("Start Time" ) ); + m_showStart= true; + }else if( obj == comboEnd ){ + TextLabel3_2->setText( tr("End Time") ); + m_showStart = false; + } + } + return false; +} + static void addOrPick( QComboBox* combo, const QString& t ) { @@ -187,4 +202,7 @@ void DateEntry::init() this, SLOT( startTimePicked(const QTime &) )); editNote->setFixedVisibleLines(3); + // install eventFilters + comboEnd->installEventFilter( this ); + comboStart->installEventFilter( this ); } @@ -305,6 +323,12 @@ void DateEntry::startTimeChanged( const QTime &t ) } void DateEntry::startTimePicked( const QTime &t ) { + if(m_showStart ){ startTimeChanged(t); updateTimeEdit(true,true); + }else{ + endTime = t; + updateTimeEdit(false, true ); + + } } 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: Event event(); void setAlarmEnabled( bool alarmPreset, int presetTime, Event::SoundTypeChoice ); - + virtual bool eventFilter( QObject *, QEvent * ); public slots: void endDateChanged( int, int, int ); @@ -68,6 +68,7 @@ private: QTime startTime, endTime; Event::RepeatPattern rp; - bool ampm; - bool startWeekOnMonday; + bool ampm:1; + bool startWeekOnMonday:1; + bool m_showStart:1; }; |