author | zautrix <zautrix> | 2005-01-31 23:43:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-31 23:43:35 (UTC) |
commit | fce3fd8accec495a2deda6fe3cd55375fac46432 (patch) (side-by-side diff) | |
tree | 24231254fa729b1b546f0475759fcba24455e1f5 /korganizer | |
parent | 336678d691a8c3346c92a4e561ac7938ed532003 (diff) | |
download | kdepimpi-fce3fd8accec495a2deda6fe3cd55375fac46432.zip kdepimpi-fce3fd8accec495a2deda6fe3cd55375fac46432.tar.gz kdepimpi-fce3fd8accec495a2deda6fe3cd55375fac46432.tar.bz2 |
mf
-rw-r--r-- | korganizer/kodaymatrix.cpp | 30 | ||||
-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 |
6 files changed, 39 insertions, 21 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index ca896b5..549ef2a 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -212,7 +212,6 @@ void KODayMatrix::updateView() } void KODayMatrix::repaintViewTimed() { - qDebug("KODayMatrix::repaintViewTimed "); mRepaintTimer->stop(); repaint(false); } @@ -220,35 +219,29 @@ void KODayMatrix::updateViewTimed() { mUpdateTimer->stop(); - qDebug("KODayMatrix::updateView(QDate actdate)"); for(int i = 0; i < NUMDAYS; i++) { - // if events are set for the day then remember to draw it bold QPtrList<Event> eventlist = mCalendar->events(days[i]); Event *event; int numEvents = eventlist.count(); - + QString holiStr = ""; for(event=eventlist.first();event != 0;event=eventlist.next()) { ushort recurType = event->recurrence()->doesRecur(); - if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { numEvents--; } + if ( event->categories().contains( i18n("Holiday") ) || event->categories().contains( "Holiday" )) { + if ( !holiStr.isEmpty() ) + holiStr += "\n"; + holiStr += event->summary(); + } } events[i] = numEvents; - //if it is a holy day then draw it red. Sundays are consider holidays, too -#ifndef KORG_NOPLUGINS - QString holiStr = KOCore::self()->holiday(days[i]); -#else - QString holiStr = QString::null; -#endif if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || !holiStr.isEmpty()) { - if (holiStr.isNull()) holiStr = ""; mHolidays[i] = holiStr; - } else { mHolidays[i] = QString::null; } @@ -288,7 +281,7 @@ void KODayMatrix::updateView(QDate actdate) mDayChanged = true; recalculateToday(); } - qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); + //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); if ( !isVisible() ) { mPendingUpdateBeforeRepaint = true; } else { @@ -487,12 +480,16 @@ void KODayMatrix::dropEvent(QDropEvent *e) void KODayMatrix::paintEvent(QPaintEvent * pevent) { -//kdDebug() << "KODayMatrix::paintEvent() BEGIN" << endl; + if ( width() <= 0 || height() <= 0 ) + return; if ( mPendingUpdateBeforeRepaint ) { updateViewTimed(); mPendingUpdateBeforeRepaint = false; } - QPainter p(this); + if ( myPix.width() != width() || myPix.height()!=height() ) { + myPix.resize(size() ); + } + QPainter p(&myPix); QRect sz = frameRect(); int dheight = daysize.height(); @@ -616,6 +613,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) p.setFont(myFont); } } + bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP); } // ---------------------------------------------------------------------------- diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index ac2f59c..2dd112a 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -31,6 +31,7 @@ #include <qpen.h> #include <qdatetime.h> #include <qtooltip.h> +#include <qpixmap.h> #include <qmap.h> @@ -221,6 +222,7 @@ protected: void resizeEvent(QResizeEvent *); private: + QPixmap myPix; QTimer* mUpdateTimer; QTimer* mRepaintTimer; bool mDayChanged; diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4cff23a..6411156 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -976,8 +976,8 @@ void KOMonthView::updateView() if ( !updatePossible ) return; - QTime ti; - ti.start(); + //QTime ti; + //ti.start(); #if 1 int i; for( i = 0; i < mCells.count(); ++i ) { @@ -1080,7 +1080,7 @@ void KOMonthView::updateView() mCells[0]->setFocus(); #endif - qDebug("update time %d ", ti.elapsed()); + //qDebug("update time %d ", ti.elapsed()); } void KOMonthView::resizeEvent(QResizeEvent * e) diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 82437d8..99402c4 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -209,7 +209,11 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) #endif QListView::contentsMousePressEvent(e); } - +void KOTodoListView::paintEvent(QPaintEvent* e) +{ + emit paintNeeded(); + QListView::paintEvent( e); +} void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) { @@ -501,6 +505,8 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : SLOT( itemStateChanged( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), SLOT( itemStateChanged( QListViewItem * ) ) ); + connect( mTodoListView, SIGNAL( paintNeeded() ), + SLOT( paintNeeded()) ); #if 0 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), @@ -534,6 +540,13 @@ void KOTodoView::jumpToDate () // if ( mActiveItem->todo()->hasDueDate() ) // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); } +void KOTodoView::paintNeeded() +{ + if ( mPendingUpdateBeforeRepaint ) { + updateView(); + mPendingUpdateBeforeRepaint = false; + } +} void KOTodoView::paintEvent(QPaintEvent * pevent) { if ( mPendingUpdateBeforeRepaint ) { @@ -542,7 +555,7 @@ void KOTodoView::paintEvent(QPaintEvent * pevent) } KOrg::BaseView::paintEvent( pevent); } - bool mPendingUpdateBeforeRepaint; + void KOTodoView::updateView() { pendingSubtodo = 0; diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 16bc133..2a9e737 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -60,6 +60,7 @@ class KOTodoListView : public KListView virtual ~KOTodoListView() {} signals: + void paintNeeded(); void todoDropped(Todo *, int); void double_Clicked(QListViewItem *item); void reparentTodoSignal( Todo *,Todo * ); @@ -77,6 +78,7 @@ class KOTodoListView : public KListView void contentsMouseDoubleClickEvent(QMouseEvent *); private: + void paintEvent(QPaintEvent * pevent); bool internalDrop; QString mName; Calendar *mCalendar; @@ -198,6 +200,7 @@ class KOTodoView : public KOrg::BaseView void purgeCompletedSignal(); protected slots: + void paintNeeded(); void processSelectionChange(); void addQuickTodo(); void setTodoModified( Todo* ); @@ -213,6 +216,7 @@ class KOTodoView : public KOrg::BaseView * 3. add a private method for setting a todo modified + friend here? * -- zecke 2002-07-08 */ + friend class KOTodoListView; void paintEvent(QPaintEvent * pevent); bool mPendingUpdateBeforeRepaint; friend class KOTodoViewItem; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 30f5fb1..188ad23 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -604,6 +604,7 @@ void KOViewManager::showJournalView() } showView(mJournalView); + mMainView->dateNavigator()->selectDates( 1 ); } void KOViewManager::showTimeSpanView() |