summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp53
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 ) {