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) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp87
1 files changed, 62 insertions, 25 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 17a1d13..df606d0 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -366,18 +366,22 @@ void KODayMatrix::computeEvent(Event *event, int i )
if ( !event->location().isEmpty() )
holiStr += " (" + event->location() + ")";
mHolidays[i] =holiStr ;
+ eDays.setBit(i);
}
- if ( event->isBirthday()) {
- pDays.setBit(i);
- if ( !holiStr.isEmpty() )
- holiStr += "\n";
- holiStr += i18n("Birthday") + ": "+event->summary();
- if ( !event->location().isEmpty() )
- holiStr += " (" + event->location() + ")";
- bDays.setBit(i);
- mHolidays[i] =holiStr ;
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_T_VIEW && KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW ) {
+ if ( event->isBirthday()) {
+ pDays.setBit(i);
+ if ( !holiStr.isEmpty() )
+ holiStr += "\n";
+ holiStr += i18n("Birthday") + ": "+event->summary();
+ if ( !event->location().isEmpty() )
+ holiStr += " (" + event->location() + ")";
+ bDays.setBit(i);
+ mHolidays[i] =holiStr ;
+ }
}
- eDays.setBit(i);
+ if ( KOPrefs::instance()->mCurrentDisplayedView != VIEW_J_VIEW )
+ eDays.setBit(i);
}
void KODayMatrix::updateViewTimed()
{
@@ -388,6 +392,7 @@ void KODayMatrix::updateViewTimed()
}
#if 1
+
int i;
int timeSpan = NUMDAYS-1;
QPtrList<Event> events = mCalendar->events();
@@ -469,22 +474,52 @@ void KODayMatrix::updateViewTimed()
pDays.setBit(i);
}
}
-
-#if 0
- // insert due todos
- QPtrList<Todo> todos = calendar()->todos( );
- Todo *todo;
- for(todo = todos.first(); todo; todo = todos.next()) {
- //insertTodo( todo );
- if ( todo->hasDueDate() ) {
- int day = mStartDate.daysTo( todo->dtDue().date() );
+ if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
+ bDays.fill( false);
+ // insert due todos
+ QPtrList<Todo> todos = mCalendar->todos( );
+ Todo *todo;
+ for(todo = todos.first(); todo; todo = todos.next()) {
+ //insertTodo( todo );
+ if ( todo->hasDueDate() ) {
+ int day = mStartDate.daysTo( todo->dtDue().date() );
+ if ( day >= 0 && day < timeSpan + 1) {
+ 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);
+ }
+ }
+ }
+ }
+ 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) {
- (*cells)[day]->insertTodo( todo );
+ 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);
+
}
}
}
-#endif
-
#else
//qDebug("KODayMatrix::updateViewTimed ");
for(int i = 0; i < NUMDAYS; i++) {
@@ -536,7 +571,9 @@ 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 ");
return;
@@ -1052,9 +1089,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if ( pDays.testBit(i)) {
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 ) {
p.setPen(KOPrefs::instance()->mHolidayColor);