author | zautrix <zautrix> | 2005-07-05 05:29:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 05:29:02 (UTC) |
commit | 5992ea9025ebddde8be72322c90aac8edeaf4d1c (patch) (unidiff) | |
tree | f0d9385d80fe74af453aa23fd69715d66aeaee12 | |
parent | 671d832454c8b68e0bb44e439f28fb1c768e033d (diff) | |
download | kdepimpi-5992ea9025ebddde8be72322c90aac8edeaf4d1c.zip kdepimpi-5992ea9025ebddde8be72322c90aac8edeaf4d1c.tar.gz kdepimpi-5992ea9025ebddde8be72322c90aac8edeaf4d1c.tar.bz2 |
rf
-rw-r--r-- | korganizer/koagenda.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 11 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 01cef35..0280c74 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1653,34 +1653,36 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1653 | mItems.remove( item ); | 1653 | mItems.remove( item ); |
1654 | QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); | 1654 | QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); |
1655 | KOAgendaItem *itemit; | 1655 | KOAgendaItem *itemit; |
1656 | //globalFlagBlockAgendaItemPaint = 1; | 1656 | //globalFlagBlockAgendaItemPaint = 1; |
1657 | for ( itemit=oldconflictItems.first(); itemit != 0; | 1657 | for ( itemit=oldconflictItems.first(); itemit != 0; |
1658 | itemit=oldconflictItems.next() ) { | 1658 | itemit=oldconflictItems.next() ) { |
1659 | if ( itemit != item ) | 1659 | if ( itemit != item ) |
1660 | placeSubCells(itemit); | 1660 | placeSubCells(itemit); |
1661 | } | 1661 | } |
1662 | qApp->processEvents(); | 1662 | qApp->processEvents(); |
1663 | //globalFlagBlockAgendaItemPaint = 0; | 1663 | //globalFlagBlockAgendaItemPaint = 0; |
1664 | for ( itemit=oldconflictItems.first(); itemit != 0; | 1664 | for ( itemit=oldconflictItems.first(); itemit != 0; |
1665 | itemit=oldconflictItems.next() ) { | 1665 | itemit=oldconflictItems.next() ) { |
1666 | globalFlagBlockAgendaItemUpdate = 0; | 1666 | globalFlagBlockAgendaItemUpdate = 0; |
1667 | if ( itemit != item ) | 1667 | if ( itemit != item ) |
1668 | itemit->repaintMe(); | 1668 | itemit->repaintMe(); |
1669 | globalFlagBlockAgendaItemUpdate = 1; | 1669 | globalFlagBlockAgendaItemUpdate = 1; |
1670 | itemit->repaint(); | 1670 | //qDebug("sigleshot "); |
1671 | QTimer::singleShot( 0, itemit, SLOT ( repaintItem() )); | ||
1672 | //itemit->repaint( false ); repaintItem() | ||
1671 | } | 1673 | } |
1672 | blockSignals( false ); | 1674 | blockSignals( false ); |
1673 | } | 1675 | } |
1674 | if ( remove ) { | 1676 | if ( remove ) { |
1675 | //qDebug("remove****************************************** "); | 1677 | //qDebug("remove****************************************** "); |
1676 | return; | 1678 | return; |
1677 | } | 1679 | } |
1678 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) | 1680 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) |
1679 | return; | 1681 | return; |
1680 | //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); | 1682 | //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); |
1681 | QDate currentDate = QDate::currentDate(); | 1683 | QDate currentDate = QDate::currentDate(); |
1682 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); | 1684 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); |
1683 | QDateTime dt; | 1685 | QDateTime dt; |
1684 | if ( todo->hasCompletedDate() ) | 1686 | if ( todo->hasCompletedDate() ) |
1685 | dt = todo->completed(); | 1687 | dt = todo->completed(); |
1686 | else | 1688 | else |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index f855b03..8675ff6 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -479,39 +479,48 @@ QPixmap * KOAgendaItem::paintPix() | |||
479 | int h = QApplication::desktop()->height(); | 479 | int h = QApplication::desktop()->height(); |
480 | mPaintPix = new QPixmap(w,h); | 480 | mPaintPix = new QPixmap(w,h); |
481 | } | 481 | } |
482 | return mPaintPix ; | 482 | return mPaintPix ; |
483 | } | 483 | } |
484 | QPixmap * KOAgendaItem::paintPixAllday() | 484 | QPixmap * KOAgendaItem::paintPixAllday() |
485 | { | 485 | { |
486 | static QPixmap* mPaintPixA = 0; | 486 | static QPixmap* mPaintPixA = 0; |
487 | if ( ! mPaintPixA ) { | 487 | if ( ! mPaintPixA ) { |
488 | int w = QApplication::desktop()->width(); | 488 | int w = QApplication::desktop()->width(); |
489 | int h = QApplication::desktop()->height()/5; | 489 | int h = QApplication::desktop()->height()/5; |
490 | mPaintPixA = new QPixmap(w,h); | 490 | mPaintPixA = new QPixmap(w,h); |
491 | } | 491 | } |
492 | return mPaintPixA ; | 492 | return mPaintPixA ; |
493 | } | 493 | } |
494 | 494 | ||
495 | void KOAgendaItem::repaintItem() | ||
496 | { | ||
497 | globalFlagBlockAgendaItemPaint = 0; | ||
498 | globalFlagBlockAgenda = 0; | ||
499 | //qDebug("AAA "); | ||
500 | repaint( false ); | ||
501 | //qDebug("BBB "); | ||
502 | } | ||
495 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) | 503 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) |
496 | { | 504 | { |
497 | 505 | qDebug("CCC "); | |
498 | if ( globalFlagBlockAgendaItemPaint ) | 506 | if ( globalFlagBlockAgendaItemPaint ) |
499 | return; | 507 | return; |
500 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) | 508 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) |
501 | return; | 509 | return; |
510 | qDebug("DDD "); | ||
502 | int yy; | 511 | int yy; |
503 | if ( mAllDay ) | 512 | if ( mAllDay ) |
504 | yy = y(); | 513 | yy = y(); |
505 | else | 514 | else |
506 | yy = mCellYTop * ( height() / cellHeight() ); | 515 | yy = mCellYTop * ( height() / cellHeight() ); |
507 | int xx = x(); | 516 | int xx = x(); |
508 | 517 | ||
509 | if ( xPaintCoord != xx || yPaintCoord != yy || | 518 | if ( xPaintCoord != xx || yPaintCoord != yy || |
510 | wPaintCoord != width() || hPaintCoord != height()) { | 519 | wPaintCoord != width() || hPaintCoord != height()) { |
511 | xPaintCoord= xx; | 520 | xPaintCoord= xx; |
512 | yPaintCoord = yy; | 521 | yPaintCoord = yy; |
513 | wPaintCoord = width(); | 522 | wPaintCoord = width(); |
514 | hPaintCoord = height(); | 523 | hPaintCoord = height(); |
515 | globalFlagBlockAgendaItemUpdate = 0; | 524 | globalFlagBlockAgendaItemUpdate = 0; |
516 | paintMe( mSelected ); | 525 | paintMe( mSelected ); |
517 | //qDebug("calling paintMe "); | 526 | //qDebug("calling paintMe "); |
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 3ed68b0..99c564a 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h | |||
@@ -98,32 +98,33 @@ class KOAgendaItem : public QWidget | |||
98 | 98 | ||
99 | QPtrList<KOAgendaItem> conflictItems(); | 99 | QPtrList<KOAgendaItem> conflictItems(); |
100 | void setConflictItems(QPtrList<KOAgendaItem>); | 100 | void setConflictItems(QPtrList<KOAgendaItem>); |
101 | void addConflictItem(KOAgendaItem *ci); | 101 | void addConflictItem(KOAgendaItem *ci); |
102 | void paintMe( bool, QPainter* painter = 0 ); | 102 | void paintMe( bool, QPainter* painter = 0 ); |
103 | void repaintMe(); | 103 | void repaintMe(); |
104 | static QPixmap * paintPix(); | 104 | static QPixmap * paintPix(); |
105 | static QPixmap * paintPixAllday(); | 105 | static QPixmap * paintPixAllday(); |
106 | void updateItem(); | 106 | void updateItem(); |
107 | void computeText(); | 107 | void computeText(); |
108 | void recreateIncidence(); | 108 | void recreateIncidence(); |
109 | bool checkLayout(); | 109 | bool checkLayout(); |
110 | void initColor (); | 110 | void initColor (); |
111 | public slots: | 111 | public slots: |
112 | bool updateIcons( QPainter *, bool ); | 112 | bool updateIcons( QPainter *, bool ); |
113 | void select(bool=true); | 113 | void select(bool=true); |
114 | void repaintItem(); | ||
114 | 115 | ||
115 | protected: | 116 | protected: |
116 | void dragEnterEvent(QDragEnterEvent *e); | 117 | void dragEnterEvent(QDragEnterEvent *e); |
117 | void dropEvent(QDropEvent *e); | 118 | void dropEvent(QDropEvent *e); |
118 | void paintEvent ( QPaintEvent * ); | 119 | void paintEvent ( QPaintEvent * ); |
119 | void resizeEvent ( QResizeEvent *ev ); | 120 | void resizeEvent ( QResizeEvent *ev ); |
120 | 121 | ||
121 | private: | 122 | private: |
122 | KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; | 123 | KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis; |
123 | bool mAllDay; | 124 | bool mAllDay; |
124 | bool mWhiteText; | 125 | bool mWhiteText; |
125 | int mCellX; | 126 | int mCellX; |
126 | int mCellXWidth; | 127 | int mCellXWidth; |
127 | int mCellYTop,mCellYBottom; | 128 | int mCellYTop,mCellYBottom; |
128 | int mSubCell; // subcell number of this item | 129 | int mSubCell; // subcell number of this item |
129 | int mSubCells; // Total number of subcells in cell of this item | 130 | int mSubCells; // Total number of subcells in cell of this item |