author | zautrix <zautrix> | 2004-10-10 21:45:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-10 21:45:08 (UTC) |
commit | 80ecf83fe91a61792576b5538891953cd19c4fec (patch) (side-by-side diff) | |
tree | 4cf30a58546834f7ed5889b37f352703ad603826 /korganizer/kowhatsnextview.cpp | |
parent | ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8 (diff) | |
download | kdepimpi-80ecf83fe91a61792576b5538891953cd19c4fec.zip kdepimpi-80ecf83fe91a61792576b5538891953cd19c4fec.tar.gz kdepimpi-80ecf83fe91a61792576b5538891953cd19c4fec.tar.bz2 |
added timer in WN view
Diffstat (limited to 'korganizer/kowhatsnextview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 2a8a7c1..9b53110 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -73,8 +73,13 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, QBoxLayout *topLayout = new QVBoxLayout(this); // topLayout->addWidget(mDateLabel); topLayout->addWidget(mView); + mTimer = new QTimer( this ); + connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); + + connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); + connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); } KOWhatsNextView::~KOWhatsNextView() { @@ -110,11 +115,31 @@ void KOWhatsNextView::updateConfig() setFont( KOPrefs::instance()->mWhatsNextFont ); updateView(); } +void KOWhatsNextView::showEvent ( QShowEvent * e ) +{ + //qDebug("KOWhatsNextView::showEvent "); + restartTimer(); + QWidget::showEvent ( e ); +} +void KOWhatsNextView::hideEvent ( QHideEvent * e) +{ + //qDebug(" KOWhatsNextView::hideEvent"); + mTimer->stop(); + QWidget::hideEvent ( e ); +} +void KOWhatsNextView::restartTimer() +{ + //qDebug("KOWhatsNextView::restartTimer() "); + mTimer->start( 180000 ); + //mTimer->start( 5000 ); +} void KOWhatsNextView::updateView() { - + if ( mTimer->isActive() ) + restartTimer(); + //qDebug("KOWhatsNextView::updateView() "); // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); KIconLoader kil("korganizer"); QString ipath;// = new QString(); // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); @@ -617,10 +642,8 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) } */ void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) { - if ( mEventViewer ) - delete mEventViewer; mEventViewer = v; } // TODO: Create this function in CalendarView and remove it from here |