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 | |||
@@ -71,12 +71,17 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | |||
71 | 71 | ||
72 | mEventViewer = 0; | 72 | mEventViewer = 0; |
73 | 73 | ||
74 | QBoxLayout *topLayout = new QVBoxLayout(this); | 74 | QBoxLayout *topLayout = new QVBoxLayout(this); |
75 | // topLayout->addWidget(mDateLabel); | 75 | // topLayout->addWidget(mDateLabel); |
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 | } |
78 | 83 | ||
79 | KOWhatsNextView::~KOWhatsNextView() | 84 | KOWhatsNextView::~KOWhatsNextView() |
80 | { | 85 | { |
81 | } | 86 | } |
82 | 87 | ||
@@ -108,15 +113,35 @@ void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, | |||
108 | void KOWhatsNextView::updateConfig() | 113 | void KOWhatsNextView::updateConfig() |
109 | { | 114 | { |
110 | setFont( KOPrefs::instance()->mWhatsNextFont ); | 115 | setFont( KOPrefs::instance()->mWhatsNextFont ); |
111 | updateView(); | 116 | updateView(); |
112 | 117 | ||
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())); |
118 | KIconLoader kil("korganizer"); | 143 | KIconLoader kil("korganizer"); |
119 | QString ipath;// = new QString(); | 144 | QString ipath;// = new QString(); |
120 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); | 145 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); |
121 | //<big><big><strong>" + date + "</strong></big></big>\n"; | 146 | //<big><big><strong>" + date + "</strong></big></big>\n"; |
122 | mText = "<table width=\"100%\">\n"; | 147 | mText = "<table width=\"100%\">\n"; |
@@ -615,14 +640,12 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | |||
615 | mEventViewer = new KOEventViewerDialog(this); | 640 | mEventViewer = new KOEventViewerDialog(this); |
616 | } | 641 | } |
617 | } | 642 | } |
618 | */ | 643 | */ |
619 | void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) | 644 | void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) |
620 | { | 645 | { |
621 | if ( mEventViewer ) | ||
622 | delete mEventViewer; | ||
623 | mEventViewer = v; | 646 | mEventViewer = v; |
624 | } | 647 | } |
625 | 648 | ||
626 | // TODO: Create this function in CalendarView and remove it from here | 649 | // TODO: Create this function in CalendarView and remove it from here |
627 | void KOWhatsNextView::showIncidence(const QString &uid) | 650 | void KOWhatsNextView::showIncidence(const QString &uid) |
628 | { | 651 | { |