summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-07-05 08:37:52 (UTC)
committer zautrix <zautrix>2005-07-05 08:37:52 (UTC)
commit7e49703511de87f624cc8813b18ebbfcc01752cd (patch) (side-by-side diff)
tree896918396dbf518f6358a066f93a04bd4185f535 /korganizer/koagendaview.cpp
parent28ca4c37fb0e131b2978584992840b3fdca21d3e (diff)
downloadkdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.zip
kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.tar.gz
kdepimpi-7e49703511de87f624cc8813b18ebbfcc01752cd.tar.bz2
fixxx
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 488d9d4..1b21a71 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -76,7 +76,7 @@ extern int globalFlagBlockAgendaItemUpdate;
extern int globalFlagBlockLabel;
using namespace KOrg;
-#define IDLETIMEOUT 3
+#define IDLETIMEOUT 15
TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) :
QScrollView(parent,name,f)
@@ -575,21 +575,30 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) );
connect( mAllDayAgenda, SIGNAL( updateViewSignal() ),this, SLOT( fillAgenda()) );
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()
{
qDebug("SECS TO %d ",mIdleStart.secsTo( QDateTime::currentDateTime() ) );
int secsfromstart = mIdleStart.secsTo( QDateTime::currentDateTime() );
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;
}
qDebug("KO: Downsizing Pixmaps ");
@@ -1321,8 +1330,7 @@ void KOAgendaView::fillAgenda()
mAllDayAgenda->drawContentsToPainter();
mAgenda->drawContentsToPainter();
repaintAgenda();
- mIdleTimer->start ( IDLETIMEOUT *1000 );
- mIdleStart = QDateTime::currentDateTime();
+ startIdleTimeout();
onlyOne = false;
}
void KOAgendaView::repaintAgenda()