summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f595d35..d0380e3 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -536,96 +536,99 @@ void MonthViewCell::insertEvent(Event *event)
536 if ( me->status() == Attendee::NeedsAction && me->RSVP()) 536 if ( me->status() == Attendee::NeedsAction && me->RSVP())
537 item->setReply(true); 537 item->setReply(true);
538 else 538 else
539 item->setReply(false); 539 item->setReply(false);
540 } else 540 } else
541 item->setReply(false); 541 item->setReply(false);
542#endif 542#endif
543 mItemList->insertItem( item ); 543 mItemList->insertItem( item );
544 mToolTip += "\n"; 544 mToolTip += "\n";
545} 545}
546void MonthViewCell::insertTodo(Todo *todo) 546void MonthViewCell::insertTodo(Todo *todo)
547{ 547{
548 mItemList->setFocusPolicy(WheelFocus); 548 mItemList->setFocusPolicy(WheelFocus);
549 QString text; 549 QString text;
550 if (todo->hasDueDate()) { 550 if (todo->hasDueDate()) {
551 if (!todo->doesFloat()) { 551 if (!todo->doesFloat()) {
552 text += KGlobal::locale()->formatTime(todo->dtDue().time()); 552 text += KGlobal::locale()->formatTime(todo->dtDue().time());
553 text += " "; 553 text += " ";
554 } 554 }
555 } 555 }
556 text += i18n("T: %1").arg(todo->summary()); 556 text += i18n("T: %1").arg(todo->summary());
557 557
558 MonthViewItem *item = new MonthViewItem( todo, mDate, text ); 558 MonthViewItem *item = new MonthViewItem( todo, mDate, text );
559 //item->setPalette( mStandardPalette ); 559 //item->setPalette( mStandardPalette );
560 QPalette pal; 560 QPalette pal;
561 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 561 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
562 QStringList categories = todo->categories(); 562 QStringList categories = todo->categories();
563 QString cat = categories.first(); 563 QString cat = categories.first();
564 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 564 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
565 pal = getPalette(); 565 pal = getPalette();
566 if (cat.isEmpty()) { 566 if (cat.isEmpty()) {
567 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 567 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
568 } else { 568 } else {
569 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 569 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
570 } 570 }
571 571
572 } else { 572 } else {
573 if (cat.isEmpty()) { 573 if (cat.isEmpty()) {
574 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 574 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
575 } else { 575 } else {
576 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 576 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
577 } 577 }
578 } 578 }
579 579
580 } else { 580 } else {
581 pal = mStandardPalette ; 581 pal = mStandardPalette ;
582 } 582 }
583 item->setPalette( pal ); 583 item->setPalette( pal );
584 item->setRecur( todo->recurrence()->doesRecur() );
585 item->setAlarm( todo->isAlarmEnabled() );
586 item->setMoreInfo( todo->description().length() > 0 );
584 mItemList->insertItem( item ); 587 mItemList->insertItem( item );
585 mToolTip += text+"\n"; 588 mToolTip += text+"\n";
586} 589}
587void MonthViewCell::finishUpdateCell() 590void MonthViewCell::finishUpdateCell()
588{ 591{
589#ifdef DESKTOP_VERSION 592#ifdef DESKTOP_VERSION
590 if (mToolTip != "") 593 if (mToolTip != "")
591 QToolTip::add(this,mToolTip,toolTipGroup(),""); 594 QToolTip::add(this,mToolTip,toolTipGroup(),"");
592#endif 595#endif
593 mItemList->sort(); 596 mItemList->sort();
594 //setMyPalette(); 597 //setMyPalette();
595 setMyPalette(); 598 setMyPalette();
596 QString text; 599 QString text;
597 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 600 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
598 if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 601 if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
599 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; 602 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
600 mLabel->resize( mLabelBigSize ); 603 mLabel->resize( mLabelBigSize );
601 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 604 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
602 } else { 605 } else {
603 mLabel->resize( mLabelSize ); 606 mLabel->resize( mLabelSize );
604 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 607 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
605 } 608 }
606 609
607 mLabel->setText( text ); 610 mLabel->setText( text );
608 resizeEvent( 0 ); 611 resizeEvent( 0 );
609} 612}
610void MonthViewCell::updateCell() 613void MonthViewCell::updateCell()
611{ 614{
612 qDebug("MonthViewCell::updateCell() "); 615 qDebug("MonthViewCell::updateCell() ");
613 if ( !mMonthView->isUpdatePossible() ) 616 if ( !mMonthView->isUpdatePossible() )
614 return; 617 return;
615 startUpdateCell(); 618 startUpdateCell();
616 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 619 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
617 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 620 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
618 Event *event; 621 Event *event;
619 for( event = events.first(); event; event = events.next() ) { // for event 622 for( event = events.first(); event; event = events.next() ) { // for event
620 insertEvent(event); 623 insertEvent(event);
621 } 624 }
622 // insert due todos 625 // insert due todos
623 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); 626 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
624 Todo *todo; 627 Todo *todo;
625 for(todo = todos.first(); todo; todo = todos.next()) { 628 for(todo = todos.first(); todo; todo = todos.next()) {
626 insertTodo( todo ); 629 insertTodo( todo );
627 } 630 }
628 finishUpdateCell(); 631 finishUpdateCell();
629 // if ( isVisible()) 632 // if ( isVisible())
630 //qApp->processEvents(); 633 //qApp->processEvents();
631} 634}