summaryrefslogtreecommitdiff
path: root/core/pim/datebook/dateentryimpl.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/dateentryimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/dateentryimpl.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp
index d9e5225..856837c 100644
--- a/core/pim/datebook/dateentryimpl.cpp
+++ b/core/pim/datebook/dateentryimpl.cpp
@@ -228,52 +228,49 @@ void DateEntry::init()
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 = "<B>"+ TimeString::longDateString( startDate ) + "</B>"; 247 s = "<B>"+ TimeString::longDateString( startDate ) + "</B>";
248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month()); 248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month());
249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, 249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr,
250 this,0,TRUE); 250 this,0,TRUE);
251 251
252#if defined(Q_WS_QWS) || defined(_WS_QWS_) 252 if ( QPEApplication::execDialog( &noteDlg ) ) {
253 noteDlg.showMaximized();
254#endif
255 if (noteDlg.exec() ) {
256 noteStr=noteDlg.note->text(); 253 noteStr=noteDlg.note->text();
257 } 254 }
258 255
259} 256}
260 257
261void DateEntry::endDateChanged( int y, int m, int d ) 258void DateEntry::endDateChanged( int y, int m, int d )
262{ 259{
263 endDate.setYMD( y, m, d ); 260 endDate.setYMD( y, m, d );
264 if ( endDate < startDate ) { 261 if ( endDate < startDate ) {
265 endDate = startDate; 262 endDate = startDate;
266 } 263 }
267 264
268 buttonEnd->setText( TimeString::shortDate( endDate ) ); 265 buttonEnd->setText( TimeString::shortDate( endDate ) );
269 266
270 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() ); 267 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() );
271} 268}
272 269
273static QTime parseTime( const QString& s, bool ampm ) 270static QTime parseTime( const QString& s, bool ampm )
274{ 271{
275 QTime tmpTime; 272 QTime tmpTime;
276 QStringList l = QStringList::split( ':', s ); 273 QStringList l = QStringList::split( ':', s );
277 int hour = l[0].toInt(); 274 int hour = l[0].toInt();
278 if ( ampm ) { 275 if ( ampm ) {
279 int i=0; 276 int i=0;
@@ -374,52 +371,49 @@ void DateEntry::startTimePicked( const QTime &t ) {
374 371
375/* 372/*
376 * public slot 373 * public slot
377 */ 374 */
378void DateEntry::typeChanged( const QString &s ) 375void DateEntry::typeChanged( const QString &s )
379{ 376{
380 bool b = s != "All Day"; 377 bool b = s != "All Day";
381 buttonStart->setEnabled( b ); 378 buttonStart->setEnabled( b );
382 comboStart->setEnabled( b ); 379 comboStart->setEnabled( b );
383 comboEnd->setEnabled( b ); 380 comboEnd->setEnabled( b );
384} 381}
385 382
386void DateEntry::slotRepeat() 383void DateEntry::slotRepeat()
387{ 384{
388 // Work around for compiler Bug.. 385 // Work around for compiler Bug..
389 RepeatEntry *e; 386 RepeatEntry *e;
390 387
391 // it is better in my opinion to just grab this from the mother, 388 // it is better in my opinion to just grab this from the mother,
392 // since, this dialog doesn't need to keep track of it... 389 // since, this dialog doesn't need to keep track of it...
393 if ( rp.type != Event::NoRepeat ) 390 if ( rp.type != Event::NoRepeat )
394 e = new RepeatEntry( startWeekOnMonday, rp, startDate, this); 391 e = new RepeatEntry( startWeekOnMonday, rp, startDate, this);
395 else 392 else
396 e = new RepeatEntry( startWeekOnMonday, startDate, this ); 393 e = new RepeatEntry( startWeekOnMonday, startDate, this );
397 394
398#if defined(Q_WS_QWS) || defined(_WS_QWS_) 395 if ( QPEApplication::execDialog( e ) ) {
399 e->showMaximized();
400#endif
401 if ( e->exec() ) {
402 rp = e->repeatPattern(); 396 rp = e->repeatPattern();
403 setRepeatLabel(); 397 setRepeatLabel();
404 } 398 }
405 // deleting sounds like a nice idea... 399 // deleting sounds like a nice idea...
406 delete e; 400 delete e;
407} 401}
408 402
409void DateEntry::slotChangeStartOfWeek( bool onMonday ) 403void DateEntry::slotChangeStartOfWeek( bool onMonday )
410{ 404{
411 startWeekOnMonday = onMonday; 405 startWeekOnMonday = onMonday;
412} 406}
413 407
414Event DateEntry::event() 408Event DateEntry::event()
415{ 409{
416 Event ev; 410 Event ev;
417 Event::SoundTypeChoice st; 411 Event::SoundTypeChoice st;
418 ev.setDescription( comboDescription->currentText() ); 412 ev.setDescription( comboDescription->currentText() );
419 ev.setLocation( comboLocation->currentText() ); 413 ev.setLocation( comboLocation->currentText() );
420 ev.setCategories( comboCategory->currentCategories() ); 414 ev.setCategories( comboCategory->currentCategories() );
421 ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal ); 415 ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal );
422 if ( startDate > endDate ) { 416 if ( startDate > endDate ) {
423 QDate tmp = endDate; 417 QDate tmp = endDate;
424 endDate = startDate; 418 endDate = startDate;
425 startDate = tmp; 419 startDate = tmp;