summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
authorzautrix <zautrix>2005-04-19 19:32:54 (UTC)
committer zautrix <zautrix>2005-04-19 19:32:54 (UTC)
commitcdcb0e0d0163695c56cf7cf9bd3f046ac63173ee (patch) (side-by-side diff)
tree70cb7e2db9d7075a7c7e7c38adbad0c50e5d8dc4 /korganizer/kodaymatrix.cpp
parentb36bdf88fbf3cc78e4bf072b5eb3ec16bd8ec235 (diff)
downloadkdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.zip
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.gz
kdepimpi-cdcb0e0d0163695c56cf7cf9bd3f046ac63173ee.tar.bz2
fixes
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
@@ -368,3 +368,5 @@ void KODayMatrix::computeEvent(Event *event, int i )
mHolidays[i] =holiStr ;
+ eDays.setBit(i);
}
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) {
if ( event->isBirthday()) {
@@ -379,2 +381,4 @@ void KODayMatrix::computeEvent(Event *event, int i )
}
+ }
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW )
eDays.setBit(i);
@@ -390,2 +394,3 @@ void KODayMatrix::updateViewTimed()
+
int i;
@@ -471,6 +476,6 @@ 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;
@@ -481,3 +486,13 @@ void KODayMatrix::updateViewTimed()
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);
}
@@ -485,4 +500,24 @@ void KODayMatrix::updateViewTimed()
}
-#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
@@ -538,3 +573,5 @@ void KODayMatrix::updateView(QDate actdate)
{
-
+ if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView )
+ mRedrawNeeded = true;
+ mLastView = KOPrefs::instance()->mCurrentDisplayedView;
if ( ! actdate.isValid() ) {
@@ -1054,5 +1091,5 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
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 {