summaryrefslogtreecommitdiffabout
path: root/korganizer/kowhatsnextview.cpp
Unidiff
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 18dc656..66ff75d 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -433,158 +433,158 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate )
433 } 433 }
434} 434}
435 435
436 436
437void KOWhatsNextView::showDates(const QDate &, const QDate &) 437void KOWhatsNextView::showDates(const QDate &, const QDate &)
438{ 438{
439 updateView(); 439 updateView();
440} 440}
441 441
442void KOWhatsNextView::showEvents(QPtrList<Event>) 442void KOWhatsNextView::showEvents(QPtrList<Event>)
443{ 443{
444} 444}
445 445
446void KOWhatsNextView::changeEventDisplay(Event *, int action) 446void KOWhatsNextView::changeEventDisplay(Event *, int action)
447{ 447{
448 switch(action) { 448 switch(action) {
449 case KOGlobals::EVENTADDED: 449 case KOGlobals::EVENTADDED:
450 updateView(); 450 updateView();
451 break; 451 break;
452 case KOGlobals::EVENTEDITED: 452 case KOGlobals::EVENTEDITED:
453 updateView(); 453 updateView();
454 break; 454 break;
455 case KOGlobals::EVENTDELETED: 455 case KOGlobals::EVENTDELETED:
456 updateView(); 456 updateView();
457 break; 457 break;
458 default: 458 default:
459 updateView(); 459 updateView();
460 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; 460 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
461 } 461 }
462} 462}
463 463
464bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) 464bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable )
465{ 465{
466 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) 466 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") )
467 return false; 467 return false;
468 QDateTime cdt = QDateTime::currentDateTime(); 468 QDateTime cdt = QDateTime::currentDateTime();
469 QDateTime noc; 469 QDateTime noc;
470 QString tempText; 470 QString tempText;
471 if ( appendTable && !notRed ) { 471 if ( appendTable && !notRed ) {
472 tempText = "<table>"; 472 tempText = "<table>";
473 } 473 }
474 bool ok = true; 474 bool ok = true;
475 if ( reply ) { 475 if ( reply ) {
476 noc = ev->getNextOccurence( cdt, &ok ); 476 noc = ev->getNextOccurence( cdt, &ok );
477 if (! ok && ev->type() == "Event") 477 if (! ok && ev->type() == "Event")
478 return false; 478 return false;
479 } 479 }
480 bool bDay = false; 480 bool bDay = false;
481 if ( ev->categories().contains( i18n("Birthday") ) || ev->categories().contains( i18n("Anniversary") ) ) 481 if ( ev->isBirthday() || ev->isAnniversary() )
482 bDay = true; 482 bDay = true;
483 tempText += "<tr><td><b>"; 483 tempText += "<tr><td><b>";
484 if (ev->type()=="Event") { 484 if (ev->type()=="Event") {
485 if (reply) { 485 if (reply) {
486 if (!ev->doesFloat()) 486 if (!ev->doesFloat())
487 tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; 487 tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
488 else 488 else
489 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 489 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
490 490
491 } else { 491 } else {
492 if (!ev->doesFloat()) { 492 if (!ev->doesFloat()) {
493 Event *event = static_cast<Event *>(ev); 493 Event *event = static_cast<Event *>(ev);
494 QDateTime st,end; 494 QDateTime st,end;
495 if ( event->recurrence()->doesRecur() ) { 495 if ( event->recurrence()->doesRecur() ) {
496 QDate recDate= mEventDate; 496 QDate recDate= mEventDate;
497 int days = event->dtStart().date().daysTo (event->dtEnd().date() ); 497 int days = event->dtStart().date().daysTo (event->dtEnd().date() );
498 while ( ! event->recursOn( recDate ) ) { 498 while ( ! event->recursOn( recDate ) ) {
499 recDate = recDate.addDays( -1 ); 499 recDate = recDate.addDays( -1 );
500 500
501 } 501 }
502 st = QDateTime ( recDate, event->dtStart().time() ); 502 st = QDateTime ( recDate, event->dtStart().time() );
503 end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); 503 end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() );
504 } 504 }
505 else { 505 else {
506 st = event->dtStart(); 506 st = event->dtStart();
507 end = event->dtEnd(); 507 end = event->dtEnd();
508 } 508 }
509 509
510 510
511 QString dateText; 511 QString dateText;
512 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); 512 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() );
513 if ( st.date() < mEventDate ) 513 if ( st.date() < mEventDate )
514 dateText = "++:++-"; 514 dateText = "++:++-";
515 else 515 else
516 dateText = event->dtStartTimeStr() + "-"; 516 dateText = event->dtStartTimeStr() + "-";
517 if ( end.date() > mEventDate ) 517 if ( end.date() > mEventDate )
518 dateText += "++:++"; 518 dateText += "++:++";
519 else 519 else
520 dateText += event->dtEndTimeStr(); 520 dateText += event->dtEndTimeStr();
521 if ( notRed ) 521 if ( notRed )
522 tempText += dateText; 522 tempText += dateText;
523 else { 523 else {
524 if ( end < cdt ) { 524 if ( end < cdt ) {
525 if ( !KOPrefs::instance()->mWNViewShowsPast ) 525 if ( !KOPrefs::instance()->mWNViewShowsPast )
526 return false; 526 return false;
527 tempText += "<font color=\"#F00000\">" + dateText + "</font>"; 527 tempText += "<font color=\"#F00000\">" + dateText + "</font>";
528 } 528 }
529 else if ( st < cdt ) 529 else if ( st < cdt )
530 tempText += "<font color=\"#008000\">" + dateText + "</font>"; 530 tempText += "<font color=\"#008000\">" + dateText + "</font>";
531 else 531 else
532 tempText += dateText; 532 tempText += dateText;
533 533
534 } 534 }
535 535
536 } else { 536 } else {
537 if ( bDay ) { 537 if ( bDay ) {
538 538
539 if ( ev->categories().contains( i18n("Birthday") )) 539 if ( ev->isBirthday())
540 tempText += "<font color=\"#F00000\">" + i18n("Birthday") +":</font>"; 540 tempText += "<font color=\"#00B000\">" + i18n("Birthday") +":</font>";
541 else 541 else
542 tempText += "<font color=\"#F00000\">" + i18n("Anniversary")+":</font>"; 542 tempText += "<font color=\"#00B0000\">" + i18n("Anniversary")+":</font>";
543 } else { 543 } else {
544 tempText += i18n("Allday:"); 544 tempText += i18n("Allday:");
545 } 545 }
546 546
547 } 547 }
548 } 548 }
549 } else { 549 } else {
550 mTodos.append( ev ); 550 mTodos.append( ev );
551 tempText += i18n("ToDo:"); 551 tempText += i18n("ToDo:");
552 if (reply) { 552 if (reply) {
553 tempText += " "; 553 tempText += " ";
554 if ( noc != cdt ) { 554 if ( noc != cdt ) {
555 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 555 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
556 } 556 }
557 } else { 557 } else {
558 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { 558 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
559 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 559 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
560 QString dfs = KGlobal::locale()->dateFormatShort(); 560 QString dfs = KGlobal::locale()->dateFormatShort();
561 KGlobal::locale()->setDateFormatShort("%d.%b"); 561 KGlobal::locale()->setDateFormatShort("%d.%b");
562 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 562 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
563 KGlobal::locale()->setDateFormatShort(dfs); 563 KGlobal::locale()->setDateFormatShort(dfs);
564 } else { 564 } else {
565 if (!ev->doesFloat() ) 565 if (!ev->doesFloat() )
566 if( ( (Todo*)ev)->dtDue() < cdt ) { 566 if( ( (Todo*)ev)->dtDue() < cdt ) {
567 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; 567 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
568 568
569 569
570 } else 570 } else
571 tempText +=((Todo*)ev)->dtDueTimeStr(); 571 tempText +=((Todo*)ev)->dtDueTimeStr();
572 mTodos.append( ev ); 572 mTodos.append( ev );
573 } 573 }
574 } 574 }
575 } 575 }
576 tempText += "</b></td><td>"; 576 tempText += "</b></td><td>";
577 bool needClose = false; 577 bool needClose = false;
578 if ( ev->cancelled() ) { 578 if ( ev->cancelled() ) {
579 tempText += "<font color=\"#F00000\">[c"; 579 tempText += "<font color=\"#F00000\">[c";
580 needClose =true; 580 needClose =true;
581 581
582 } 582 }
583 if ( ev->isAlarmEnabled() ) { 583 if ( ev->isAlarmEnabled() ) {
584 if ( !needClose) 584 if ( !needClose)
585 tempText +="["; 585 tempText +="[";
586 tempText += "a"; 586 tempText += "a";
587 needClose =true; 587 needClose =true;
588 588
589 } 589 }
590 if ( ev->description().length() > 0 ) { 590 if ( ev->description().length() > 0 ) {