-rw-r--r-- | core/pim/datebook/dateentry.ui | 40 | ||||
-rw-r--r-- | core/pim/datebook/dateentryimpl.cpp | 38 |
2 files changed, 61 insertions, 17 deletions
diff --git a/core/pim/datebook/dateentry.ui b/core/pim/datebook/dateentry.ui index dc5195f..1a712ec 100644 --- a/core/pim/datebook/dateentry.ui +++ b/core/pim/datebook/dateentry.ui @@ -45,3 +45,3 @@ <name>margin</name> - <number>0</number> + <number>2</number> </property> @@ -149,3 +149,3 @@ <name>text</name> - <string>Description</string> + <string>Description </string> </property> @@ -211,3 +211,3 @@ <name>text</name> - <string>Start - End</string> + <string>Start - End </string> </property> @@ -267,2 +267,24 @@ </widget> + <spacer row="3" column="2" rowspan="2" colspan="1" > + <property> + <name>name</name> + <cstring>Spacer1_2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget row="5" column="1" colspan="3"> @@ -274,3 +296,3 @@ </widget> - <widget row="3" column="2" colspan="2"> + <widget row="3" column="3" colspan="1"> <class>QPushButton</class> @@ -299,3 +321,3 @@ </widget> - <widget row="4" column="2" colspan="2"> + <widget row="4" column="3" colspan="1"> <class>QLineEdit</class> @@ -331,3 +353,3 @@ <name>name</name> - <cstring>TextLabel3_2</cstring> + <cstring>TimePickerLabel</cstring> </property> @@ -565,2 +587,8 @@ <connection> + <sender>checkAllDay</sender> + <signal>toggled(bool)</signal> + <receiver>timePickerStart</receiver> + <slot>setDisabled(bool)</slot> + </connection> + <connection> <sender>checkAlarm</sender> diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index f2f17c6..e14e2f5 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp @@ -70,9 +70,25 @@ bool DateEntry::eventFilter(QObject *obj, QEvent *ev ) if( obj == comboStart ){ - TextLabel3_2->setText( tr("Start Time" ) ); + timePickerStart->setHour(startTime.hour()); + timePickerStart->setMinute(startTime.minute()); + TimePickerLabel->setText( tr("Start Time" ) ); m_showStart= true; }else if( obj == comboEnd ){ - TextLabel3_2->setText( tr("End Time") ); + timePickerStart->setHour(endTime.hour()); + timePickerStart->setMinute(endTime.minute()); + TimePickerLabel->setText( tr("End Time") ); m_showStart = false; } + } else if( ev->type() == QEvent::FocusOut ){ + if( obj == comboEnd ){ + QString s; + s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute()); + comboEnd->setText(s); + } + else if( obj == comboStart ){ + QString s; + s.sprintf("%.2d:%.2d",startTime.hour(), startTime.minute()); + comboStart->setText(s); + } } + return false; @@ -270,5 +286,8 @@ void DateEntry::endTimeChanged( const QString &s ) { - QTime tmpTime = parseTime(s,ampm); - if ( endDate > startDate || tmpTime >= startTime ) { - endTime = tmpTime; + endTimeChanged( parseTime(s,ampm) ); +} + +void DateEntry::endTimeChanged( const QTime &t ) { + if ( endDate > startDate || t >= startTime ) { + endTime = t; } else { @@ -277,6 +296,4 @@ void DateEntry::endTimeChanged( const QString &s ) } - -} - -void DateEntry::endTimeChanged( const QTime &t ) { + timePickerStart->setHour(endTime.hour()); + timePickerStart->setMinute(endTime.minute()); } @@ -328,5 +345,4 @@ void DateEntry::startTimePicked( const QTime &t ) { }else{ - endTime = t; + endTimeChanged(t); updateTimeEdit(false, true ); - } |