summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp124
-rw-r--r--korganizer/koagendaitem.cpp11
-rw-r--r--korganizer/koagendaview.cpp30
3 files changed, 93 insertions, 72 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 148d914..18c506e 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1363,83 +1363,73 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
{
if ( globalFlagBlockAgenda )
return;
- //qDebug("KOAgenda::drawContents ");
- if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
- ;//drawContentsToPainter();
+ if ( ! mAllDayMode ) {
+ // currently not working for
- QPaintDevice* pd = p->device();
- p->end();
- int vx, vy;
- int selectionX = KOGlobals::self()->reverseLayout() ?
+ //qDebug("KOAgenda::drawContents ");
+ if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
+ ;//drawContentsToPainter();
+
+ QPaintDevice* pd = p->device();
+ p->end();
+ int vx, vy;
+ int selectionX = KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
- contentsToViewport ( cx, cy, vx,vy);
- //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ;
+ contentsToViewport ( cx, cy, vx,vy);
+ //qDebug(" %d %d %d %d %d", cx, cy, cw,ch,mGridSpacingX-1) ;
- if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) {
- if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
- ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) {
+ if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) {
+ if ( mGridSpacingX == cw && mSelectionHeight > 0 && ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
+ ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) ) {
- int vxSel, vySel;
- contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel);
- int off = mSelectionHeight;
- if ( vySel < 0 )
- off += vySel;
- //qDebug("OFF %d %d %d", off,vySel, vy );
- bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP);
- } else {
- bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ int vxSel, vySel;
+ contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel);
+ int off = mSelectionHeight;
+ if ( vySel < 0 )
+ off += vySel;
+ //qDebug("OFF %d %d %d", off,vySel, vy );
+ bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP);
+ } else {
+ bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ }
}
- }
- if ( mSelectionHeight > 0 ) {
- //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
- if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
- ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
- contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
- bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
- }
- }
- //qDebug("btbl ");
- p->begin( pd );
- //qDebug("end ");
-#if 0
-
- if ( globalFlagBlockAgenda )
- return;
- //qDebug("KOAgenda::drawContents ");
- if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
- ;//drawContentsToPainter();
+ if ( mSelectionHeight > 0 ) {
+ //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
+ if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
+ ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
+ contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
+ bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
+ }
+ }
+ p->begin( pd );
+ } else {
+
+ if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
+ ;//drawContentsToPainter();
- QPaintDevice* pd = p->device();
- p->end();
- int vx, vy;
- int selectionX = KOGlobals::self()->reverseLayout() ?
+ QPaintDevice* pd = p->device();
+ p->end();
+ int vx, vy;
+ int selectionX = KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
- contentsToViewport ( cx, cy, vx,vy);
- // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
- if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
- bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ contentsToViewport ( cx, cy, vx,vy);
+ // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
+ if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
+ bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
- if ( mSelectionHeight > 0 ) {
- //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
- if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
- ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
- contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
- bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
- }
- }
- //qDebug("btbl ");
- p->begin( pd );
- //qDebug("end ");
-
-
-
-
-
-
+ if ( mSelectionHeight > 0 ) {
+ //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
+ if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
+ ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
+ contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
+ bitBlt ( pd, vx+1, vy, &mHighlightPixmap, 0, mSelectionYTop, mGridSpacingX-1, mSelectionHeight ,CopyROP);
+ }
+ }
+ p->begin( pd );
+ }
-#endif
}
void KOAgenda::finishUpdate()
@@ -1967,7 +1957,7 @@ void KOAgenda::finishResize ( )
*/
void KOAgenda::resizeEvent ( QResizeEvent *ev )
{
-
+ mSelectionHeight = 0;
mResizeTimer.start( 150 , true );
computeSizes();
return;
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index c9e307f..1801d7e 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -548,11 +548,14 @@ void KOAgendaItem::computeText()
mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
if ( mAllDay ) {
- if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
- mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
- }
+ if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
+ if ( mIncidence->doesRecur() ) {
+ mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")";
+ } else {
+ mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
+ }
+ }
}
-
}
if ( !mIncidence->location().isEmpty() ) {
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 76d5c4b..f53e5d5 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1160,7 +1160,35 @@ void KOAgendaView::fillAgenda()
if (event->doesFloat()) {
if (event->recurrence()->doesRecur()) {
- mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol);
+ if (event->isMultiDay() ) {
+ endX = endX - beginX;// endX is now number of days
+ if ( event->recursOn( currentDate ) ) {
+ endX += curCol;
+ beginX = curCol;
+ mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX);
+ } else {
+ //qDebug("days %d %s",endX , currentDate.toString().latin1());
+ QDate dateit = currentDate.addDays( -endX );
+ if ( event->recursOn( dateit ) ) {
+ //qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() );
+ if ( curCol-endX < 0 ) {
+ mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol);
+ }
+ }
+ }
+ } else {
+ mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol);
+ }
+#if 0
+ if (beginX <= 0 && curCol == 0) {
+ mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX);
+ } else if (beginX == curCol) {
+ mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX);
+ } else {
+ qDebug("skipped %d %d %d ",beginX , endX, curCol);
+ }
+#endif
+ //mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol);
} else {
if (beginX <= 0 && curCol == 0) {
mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX);