summaryrefslogtreecommitdiff
authorhakan <hakan>2002-05-06 21:09:38 (UTC)
committer hakan <hakan>2002-05-06 21:09:38 (UTC)
commitf046179d3b49c44896298aa86380046a21394bbc (patch) (unidiff)
treeb0df64a4170cd9d2631244213b33c7ef0e55b4f8
parent8622bcb85245937853f3e657498957deb7eb2073 (diff)
downloadopie-f046179d3b49c44896298aa86380046a21394bbc.zip
opie-f046179d3b49c44896298aa86380046a21394bbc.tar.gz
opie-f046179d3b49c44896298aa86380046a21394bbc.tar.bz2
In the date entry dialog:
- Show end time (not only chnage label) when end textbox is selected. - Update timepicker when endtime is edited. - Update time textboxes when they looses focus. - Got rid of vertical empty borders. - "All day" dissables timepicker aswell. - Picking bad end time will set and show end time to starttime
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/dateentry.ui40
-rw-r--r--core/pim/datebook/dateentryimpl.cpp38
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 @@
45 <name>margin</name> 45 <name>margin</name>
46 <number>0</number> 46 <number>2</number>
47 </property> 47 </property>
@@ -149,3 +149,3 @@
149 <name>text</name> 149 <name>text</name>
150 <string>Description</string> 150 <string>Description </string>
151 </property> 151 </property>
@@ -211,3 +211,3 @@
211 <name>text</name> 211 <name>text</name>
212 <string>Start - End</string> 212 <string>Start - End </string>
213 </property> 213 </property>
@@ -267,2 +267,24 @@
267 </widget> 267 </widget>
268 <spacer row="3" column="2" rowspan="2" colspan="1" >
269 <property>
270 <name>name</name>
271 <cstring>Spacer1_2</cstring>
272 </property>
273 <property stdset="1">
274 <name>orientation</name>
275 <enum>Horizontal</enum>
276 </property>
277 <property stdset="1">
278 <name>sizeType</name>
279 <enum>Expanding</enum>
280 </property>
281 <property>
282 <name>sizeHint</name>
283 <size>
284 <width>20</width>
285 <height>20</height>
286 </size>
287 </property>
288 </spacer>
289
268 <widget row="5" column="1" colspan="3"> 290 <widget row="5" column="1" colspan="3">
@@ -274,3 +296,3 @@
274 </widget> 296 </widget>
275 <widget row="3" column="2" colspan="2"> 297 <widget row="3" column="3" colspan="1">
276 <class>QPushButton</class> 298 <class>QPushButton</class>
@@ -299,3 +321,3 @@
299 </widget> 321 </widget>
300 <widget row="4" column="2" colspan="2"> 322 <widget row="4" column="3" colspan="1">
301 <class>QLineEdit</class> 323 <class>QLineEdit</class>
@@ -331,3 +353,3 @@
331 <name>name</name> 353 <name>name</name>
332 <cstring>TextLabel3_2</cstring> 354 <cstring>TimePickerLabel</cstring>
333 </property> 355 </property>
@@ -565,2 +587,8 @@
565 <connection> 587 <connection>
588 <sender>checkAllDay</sender>
589 <signal>toggled(bool)</signal>
590 <receiver>timePickerStart</receiver>
591 <slot>setDisabled(bool)</slot>
592 </connection>
593 <connection>
566 <sender>checkAlarm</sender> 594 <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 )
70 if( obj == comboStart ){ 70 if( obj == comboStart ){
71 TextLabel3_2->setText( tr("Start Time" ) ); 71 timePickerStart->setHour(startTime.hour());
72 timePickerStart->setMinute(startTime.minute());
73 TimePickerLabel->setText( tr("Start Time" ) );
72 m_showStart= true; 74 m_showStart= true;
73 }else if( obj == comboEnd ){ 75 }else if( obj == comboEnd ){
74 TextLabel3_2->setText( tr("End Time") ); 76 timePickerStart->setHour(endTime.hour());
77 timePickerStart->setMinute(endTime.minute());
78 TimePickerLabel->setText( tr("End Time") );
75 m_showStart = false; 79 m_showStart = false;
76 } 80 }
81 } else if( ev->type() == QEvent::FocusOut ){
82 if( obj == comboEnd ){
83 QString s;
84 s.sprintf("%.2d:%.2d",endTime.hour(), endTime.minute());
85 comboEnd->setText(s);
86 }
87 else if( obj == comboStart ){
88 QString s;
89 s.sprintf("%.2d:%.2d",startTime.hour(), startTime.minute());
90 comboStart->setText(s);
91 }
77 } 92 }
93
78 return false; 94 return false;
@@ -270,5 +286,8 @@ void DateEntry::endTimeChanged( const QString &s )
270{ 286{
271 QTime tmpTime = parseTime(s,ampm); 287 endTimeChanged( parseTime(s,ampm) );
272 if ( endDate > startDate || tmpTime >= startTime ) { 288}
273 endTime = tmpTime; 289
290void DateEntry::endTimeChanged( const QTime &t ) {
291 if ( endDate > startDate || t >= startTime ) {
292 endTime = t;
274 } else { 293 } else {
@@ -277,6 +296,4 @@ void DateEntry::endTimeChanged( const QString &s )
277 } 296 }
278 297 timePickerStart->setHour(endTime.hour());
279} 298 timePickerStart->setMinute(endTime.minute());
280
281void DateEntry::endTimeChanged( const QTime &t ) {
282} 299}
@@ -328,5 +345,4 @@ void DateEntry::startTimePicked( const QTime &t ) {
328 }else{ 345 }else{
329 endTime = t; 346 endTimeChanged(t);
330 updateTimeEdit(false, true ); 347 updateTimeEdit(false, true );
331
332 } 348 }