author | zautrix <zautrix> | 2005-04-19 19:32:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-19 19:32:54 (UTC) |
commit | cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee (patch) (side-by-side diff) | |
tree | 70cb7e2db9d7075a7c7e7c38adbad0c50e5d8dc4 /korganizer/kodaymatrix.cpp | |
parent | b36bdf88fbf3cc78e4bf072b5eb3ec16bd8ec235 (diff) | |
download | kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.zip kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.gz kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kodaymatrix.cpp | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 17a1d13..df606d0 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -367,5 +367,7 @@ void KODayMatrix::computeEvent(Event *event, int i ) holiStr += " (" + event->location() + ")"; mHolidays[i] =holiStr ; + eDays.setBit(i); } + if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) { if ( event->isBirthday()) { pDays.setBit(i); @@ -378,4 +380,6 @@ void KODayMatrix::computeEvent(Event *event, int i ) mHolidays[i] =holiStr ; } + } + if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) eDays.setBit(i); } @@ -389,4 +393,5 @@ void KODayMatrix::updateViewTimed() #if 1 + int i; int timeSpan = NUMDAYS-1; @@ -470,8 +475,8 @@ void KODayMatrix::updateViewTimed() } } - -#if 0 + if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { + bDays.fill( false); // insert due todos - QPtrList<Todo> todos = calendar()->todos( ); + QPtrList<Todo> todos = mCalendar->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { @@ -480,10 +485,40 @@ void KODayMatrix::updateViewTimed() int day = mStartDate.daysTo( todo->dtDue().date() ); if ( day >= 0 && day < timeSpan + 1) { - (*cells)[day]->insertTodo( todo ); + int i = day; + QString holiStr = mHolidays[i]; + pDays.setBit(i); + if ( !holiStr.isEmpty() ) + holiStr += "\n"; + holiStr += i18n("Todo") + ": "+todo->summary(); + if ( !todo->location().isEmpty() ) + holiStr += " (" + todo->location() + ")"; + bDays.setBit(i); + mHolidays[i] =holiStr ; + eDays.setBit(i); } } } -#endif + } + if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { + bDays.fill( false); + // insert due todos + QPtrList<Journal> todos = mCalendar->journals( ); + Journal *todo; + for(todo = todos.first(); todo; todo = todos.next()) { + int day = mStartDate.daysTo( todo->dtStart().date() ); + if ( day >= 0 && day < timeSpan + 1) { + int i = day; + QString holiStr = mHolidays[i]; + pDays.setBit(i); + if ( !holiStr.isEmpty() ) + holiStr += "\n"; + holiStr += i18n("Journal"); + bDays.setBit(i); + mHolidays[i] =holiStr ; + eDays.setBit(i); + } + } + } #else //qDebug("KODayMatrix::updateViewTimed "); @@ -537,5 +572,7 @@ void KODayMatrix::updateViewTimed() void KODayMatrix::updateView(QDate actdate) { - + if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView ) + mRedrawNeeded = true; + mLastView = KOPrefs::instance()->mCurrentDisplayedView; if ( ! actdate.isValid() ) { //qDebug("date not valid "); @@ -1053,7 +1090,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) if ( bDays.testBit(i) ) { if ( hDays.testBit(i) ) - p.setPen(QColor(Qt::green)); + p.setPen(QColor(0,200,0)); else - p.setPen(QColor(Qt::green).dark()); + p.setPen(QColor(Qt::blue)); } else { if (actcol == mDefaultTextColor ) { |