summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-21 17:39:46 (UTC)
committer zautrix <zautrix>2005-03-21 17:39:46 (UTC)
commit3c5d7b484e6ab263ab4091f22815770ea8da6c9c (patch) (unidiff)
tree97f86965d7ae565fc054918978756c3953476e82 /korganizer
parent070055b60f76ffd6907e44a4ffc2d752578f3211 (diff)
downloadkdepimpi-3c5d7b484e6ab263ab4091f22815770ea8da6c9c.zip
kdepimpi-3c5d7b484e6ab263ab4091f22815770ea8da6c9c.tar.gz
kdepimpi-3c5d7b484e6ab263ab4091f22815770ea8da6c9c.tar.bz2
fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp3
-rw-r--r--korganizer/kodaymatrix.cpp4
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/kowhatsnextview.cpp8
4 files changed, 8 insertions, 10 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index e029fdb..eb3a6cd 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1397,50 +1397,49 @@ void KOAgendaView::writeSettings(KConfig *config)
1397 1397
1398 config->setGroup("Views"); 1398 config->setGroup("Views");
1399 1399
1400 //#ifndef KORG_NOSPLITTER 1400 //#ifndef KORG_NOSPLITTER
1401 QValueList<int> list = mSplitterAgenda->sizes(); 1401 QValueList<int> list = mSplitterAgenda->sizes();
1402 config->writeEntry("Separator AgendaView",list); 1402 config->writeEntry("Separator AgendaView",list);
1403 //qDebug("write %d %d ", list[0],list[1] ); 1403 //qDebug("write %d %d ", list[0],list[1] );
1404 //#endif 1404 //#endif
1405} 1405}
1406 1406
1407void KOAgendaView::setHolidayMasks() 1407void KOAgendaView::setHolidayMasks()
1408{ 1408{
1409 mHolidayMask.resize(mSelectedDates.count()); 1409 mHolidayMask.resize(mSelectedDates.count());
1410 1410
1411 uint i; 1411 uint i;
1412 for(i=0;i<mSelectedDates.count();++i) { 1412 for(i=0;i<mSelectedDates.count();++i) {
1413 QDate date = mSelectedDates[i]; 1413 QDate date = mSelectedDates[i];
1414 bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); 1414 bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6);
1415 bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); 1415 bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7);
1416 bool showHoliday = false; 1416 bool showHoliday = false;
1417 if ( KOPrefs::instance()->mExcludeHolidays ) { 1417 if ( KOPrefs::instance()->mExcludeHolidays ) {
1418 QPtrList<Event> events = calendar()->events( date, true ); 1418 QPtrList<Event> events = calendar()->events( date, true );
1419 Event *event; 1419 Event *event;
1420 for( event = events.first(); event; event = events.next() ) { 1420 for( event = events.first(); event; event = events.next() ) {
1421 if ( event->categories().contains("Holiday") || 1421 if ( event->isHoliday()) {
1422 event->categories().contains(i18n("Holiday"))) {
1423 showHoliday = true; 1422 showHoliday = true;
1424 break; 1423 break;
1425 } 1424 }
1426 } 1425 }
1427 1426
1428 } 1427 }
1429 1428
1430#ifndef KORG_NOPLUGINS 1429#ifndef KORG_NOPLUGINS
1431 bool showHoliday = KOPrefs::instance()->mExcludeHolidays && 1430 bool showHoliday = KOPrefs::instance()->mExcludeHolidays &&
1432 !KOCore::self()->holiday(date).isEmpty(); 1431 !KOCore::self()->holiday(date).isEmpty();
1433#endif 1432#endif
1434 bool showDay = showSaturday || showSunday || showHoliday; 1433 bool showDay = showSaturday || showSunday || showHoliday;
1435 1434
1436 if (showDay) { 1435 if (showDay) {
1437 mHolidayMask.at(i) = true; 1436 mHolidayMask.at(i) = true;
1438 } else { 1437 } else {
1439 mHolidayMask.at(i) = false; 1438 mHolidayMask.at(i) = false;
1440 } 1439 }
1441 } 1440 }
1442 1441
1443 mAgenda->setHolidayMask(&mHolidayMask); 1442 mAgenda->setHolidayMask(&mHolidayMask);
1444 mAllDayAgenda->setHolidayMask(&mHolidayMask); 1443 mAllDayAgenda->setHolidayMask(&mHolidayMask);
1445} 1444}
1446 1445
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index d7a4112..36cd990 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -327,56 +327,56 @@ void KODayMatrix::repaintViewTimed()
327 mRepaintTimer->stop(); 327 mRepaintTimer->stop();
328 repaint(false); 328 repaint(false);
329} 329}
330void KODayMatrix::updateViewTimed() 330void KODayMatrix::updateViewTimed()
331{ 331{
332 mUpdateTimer->stop(); 332 mUpdateTimer->stop();
333 if ( !mCalendar ) { 333 if ( !mCalendar ) {
334 qDebug("NOT CAL "); 334 qDebug("NOT CAL ");
335 return; 335 return;
336 } 336 }
337 //qDebug("KODayMatrix::updateViewTimed "); 337 //qDebug("KODayMatrix::updateViewTimed ");
338 for(int i = 0; i < NUMDAYS; i++) { 338 for(int i = 0; i < NUMDAYS; i++) {
339 // if events are set for the day then remember to draw it bold 339 // if events are set for the day then remember to draw it bold
340 QPtrList<Event> eventlist = mCalendar->events(days[i]); 340 QPtrList<Event> eventlist = mCalendar->events(days[i]);
341 Event *event; 341 Event *event;
342 int numEvents = eventlist.count(); 342 int numEvents = eventlist.count();
343 QString holiStr = ""; 343 QString holiStr = "";
344 bDays.clearBit(i); 344 bDays.clearBit(i);
345 for(event=eventlist.first();event != 0;event=eventlist.next()) { 345 for(event=eventlist.first();event != 0;event=eventlist.next()) {
346 ushort recurType = event->recurrence()->doesRecur(); 346 ushort recurType = event->recurrence()->doesRecur();
347 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || 347 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
348 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 348 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
349 numEvents--; 349 numEvents--;
350 } 350 }
351 if ( event->categories().contains( i18n("Holiday") ) || event->categories().contains( "Holiday" )) { 351 if ( event->isHoliday()) {
352 if ( !holiStr.isEmpty() ) 352 if ( !holiStr.isEmpty() )
353 holiStr += "\n"; 353 holiStr += "\n";
354 holiStr += event->summary(); 354 holiStr += event->summary();
355 if ( !event->location().isEmpty() ) 355 if ( !event->location().isEmpty() )
356 holiStr += " (" + event->location() + ")"; 356 holiStr += " (" + event->location() + ")";
357 } 357 }
358 if ( event->categories().contains( i18n("Birthday") ) || event->categories().contains( "Birthday" )) { 358 if ( event->isBirthday()) {
359 if ( !holiStr.isEmpty() ) 359 if ( !holiStr.isEmpty() )
360 holiStr += "\n"; 360 holiStr += "\n";
361 holiStr += i18n("Birthday") + ": "+event->summary(); 361 holiStr += i18n("Birthday") + ": "+event->summary();
362 if ( !event->location().isEmpty() ) 362 if ( !event->location().isEmpty() )
363 holiStr += " (" + event->location() + ")"; 363 holiStr += " (" + event->location() + ")";
364 bDays.setBit(i); 364 bDays.setBit(i);
365 } 365 }
366 } 366 }
367 events[i] = numEvents; 367 events[i] = numEvents;
368 //if it is a holy day then draw it red. Sundays are consider holidays, too 368 //if it is a holy day then draw it red. Sundays are consider holidays, too
369 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || 369 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) ||
370 !holiStr.isEmpty()) { 370 !holiStr.isEmpty()) {
371 mHolidays[i] = holiStr; 371 mHolidays[i] = holiStr;
372 } else { 372 } else {
373 mHolidays[i] = QString::null; 373 mHolidays[i] = QString::null;
374 } 374 }
375 } 375 }
376 if ( ! mPendingUpdateBeforeRepaint ) 376 if ( ! mPendingUpdateBeforeRepaint )
377 repaint(false); 377 repaint(false);
378} 378}
379void KODayMatrix::updateView(QDate actdate) 379void KODayMatrix::updateView(QDate actdate)
380{ 380{
381 381
382 if ( ! actdate.isValid() ) { 382 if ( ! actdate.isValid() ) {
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 004ff50..76982b4 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -494,50 +494,49 @@ void MonthViewCell::startUpdateCell()
494 QToolTip::remove(this); 494 QToolTip::remove(this);
495#endif 495#endif
496 mToolTip.clear(); 496 mToolTip.clear();
497 //qApp->processEvents(); 497 //qApp->processEvents();
498 if ( !mHolidayString.isEmpty() ) { 498 if ( !mHolidayString.isEmpty() ) {
499 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); 499 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
500 item->setPalette( mHolidayPalette ); 500 item->setPalette( mHolidayPalette );
501 mItemList->insertItem( item ); 501 mItemList->insertItem( item );
502 mToolTip.append ( mHolidayString ); 502 mToolTip.append ( mHolidayString );
503 } 503 }
504} 504}
505 505
506void MonthViewCell::insertEvent(Event *event) 506void MonthViewCell::insertEvent(Event *event)
507{ 507{
508 QString mToolTipText; 508 QString mToolTipText;
509 mItemList->setFocusPolicy(WheelFocus); 509 mItemList->setFocusPolicy(WheelFocus);
510 if ( !(event->doesRecur() == Recurrence::rNone) ) { 510 if ( !(event->doesRecur() == Recurrence::rNone) ) {
511 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 511 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
512 return; 512 return;
513 else 513 else
514 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) 514 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
515 return; 515 return;
516 } 516 }
517 517
518 if ( event->categories().contains("Holiday") || 518 if ( event->isHoliday()) {
519 event->categories().contains(i18n("Holiday"))) {
520 setHoliday( true ); 519 setHoliday( true );
521 if ( mDate.dayOfWeek() == 7 ) 520 if ( mDate.dayOfWeek() == 7 )
522 mItemList->setLineWidth( 3 ); 521 mItemList->setLineWidth( 3 );
523 } 522 }
524 QString text; 523 QString text;
525 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day 524 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
526 if (event->isMultiDay()) { 525 if (event->isMultiDay()) {
527 QString prefix = "<->";multiday = 2; 526 QString prefix = "<->";multiday = 2;
528 QString time; 527 QString time;
529 if ( event->doesRecur() ) { 528 if ( event->doesRecur() ) {
530 if ( event->recursOn( mDate) ) { 529 if ( event->recursOn( mDate) ) {
531 prefix ="->" ;multiday = 1; 530 prefix ="->" ;multiday = 1;
532 } 531 }
533 else { 532 else {
534 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 533 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
535 if ( event->recursOn( mDate.addDays( -days)) ) { 534 if ( event->recursOn( mDate.addDays( -days)) ) {
536 prefix ="<-" ;multiday = 3; 535 prefix ="<-" ;multiday = 3;
537 } 536 }
538 } 537 }
539 538
540 } else { 539 } else {
541 if (mDate == event->dtStart().date()) { 540 if (mDate == event->dtStart().date()) {
542 prefix ="->" ;multiday = 1; 541 prefix ="->" ;multiday = 1;
543 } else if (mDate == event->dtEnd().date()) { 542 } else if (mDate == event->dtEnd().date()) {
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 18dc656..66ff75d 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -457,49 +457,49 @@ void KOWhatsNextView::changeEventDisplay(Event *, int action)
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 {
@@ -515,52 +515,52 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
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 ) {