author | zautrix <zautrix> | 2004-10-10 21:45:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-10 21:45:08 (UTC) |
commit | 80ecf83fe91a61792576b5538891953cd19c4fec (patch) (unidiff) | |
tree | 4cf30a58546834f7ed5889b37f352703ad603826 | |
parent | ad409bf71ce6c3733f9e5ae4e4aa38765329d7d8 (diff) | |
download | kdepimpi-80ecf83fe91a61792576b5538891953cd19c4fec.zip kdepimpi-80ecf83fe91a61792576b5538891953cd19c4fec.tar.gz kdepimpi-80ecf83fe91a61792576b5538891953cd19c4fec.tar.bz2 |
added timer in WN view
-rw-r--r-- | korganizer/koviewmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 29 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.h | 9 |
3 files changed, 34 insertions, 6 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index ba77b45..8e6cc53 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -242,3 +242,3 @@ void KOViewManager::showWhatsNextView() | |||
242 | showView(mWhatsNextView, true ); | 242 | showView(mWhatsNextView, true ); |
243 | mWhatsNextView->updateView(); | 243 | //mWhatsNextView->updateView(); |
244 | 244 | ||
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 2a8a7c1..9b53110 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -76,2 +76,7 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | |||
76 | topLayout->addWidget(mView); | 76 | topLayout->addWidget(mView); |
77 | mTimer = new QTimer( this ); | ||
78 | connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); | ||
79 | |||
80 | connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); | ||
81 | connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); | ||
77 | } | 82 | } |
@@ -113,5 +118,25 @@ void KOWhatsNextView::updateConfig() | |||
113 | } | 118 | } |
119 | void KOWhatsNextView::showEvent ( QShowEvent * e ) | ||
120 | { | ||
121 | //qDebug("KOWhatsNextView::showEvent "); | ||
122 | restartTimer(); | ||
123 | QWidget::showEvent ( e ); | ||
124 | } | ||
125 | void KOWhatsNextView::hideEvent ( QHideEvent * e) | ||
126 | { | ||
127 | //qDebug(" KOWhatsNextView::hideEvent"); | ||
128 | mTimer->stop(); | ||
129 | QWidget::hideEvent ( e ); | ||
130 | } | ||
131 | void KOWhatsNextView::restartTimer() | ||
132 | { | ||
133 | //qDebug("KOWhatsNextView::restartTimer() "); | ||
134 | mTimer->start( 180000 ); | ||
135 | //mTimer->start( 5000 ); | ||
136 | } | ||
114 | void KOWhatsNextView::updateView() | 137 | void KOWhatsNextView::updateView() |
115 | { | 138 | { |
116 | 139 | if ( mTimer->isActive() ) | |
140 | restartTimer(); | ||
141 | //qDebug("KOWhatsNextView::updateView() "); | ||
117 | // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); | 142 | // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); |
@@ -620,4 +645,2 @@ void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) | |||
620 | { | 645 | { |
621 | if ( mEventViewer ) | ||
622 | delete mEventViewer; | ||
623 | mEventViewer = v; | 646 | mEventViewer = v; |
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index fff769a..1118bdd 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h | |||
@@ -22,2 +22,3 @@ | |||
22 | #include <qtextbrowser.h> | 22 | #include <qtextbrowser.h> |
23 | #include <qtimer.h> | ||
23 | 24 | ||
@@ -74,3 +75,5 @@ class KOWhatsNextView : public KOrg::BaseView | |||
74 | void appendDay( int i, QDate date ); | 75 | void appendDay( int i, QDate date ); |
75 | QDate mEventDate; | 76 | QDate mEventDate; |
77 | virtual void showEvent ( QShowEvent * ); | ||
78 | virtual void hideEvent ( QHideEvent * ); | ||
76 | 79 | ||
@@ -78,2 +81,4 @@ class KOWhatsNextView : public KOrg::BaseView | |||
78 | void showIncidence(const QString &); | 81 | void showIncidence(const QString &); |
82 | void restartTimer(); | ||
83 | |||
79 | 84 | ||
@@ -81,3 +86,3 @@ class KOWhatsNextView : public KOrg::BaseView | |||
81 | //void createEventViewer(); | 86 | //void createEventViewer(); |
82 | 87 | QTimer* mTimer; | |
83 | QTextBrowser *mView; | 88 | QTextBrowser *mView; |