summaryrefslogtreecommitdiff
authorzecke <zecke>2002-06-28 16:07:01 (UTC)
committer zecke <zecke>2002-06-28 16:07:01 (UTC)
commitce221c2cf5b003f1033e6f0b603670ceb0bff7c7 (patch) (unidiff)
tree4fb48670dbf009ad9735a003d08f0d138be317db
parentab413257c3a23f535e99f8f61468382c73bc4adb (diff)
downloadopie-ce221c2cf5b003f1033e6f0b603670ceb0bff7c7.zip
opie-ce221c2cf5b003f1033e6f0b603670ceb0bff7c7.tar.gz
opie-ce221c2cf5b003f1033e6f0b603670ceb0bff7c7.tar.bz2
Fix bug #15
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/dateentryimpl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index 2cdda9d..33b9d9b 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -215,65 +215,66 @@ void DateEntry::init()
215 connect( editNote, SIGNAL(clicked()), 215 connect( editNote, SIGNAL(clicked()),
216 this, SLOT(slotEditNote()) ); 216 this, SLOT(slotEditNote()) );
217 217
218 QPopupMenu *m2 = new QPopupMenu( this ); 218 QPopupMenu *m2 = new QPopupMenu( this );
219 endPicker = new DateBookMonth( m2, 0, TRUE ); 219 endPicker = new DateBookMonth( m2, 0, TRUE );
220 m2->insertItem( endPicker ); 220 m2->insertItem( endPicker );
221 buttonEnd->setPopup( m2 ); 221 buttonEnd->setPopup( m2 );
222 connect( endPicker, SIGNAL( dateClicked( int, int, int ) ), 222 connect( endPicker, SIGNAL( dateClicked( int, int, int ) ),
223 this, SLOT( endDateChanged( int, int, int ) ) ); 223 this, SLOT( endDateChanged( int, int, int ) ) );
224 224
225 connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ), 225 connect(timePickerStart, SIGNAL( timeChanged(const QTime &) ),
226 this, SLOT( startTimePicked(const QTime &) )); 226 this, SLOT( startTimePicked(const QTime &) ));
227 // install eventFilters 227 // install eventFilters
228 comboEnd->installEventFilter( this ); 228 comboEnd->installEventFilter( this );
229 comboStart->installEventFilter( this ); 229 comboStart->installEventFilter( this );
230} 230}
231 231
232/* 232/*
233 * Destroys the object and frees any allocated resources 233 * Destroys the object and frees any allocated resources
234 */ 234 */
235DateEntry::~DateEntry() 235DateEntry::~DateEntry()
236{ 236{
237 // no need to delete child widgets, Qt does it all for us 237 // no need to delete child widgets, Qt does it all for us
238 //cout << "Del: " << comboStart->currentText() << endl; 238 //cout << "Del: " << comboStart->currentText() << endl;
239} 239}
240 240
241/* 241/*
242 * public slot 242 * public slot
243 */ 243 */
244 244
245void DateEntry::slotEditNote() { 245void DateEntry::slotEditNote() {
246 QString s; 246 QString s;
247 s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month()); 247 s = "<B>"+ TimeString::longDateString( startDate ) + "</B>";
248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month());
248 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, 249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr,
249 this,0,TRUE); 250 this,0,TRUE);
250 251
251#if defined(Q_WS_QWS) || defined(_WS_QWS_) 252#if defined(Q_WS_QWS) || defined(_WS_QWS_)
252 noteDlg.showMaximized(); 253 noteDlg.showMaximized();
253#endif 254#endif
254 if (noteDlg.exec() ) { 255 if (noteDlg.exec() ) {
255 noteStr=noteDlg.note->text(); 256 noteStr=noteDlg.note->text();
256 } 257 }
257 258
258} 259}
259 260
260void DateEntry::endDateChanged( int y, int m, int d ) 261void DateEntry::endDateChanged( int y, int m, int d )
261{ 262{
262 endDate.setYMD( y, m, d ); 263 endDate.setYMD( y, m, d );
263 if ( endDate < startDate ) { 264 if ( endDate < startDate ) {
264 endDate = startDate; 265 endDate = startDate;
265 } 266 }
266 267
267 buttonEnd->setText( TimeString::shortDate( endDate ) ); 268 buttonEnd->setText( TimeString::shortDate( endDate ) );
268 269
269 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() ); 270 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() );
270} 271}
271 272
272static QTime parseTime( const QString& s, bool ampm ) 273static QTime parseTime( const QString& s, bool ampm )
273{ 274{
274 QTime tmpTime; 275 QTime tmpTime;
275 QStringList l = QStringList::split( ':', s ); 276 QStringList l = QStringList::split( ':', s );
276 int hour = l[0].toInt(); 277 int hour = l[0].toInt();
277 if ( ampm ) { 278 if ( ampm ) {
278 int i=0; 279 int i=0;
279 while (i<int(l[1].length()) && l[1][i]>='0' && l[1][i]<='9') 280 while (i<int(l[1].length()) && l[1][i]>='0' && l[1][i]<='9')