author | zautrix <zautrix> | 2005-07-05 08:37:52 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 08:37:52 (UTC) |
commit | 7e49703511de87f624cc8813b18ebbfcc01752cd (patch) (side-by-side diff) | |
tree | 896918396dbf518f6358a066f93a04bd4185f535 | |
parent | 28ca4c37fb0e131b2978584992840b3fdca21d3e (diff) | |
download | kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.zip kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.tar.gz kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/koagenda.cpp | 35 | ||||
-rw-r--r-- | korganizer/koagenda.h | 3 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 20 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 |
4 files changed, 43 insertions, 16 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index c339b57..662576f 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -61,5 +61,5 @@ extern int globalFlagBlockAgendaItemUpdate; extern int globalFlagBlockStartup; -bool KOAgenda::mInvalidPixmap = false; + //////////////////////////////////////////////////////////////////////////// MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) @@ -331,4 +331,5 @@ void KOAgenda::shrinkPixmap() void KOAgenda::slotContentMove(int,int) { + emit sendPing(); if ( mActionType == NOP ) slotClearSelection(); @@ -439,4 +440,13 @@ void KOAgenda::categoryChanged(Incidence * inc) bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) { + + if ( mInvalidPixmap ) { + mInvalidPixmap = false; + qDebug("InvalidPixmap "); + computeSizes(); + emit updateViewSignal(); + return true; + } + emit sendPing(); static int startX = 0; static int startY = 0; @@ -1268,5 +1278,6 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) mInvalidPixmap = false; qDebug("InvalidPixmap "); - QTimer::singleShot( 0, this, SIGNAL( updateViewSignal() )); + computeSizes(); + emit updateViewSignal(); return; } @@ -1275,7 +1286,10 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) //qDebug("KOAgenda::drawContents "); - if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) - ;//drawContentsToPainter(); - +#if 0 + if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) { + qDebug("WAU "); + drawContentsToPainter(); + } +#endif QPaintDevice* pd = p->device(); p->end(); @@ -1321,8 +1335,11 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) p->begin( pd ); } else { - - if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) - ;//drawContentsToPainter(); - +#if 0 + qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() ); + if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) { + qDebug("WAUWAU "); + drawContentsToPainter(); + } +#endif QPaintDevice* pd = p->device(); p->end(); diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 5d813b2..0e3aed8 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h @@ -76,5 +76,5 @@ class KOAgenda : public QScrollView const char * name=0, WFlags f=0 ); virtual ~KOAgenda(); - static bool mInvalidPixmap; + bool mInvalidPixmap; Incidence *selectedIncidence() const; @@ -175,4 +175,5 @@ class KOAgenda : public QScrollView void resizedSignal(); void updateViewSignal(); + void sendPing(); protected: diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 488d9d4..1b21a71 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -77,5 +77,5 @@ extern int globalFlagBlockLabel; using namespace KOrg; -#define IDLETIMEOUT 3 +#define IDLETIMEOUT 15 TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : @@ -577,7 +577,16 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : connect( mAgenda, SIGNAL( updateViewSignal() ), this, SLOT( fillAgenda()) ); + connect( mAllDayAgenda, SIGNAL( sendPing() ),this, SLOT( startIdleTimeout()) ); + connect( mAgenda, SIGNAL( sendPing() ), this, SLOT( startIdleTimeout()) ); + + mIdleTimer = new QTimer ( this );; connect(mIdleTimer,SIGNAL(timeout()),SLOT(slotIdleTimeout())); } +void KOAgendaView::startIdleTimeout() +{ + mIdleStart = QDateTime::currentDateTime(); + mIdleTimer->start( IDLETIMEOUT * 1000 ); +} void KOAgendaView::slotIdleTimeout() { @@ -586,9 +595,9 @@ void KOAgendaView::slotIdleTimeout() mIdleTimer->stop(); bool isActice = topLevelWidget()->isActiveWindow(); - qDebug("KO: Active Window %d ", isActice); + qDebug("KO: Active Window %d %d", isActice, isVisible()); // we do nothing if we wake up from a suspend - if ( secsfromstart > IDLETIMEOUT + 50 && isActice ) { + if ( secsfromstart > IDLETIMEOUT + 30 && isActice ) { qDebug("KO: Wakeup from suspend "); - mIdleTimer->start( IDLETIMEOUT * 1000 ); + startIdleTimeout(); return; } @@ -1322,6 +1331,5 @@ void KOAgendaView::fillAgenda() mAgenda->drawContentsToPainter(); repaintAgenda(); - mIdleTimer->start ( IDLETIMEOUT *1000 ); - mIdleStart = QDateTime::currentDateTime(); + startIdleTimeout(); onlyOne = false; } diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index effd7a3..4b7ef5b 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -212,4 +212,5 @@ class KOAgendaView : public KOEventView { void slotShowDateView( int, int ); void fillAgenda(); + void startIdleTimeout(); signals: |