summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kowhatsnextview.cpp4
-rw-r--r--korganizer/kowhatsnextview.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 53fe7d0..8473db9 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -181,24 +181,25 @@ void KOWhatsNextView::hideEvent ( QHideEvent * e)
}
void KOWhatsNextView::restartTimer()
{
//qDebug("KOWhatsNextView::restartTimer() ");
mTimer->start( 300000 );
//mTimer->start( 5000 );
}
void KOWhatsNextView::updateView()
{
//qDebug("KOWhatsNextView::updateView() ");
if ( mTimer->isActive() )
restartTimer();
+ mCurrentMaxPrio = 5;
//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);
//<big><big><strong>" + date + "</strong></big></big>\n";
mText = "<table width=\"100%\">\n";
//mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
#ifdef DESKTOP_VERSION
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
#else
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
@@ -309,24 +310,25 @@ void KOWhatsNextView::updateView()
int priority = 1;
int priosFound = 0;
#ifdef DESKTOP_VERSION
mText +="<p></p>";
#endif
mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n";
mText += "<ul>\n";
while (!gotone && priority<6) {
todo = todos.first();
while(todo) {
if (!todo->isCompleted() && (todo->priority() == priority) ) {
+ mCurrentMaxPrio = priority - priosFound + topmostPrios -1;
if ( appendTodo(todo) )
gotone = true;
}
todo = todos.next();
}
if ( gotone ) {
gotone = false;
++priosFound;
if ( priosFound == topmostPrios )
break;
}
priority++;
@@ -716,25 +718,25 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
if ( !isSub ) {
if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
mText += " ["+ev->relatedTo()->summary() +"]";
mText += "</p>\n";
}
else {
ind += "-";
mText += "</li>\n";
}
QPtrList<Incidence> Relations = ev->relations();
Incidence *to;
for (to=Relations.first();to;to=Relations.next()) {
- if (!((Todo*)to)->isCompleted())
+ if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio )
appendTodo( to, ind , true );
}
return true;
}
/*
void KOWhatsNextView::createEventViewer()
{
if (!mEventViewer) {
mEventViewer = new KOEventViewerDialog(this);
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h
index 715037f..d6727ac 100644
--- a/korganizer/kowhatsnextview.h
+++ b/korganizer/kowhatsnextview.h
@@ -78,23 +78,24 @@ class KOWhatsNextView : public KOrg::BaseView
bool appendTodo(Incidence *, QString ind = "", bool isSub = false );
void appendDay( int i, QDate date );
QDate mEventDate;
virtual void showEvent ( QShowEvent * );
virtual void hideEvent ( QHideEvent * );
private slots:
void showIncidence(const QString &);
void restartTimer();
private:
+ int mCurrentMaxPrio;
//void createEventViewer();
QTimer* mTimer;
WhatsNextTextBrowser *mView;
QString mText;
// QLabel *mDateLabel;
KOEventViewerDialog *mEventViewer;
QValueList<Incidence *> mTodos;
};
#endif