summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-09 16:49:42 (UTC)
committer zautrix <zautrix>2005-04-09 16:49:42 (UTC)
commitd1982b1423417eb59c275bb09d4e3012a67ca086 (patch) (side-by-side diff)
treef170a17f3d04e9d11d450233ea2d55f5803760fb
parent329ecb2c6b4153c51415513a28f2dc0576f4ddca (diff)
downloadkdepimpi-d1982b1423417eb59c275bb09d4e3012a67ca086.zip
kdepimpi-d1982b1423417eb59c275bb09d4e3012a67ca086.tar.gz
kdepimpi-d1982b1423417eb59c275bb09d4e3012a67ca086.tar.bz2
nf
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp22
-rw-r--r--korganizer/koagendaitem.cpp5
-rw-r--r--korganizer/koagendaview.cpp28
3 files changed, 38 insertions, 17 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 148d914..18c506e 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1354,24 +1354,27 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
// for ( item=conflictItems.first(); item != 0;
// item=conflictItems.next() ) {
// //item->updateItem();
// //qDebug("xxx item->updateItem() %s %d %d", item->incidence()->summary().latin1(),item->x(), item->y() );
// }
// placeItem->updateItem();
}
void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
{
if ( globalFlagBlockAgenda )
return;
+ if ( ! mAllDayMode ) {
+ // currently not working for
+
//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) ;
@@ -1390,65 +1393,52 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
} 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
+ } else {
- if ( globalFlagBlockAgenda )
- return;
- //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 ", 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 ");
-
-
-
-
-
-
+ }
-#endif
}
void KOAgenda::finishUpdate()
{
KOAgendaItem *item;
globalFlagBlockAgendaItemPaint = 1;
// Adjust sub cell geometry of all conflict items of all conflict items of all conflict items ... of the conflict item with the max number of conflictitems
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( !item->checkLayout() ) {
//qDebug(" conflictitem found ");
int newSubCellWidth;
@@ -1958,25 +1948,25 @@ void KOAgenda::finishResize ( )
{
//qDebug("finishResize+++++++++++++++++++++++++++++++ ( ) ");
if ( globalFlagBlockAgenda == 0 ) {
finishUpdate();
//qDebug("finishUpdate() called ");
}
}
/*
Overridden from QScrollView to provide proper resizing of KOAgendaItems.
*/
void KOAgenda::resizeEvent ( QResizeEvent *ev )
{
-
+ mSelectionHeight = 0;
mResizeTimer.start( 150 , true );
computeSizes();
return;
}
void KOAgenda::computeSizes()
{
if ( globalFlagBlockStartup )
return;
int frameOffset = frameWidth() * 2 +1;
if (mAllDayMode) {
mGridSpacingX = (width()-frameOffset) / mColumns;
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index c9e307f..1801d7e 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -540,28 +540,31 @@ void KOAgendaItem::computeText()
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
else if ( !(mIncidence->doesFloat()))
mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
}
} else {
if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
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() ) {
+ 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() ) {
if ( mAllDay )
mDisplayedText += " (";
else
mDisplayedText += "\n(";
mDisplayedText += mIncidence->location() +")";
}
#ifdef DESKTOP_VERSION
QString tipText = mIncidence->summary();
if ( !mIncidence->doesFloat() ) {
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 76d5c4b..f53e5d5 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1151,25 +1151,53 @@ void KOAgendaView::fillAgenda()
if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") )
if ( event->uid().left(15) == QString("last-syncEvent-") )
continue;
// kdDebug() << " Event: " << event->summary() << endl;
int beginX = currentDate.daysTo(event->dtStart().date()) + curCol;
int endX = currentDate.daysTo(event->dtEnd().date()) + curCol;
// kdDebug() << " beginX: " << beginX << " endX: " << endX << endl;
if (event->doesFloat()) {
if (event->recurrence()->doesRecur()) {
+ 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);
} else if (beginX == curCol) {
mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX);
}
}
} else if (event->isMultiDay()) {
if ( event->doesRecur () ) {
QDate dateit = currentDate;
int count = 0;
int max = event->dtStart().daysTo( event->dtEnd() ) +2;