summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 7e9fa71..7d9d674 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -88,48 +88,49 @@ MarcusBains::~MarcusBains()
//delete minutes;
}
void MarcusBains::hideMe()
{
hide(); mTimeBox->hide();
}
int MarcusBains::todayColumn()
{
QDate currentDate = QDate::currentDate();
DateList dateList = agenda->dateList();
DateList::ConstIterator it;
int col = 0;
for(it = dateList.begin(); it != dateList.end(); ++it) {
if((*it) == currentDate)
return KOGlobals::self()->reverseLayout() ?
agenda->columns() - 1 - col : col;
++col;
}
return -1;
}
void MarcusBains::updateLoc()
{
+ if ( !agenda->invalidPixmap() )
updateLocation();
}
void MarcusBains::updateLocation(bool recalculate)
{
QTime tim = QTime::currentTime();
//qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1());
if((tim.hour() == 0) && (oldTime.hour()==23))
recalculate = true;
int mins = tim.hour()*60 + tim.minute();
int minutesPerCell = 24 * 60 / agenda->rows();
int y = mins*agenda->gridSpacingY()/minutesPerCell;
int today = recalculate ? todayColumn() : oldToday;
int x = agenda->gridSpacingX()*today;
bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled);
oldTime = tim;
oldToday = today;
if(disabled || (today<0)) {
hide(); mTimeBox->hide();
return;
} else {
@@ -420,54 +421,58 @@ void KOAgenda::popupMenu()
} else if ( mPopupKind == 2 || mPopupKind == 4 ) {
if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action
endSelectAction( false ); // do not emit new event signal
mLeftMouseDown = false; // no more leftMouse computation
}
if ( KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 2 )
mNewItemPopup->installEventFilter( this );
mNewItemPopup->popup( mPopupPos);
}
mLeftMouseDown = false;
mPopupItem = 0;
mPopupKind = 0;
}
void KOAgenda::categoryChanged(Incidence * inc)
{
KOAgendaItem *item;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( item->incidence() == inc ) {
item->initColor ();
item->updateItem();
}
}
}
+bool KOAgenda::invalidPixmap()
+{
+ return mInvalidPixmap;
+}
bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
{
if ( mInvalidPixmap ) {
mInvalidPixmap = false;
- qDebug("KO: Upsizing Pixmaps ");
+ qDebug("KO: efm Upsizing Pixmaps %s", QDateTime::currentDateTime().toString().latin1());
computeSizes();
emit updateViewSignal();
return true;
}
emit sendPing();
static int startX = 0;
static int startY = 0;
int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 7 : 9 );
static bool blockMoving = true;
//qDebug("KOAgenda::eventFilter_mous ");
if ( object == mNewItemPopup ) {
//qDebug("mNewItemPopup ");
if ( me->type() == QEvent::MouseButtonRelease ) {
mNewItemPopup->removeEventFilter( this );
int dX = me->globalPos().x() - mPopupPos.x();;
if ( dX < 0 )
dX = -dX;
int dY = me->globalPos().y() - mPopupPos.y();
if ( dY < 0 )
dY = -dY;
if ( dX > blockmoveDist || dY > blockmoveDist ) {
mNewItemPopup->hide();
}
@@ -1260,53 +1265,54 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
placeItem->setSubCell(0);
placeItem->setSubCells(1);
if (mAllDayMode) placeItem->resize(placeItem->width(),mGridSpacingY);
else placeItem->resize(mGridSpacingX,placeItem->height());
int x,y;
gridToContents(placeItem->cellX(),placeItem->cellYTop(),x,y);
moveChild(placeItem,x,y);
}
placeItem->setConflictItems(conflictItems);
// 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 ( mInvalidPixmap ) {
mInvalidPixmap = false;
- qDebug("KO: Upsizing Pixmaps ");
+ qDebug("KO: dc Upsizing Pixmaps %s", QDateTime::currentDateTime().toString().latin1());
computeSizes();
emit updateViewSignal();
return;
}
+ //qDebug("KOAgenda::drawContents %s", QDateTime::currentDateTime().toString().latin1());
if ( ! mAllDayMode ) {
// currently not working for
//qDebug("KOAgenda::drawContents ");
#if 0
if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) {
qDebug("WAU ");
drawContentsToPainter();
}
#endif
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) ;
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;