author | zautrix <zautrix> | 2005-01-31 23:43:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-31 23:43:35 (UTC) |
commit | fce3fd8accec495a2deda6fe3cd55375fac46432 (patch) (unidiff) | |
tree | 24231254fa729b1b546f0475759fcba24455e1f5 | |
parent | 336678d691a8c3346c92a4e561ac7938ed532003 (diff) | |
download | kdepimpi-fce3fd8accec495a2deda6fe3cd55375fac46432.zip kdepimpi-fce3fd8accec495a2deda6fe3cd55375fac46432.tar.gz kdepimpi-fce3fd8accec495a2deda6fe3cd55375fac46432.tar.bz2 |
mf
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 7 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 170 | ||||
-rw-r--r-- | korganizer/kodaymatrix.h | 2 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 17 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 4 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 1 |
7 files changed, 116 insertions, 91 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 178f92d..2858d9c 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -10,4 +10,5 @@ introduced in the latest versions, where the text was not fitting on the | |||
10 | 240x320 display of the Zaurus 5500. | 10 | 240x320 display of the Zaurus 5500. |
11 | 11 | ||
12 | KO/Pi: | ||
12 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 13 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
13 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 14 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
@@ -29,4 +30,10 @@ Setting a child to uncomplete sets all parent to uncomplete. | |||
29 | Setting a child to complete does not change the parents. | 30 | Setting a child to complete does not change the parents. |
30 | 31 | ||
32 | Smart updating and double buffering of the daymatrix. | ||
33 | Showing holidays in the day matrix. | ||
34 | Many other small performance updates. | ||
35 | |||
36 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | ||
37 | |||
31 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 38 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
32 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. | 39 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index ca896b5..549ef2a 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -213,5 +213,4 @@ void KODayMatrix::updateView() | |||
213 | void KODayMatrix::repaintViewTimed() | 213 | void KODayMatrix::repaintViewTimed() |
214 | { | 214 | { |
215 | qDebug("KODayMatrix::repaintViewTimed "); | ||
216 | mRepaintTimer->stop(); | 215 | mRepaintTimer->stop(); |
217 | repaint(false); | 216 | repaint(false); |
@@ -221,33 +220,27 @@ void KODayMatrix::updateViewTimed() | |||
221 | 220 | ||
222 | mUpdateTimer->stop(); | 221 | mUpdateTimer->stop(); |
223 | qDebug("KODayMatrix::updateView(QDate actdate)"); | ||
224 | for(int i = 0; i < NUMDAYS; i++) { | 222 | for(int i = 0; i < NUMDAYS; i++) { |
225 | |||
226 | // if events are set for the day then remember to draw it bold | 223 | // if events are set for the day then remember to draw it bold |
227 | QPtrList<Event> eventlist = mCalendar->events(days[i]); | 224 | QPtrList<Event> eventlist = mCalendar->events(days[i]); |
228 | Event *event; | 225 | Event *event; |
229 | int numEvents = eventlist.count(); | 226 | int numEvents = eventlist.count(); |
230 | 227 | QString holiStr = ""; | |
231 | for(event=eventlist.first();event != 0;event=eventlist.next()) { | 228 | for(event=eventlist.first();event != 0;event=eventlist.next()) { |
232 | ushort recurType = event->recurrence()->doesRecur(); | 229 | ushort recurType = event->recurrence()->doesRecur(); |
233 | |||
234 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || | 230 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || |
235 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { | 231 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { |
236 | numEvents--; | 232 | numEvents--; |
237 | } | 233 | } |
234 | if ( event->categories().contains( i18n("Holiday") ) || event->categories().contains( "Holiday" )) { | ||
235 | if ( !holiStr.isEmpty() ) | ||
236 | holiStr += "\n"; | ||
237 | holiStr += event->summary(); | ||
238 | } | ||
238 | } | 239 | } |
239 | events[i] = numEvents; | 240 | events[i] = numEvents; |
240 | |||
241 | //if it is a holy day then draw it red. Sundays are consider holidays, too | 241 | //if it is a holy day then draw it red. Sundays are consider holidays, too |
242 | #ifndef KORG_NOPLUGINS | ||
243 | QString holiStr = KOCore::self()->holiday(days[i]); | ||
244 | #else | ||
245 | QString holiStr = QString::null; | ||
246 | #endif | ||
247 | if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || | 242 | if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || |
248 | !holiStr.isEmpty()) { | 243 | !holiStr.isEmpty()) { |
249 | if (holiStr.isNull()) holiStr = ""; | ||
250 | mHolidays[i] = holiStr; | 244 | mHolidays[i] = holiStr; |
251 | |||
252 | } else { | 245 | } else { |
253 | mHolidays[i] = QString::null; | 246 | mHolidays[i] = QString::null; |
@@ -256,5 +249,5 @@ void KODayMatrix::updateViewTimed() | |||
256 | if ( ! mPendingUpdateBeforeRepaint ) | 249 | if ( ! mPendingUpdateBeforeRepaint ) |
257 | repaint(false); | 250 | repaint(false); |
258 | } | 251 | } |
259 | void KODayMatrix::updateView(QDate actdate) | 252 | void KODayMatrix::updateView(QDate actdate) |
260 | { | 253 | { |
@@ -289,5 +282,5 @@ void KODayMatrix::updateView(QDate actdate) | |||
289 | recalculateToday(); | 282 | recalculateToday(); |
290 | } | 283 | } |
291 | qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); | 284 | //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); |
292 | if ( !isVisible() ) { | 285 | if ( !isVisible() ) { |
293 | mPendingUpdateBeforeRepaint = true; | 286 | mPendingUpdateBeforeRepaint = true; |
@@ -488,10 +481,14 @@ void KODayMatrix::dropEvent(QDropEvent *e) | |||
488 | void KODayMatrix::paintEvent(QPaintEvent * pevent) | 481 | void KODayMatrix::paintEvent(QPaintEvent * pevent) |
489 | { | 482 | { |
490 | //kdDebug() << "KODayMatrix::paintEvent() BEGIN" << endl; | 483 | if ( width() <= 0 || height() <= 0 ) |
491 | if ( mPendingUpdateBeforeRepaint ) { | 484 | return; |
492 | updateViewTimed(); | 485 | if ( mPendingUpdateBeforeRepaint ) { |
493 | mPendingUpdateBeforeRepaint = false; | 486 | updateViewTimed(); |
487 | mPendingUpdateBeforeRepaint = false; | ||
488 | } | ||
489 | if ( myPix.width() != width() || myPix.height()!=height() ) { | ||
490 | myPix.resize(size() ); | ||
494 | } | 491 | } |
495 | QPainter p(this); | 492 | QPainter p(&myPix); |
496 | 493 | ||
497 | QRect sz = frameRect(); | 494 | QRect sz = frameRect(); |
@@ -539,82 +536,83 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
539 | QPen tmppen; | 536 | QPen tmppen; |
540 | for(int i = 0; i < NUMDAYS; i++) { | 537 | for(int i = 0; i < NUMDAYS; i++) { |
541 | row = i/7; | 538 | row = i/7; |
542 | col = isRTL ? 6-(i-row*7) : i-row*7; | 539 | col = isRTL ? 6-(i-row*7) : i-row*7; |
543 | 540 | ||
544 | // if it is the first day of a month switch color from normal to shaded and vice versa | 541 | // if it is the first day of a month switch color from normal to shaded and vice versa |
545 | if ( KOGlobals::self()->calendarSystem()->day( days[i] ) == 1) { | 542 | if ( KOGlobals::self()->calendarSystem()->day( days[i] ) == 1) { |
546 | if (actcol == mDefaultTextColorShaded) { | 543 | if (actcol == mDefaultTextColorShaded) { |
547 | actcol = mDefaultTextColor; | 544 | actcol = mDefaultTextColor; |
548 | } else { | 545 | } else { |
549 | actcol = mDefaultTextColorShaded; | 546 | actcol = mDefaultTextColorShaded; |
547 | } | ||
548 | p.setPen(actcol); | ||
550 | } | 549 | } |
551 | p.setPen(actcol); | ||
552 | } | ||
553 | 550 | ||
554 | //Reset pen color after selected days block | 551 | //Reset pen color after selected days block |
555 | if (i == mSelEnd+1) { | 552 | if (i == mSelEnd+1) { |
556 | p.setPen(actcol); | 553 | p.setPen(actcol); |
557 | } | 554 | } |
555 | |||
556 | // if today then draw rectangle around day | ||
557 | if (today == i) { | ||
558 | tmppen = p.pen(); | ||
559 | QPen mTodayPen(p.pen()); | ||
560 | |||
561 | mTodayPen.setWidth(mTodayMarginWidth); | ||
562 | //draw red rectangle for holidays | ||
563 | if (!mHolidays[i].isNull()) { | ||
564 | if (actcol == mDefaultTextColor) { | ||
565 | mTodayPen.setColor(KOPrefs::instance()->mHolidayColor); | ||
566 | } else { | ||
567 | mTodayPen.setColor(mHolidayColorShaded); | ||
568 | } | ||
569 | } | ||
570 | //draw gray rectangle for today if in selection | ||
571 | if (i >= mSelStart && i <= mSelEnd) { | ||
572 | QColor grey("grey"); | ||
573 | mTodayPen.setColor(grey); | ||
574 | } | ||
575 | p.setPen(mTodayPen); | ||
576 | p.drawRect(col*dwidth, row*dheight, dwidth, dheight); | ||
577 | p.setPen(tmppen); | ||
578 | } | ||
558 | 579 | ||
559 | // if today then draw rectangle around day | 580 | // if any events are on that day then draw it using a bold font |
560 | if (today == i) { | 581 | if (events[i] > 0) { |
561 | tmppen = p.pen(); | 582 | QFont myFont = font(); |
562 | QPen mTodayPen(p.pen()); | 583 | myFont.setBold(true); |
584 | p.setFont(myFont); | ||
585 | } | ||
563 | 586 | ||
564 | mTodayPen.setWidth(mTodayMarginWidth); | 587 | // if it is a holiday then use the default holiday color |
565 | //draw red rectangle for holidays | ||
566 | if (!mHolidays[i].isNull()) { | 588 | if (!mHolidays[i].isNull()) { |
567 | if (actcol == mDefaultTextColor) { | 589 | if (actcol == mDefaultTextColor) { |
568 | mTodayPen.setColor(KOPrefs::instance()->mHolidayColor); | 590 | p.setPen(KOPrefs::instance()->mHolidayColor); |
569 | } else { | 591 | } else { |
570 | mTodayPen.setColor(mHolidayColorShaded); | 592 | p.setPen(mHolidayColorShaded); |
571 | } | 593 | } |
572 | } | 594 | } |
573 | //draw gray rectangle for today if in selection | 595 | |
596 | // draw selected days with special color | ||
597 | // DO NOT specially highlight holidays in selection ! | ||
574 | if (i >= mSelStart && i <= mSelEnd) { | 598 | if (i >= mSelStart && i <= mSelEnd) { |
575 | QColor grey("grey"); | 599 | p.setPen(mSelectedDaysColor); |
576 | mTodayPen.setColor(grey); | ||
577 | } | 600 | } |
578 | p.setPen(mTodayPen); | ||
579 | p.drawRect(col*dwidth, row*dheight, dwidth, dheight); | ||
580 | p.setPen(tmppen); | ||
581 | } | ||
582 | 601 | ||
583 | // if any events are on that day then draw it using a bold font | 602 | p.drawText(col*dwidth, row*dheight, dwidth, dheight, |
584 | if (events[i] > 0) { | 603 | Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); |
585 | QFont myFont = font(); | ||
586 | myFont.setBold(true); | ||
587 | p.setFont(myFont); | ||
588 | } | ||
589 | 604 | ||
590 | // if it is a holiday then use the default holiday color | 605 | // reset color to actual color |
591 | if (!mHolidays[i].isNull()) { | 606 | if (!mHolidays[i].isNull()) { |
592 | if (actcol == mDefaultTextColor) { | 607 | p.setPen(actcol); |
593 | p.setPen(KOPrefs::instance()->mHolidayColor); | 608 | } |
594 | } else { | 609 | // reset bold font to plain font |
595 | p.setPen(mHolidayColorShaded); | 610 | if (events[i] > 0) { |
611 | QFont myFont = font(); | ||
612 | myFont.setBold(false); | ||
613 | p.setFont(myFont); | ||
596 | } | 614 | } |
597 | } | ||
598 | |||
599 | // draw selected days with special color | ||
600 | // DO NOT specially highlight holidays in selection ! | ||
601 | if (i >= mSelStart && i <= mSelEnd) { | ||
602 | p.setPen(mSelectedDaysColor); | ||
603 | } | ||
604 | |||
605 | p.drawText(col*dwidth, row*dheight, dwidth, dheight, | ||
606 | Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]); | ||
607 | |||
608 | // reset color to actual color | ||
609 | if (!mHolidays[i].isNull()) { | ||
610 | p.setPen(actcol); | ||
611 | } | ||
612 | // reset bold font to plain font | ||
613 | if (events[i] > 0) { | ||
614 | QFont myFont = font(); | ||
615 | myFont.setBold(false); | ||
616 | p.setFont(myFont); | ||
617 | } | ||
618 | } | 615 | } |
616 | bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP); | ||
619 | } | 617 | } |
620 | 618 | ||
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index ac2f59c..2dd112a 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h | |||
@@ -32,4 +32,5 @@ | |||
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qtooltip.h> | 33 | #include <qtooltip.h> |
34 | #include <qpixmap.h> | ||
34 | 35 | ||
35 | #include <qmap.h> | 36 | #include <qmap.h> |
@@ -222,4 +223,5 @@ protected: | |||
222 | 223 | ||
223 | private: | 224 | private: |
225 | QPixmap myPix; | ||
224 | QTimer* mUpdateTimer; | 226 | QTimer* mUpdateTimer; |
225 | QTimer* mRepaintTimer; | 227 | QTimer* mRepaintTimer; |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4cff23a..6411156 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -977,6 +977,6 @@ void KOMonthView::updateView() | |||
977 | if ( !updatePossible ) | 977 | if ( !updatePossible ) |
978 | return; | 978 | return; |
979 | QTime ti; | 979 | //QTime ti; |
980 | ti.start(); | 980 | //ti.start(); |
981 | #if 1 | 981 | #if 1 |
982 | int i; | 982 | int i; |
@@ -1081,5 +1081,5 @@ void KOMonthView::updateView() | |||
1081 | #endif | 1081 | #endif |
1082 | 1082 | ||
1083 | qDebug("update time %d ", ti.elapsed()); | 1083 | //qDebug("update time %d ", ti.elapsed()); |
1084 | } | 1084 | } |
1085 | 1085 | ||
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 82437d8..99402c4 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -210,5 +210,9 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | |||
210 | QListView::contentsMousePressEvent(e); | 210 | QListView::contentsMousePressEvent(e); |
211 | } | 211 | } |
212 | 212 | void KOTodoListView::paintEvent(QPaintEvent* e) | |
213 | { | ||
214 | emit paintNeeded(); | ||
215 | QListView::paintEvent( e); | ||
216 | } | ||
213 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | 217 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) |
214 | { | 218 | { |
@@ -502,4 +506,6 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
502 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), | 506 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), |
503 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 507 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
508 | connect( mTodoListView, SIGNAL( paintNeeded() ), | ||
509 | SLOT( paintNeeded()) ); | ||
504 | 510 | ||
505 | #if 0 | 511 | #if 0 |
@@ -535,4 +541,11 @@ void KOTodoView::jumpToDate () | |||
535 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); | 541 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); |
536 | } | 542 | } |
543 | void KOTodoView::paintNeeded() | ||
544 | { | ||
545 | if ( mPendingUpdateBeforeRepaint ) { | ||
546 | updateView(); | ||
547 | mPendingUpdateBeforeRepaint = false; | ||
548 | } | ||
549 | } | ||
537 | void KOTodoView::paintEvent(QPaintEvent * pevent) | 550 | void KOTodoView::paintEvent(QPaintEvent * pevent) |
538 | { | 551 | { |
@@ -543,5 +556,5 @@ void KOTodoView::paintEvent(QPaintEvent * pevent) | |||
543 | KOrg::BaseView::paintEvent( pevent); | 556 | KOrg::BaseView::paintEvent( pevent); |
544 | } | 557 | } |
545 | bool mPendingUpdateBeforeRepaint; | 558 | |
546 | void KOTodoView::updateView() | 559 | void KOTodoView::updateView() |
547 | { | 560 | { |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 16bc133..2a9e737 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -61,4 +61,5 @@ class KOTodoListView : public KListView | |||
61 | 61 | ||
62 | signals: | 62 | signals: |
63 | void paintNeeded(); | ||
63 | void todoDropped(Todo *, int); | 64 | void todoDropped(Todo *, int); |
64 | void double_Clicked(QListViewItem *item); | 65 | void double_Clicked(QListViewItem *item); |
@@ -78,4 +79,5 @@ class KOTodoListView : public KListView | |||
78 | 79 | ||
79 | private: | 80 | private: |
81 | void paintEvent(QPaintEvent * pevent); | ||
80 | bool internalDrop; | 82 | bool internalDrop; |
81 | QString mName; | 83 | QString mName; |
@@ -199,4 +201,5 @@ class KOTodoView : public KOrg::BaseView | |||
199 | 201 | ||
200 | protected slots: | 202 | protected slots: |
203 | void paintNeeded(); | ||
201 | void processSelectionChange(); | 204 | void processSelectionChange(); |
202 | void addQuickTodo(); | 205 | void addQuickTodo(); |
@@ -214,4 +217,5 @@ class KOTodoView : public KOrg::BaseView | |||
214 | * -- zecke 2002-07-08 | 217 | * -- zecke 2002-07-08 |
215 | */ | 218 | */ |
219 | friend class KOTodoListView; | ||
216 | void paintEvent(QPaintEvent * pevent); | 220 | void paintEvent(QPaintEvent * pevent); |
217 | bool mPendingUpdateBeforeRepaint; | 221 | bool mPendingUpdateBeforeRepaint; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 30f5fb1..188ad23 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -605,4 +605,5 @@ void KOViewManager::showJournalView() | |||
605 | 605 | ||
606 | showView(mJournalView); | 606 | showView(mJournalView); |
607 | mMainView->dateNavigator()->selectDates( 1 ); | ||
607 | } | 608 | } |
608 | 609 | ||