summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp3
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/koprefsdialog.cpp38
-rw-r--r--korganizer/kowhatsnextview.cpp79
4 files changed, 68 insertions, 53 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 8dca3ae..1cdb2fb 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -231,3 +231,4 @@ KOPrefs::KOPrefs() :
addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
- addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);
+ addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
+ addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 0656644..f2fe77a 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -234,2 +234,3 @@ class KOPrefs : public KPimPrefs
bool mWNViewShowsParents;
+ bool mWNViewShowsPast;
bool mWNViewShowLocation;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 393e6e6..578c0e9 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -786,3 +786,3 @@ void KOPrefsDialog::setupViewsTab()
- holidayColor =
+ holidayColor =
addWidColor(i18n("Color for Sundays + category \"Holiday\""),
@@ -799,21 +799,29 @@ void KOPrefsDialog::setupViewsTab()
ii = 0;
- KPrefsDialogWidBool *passwdk =
- addWidBool(i18n("Show parent To-Do's in What's Next view"),
- &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
+ KPrefsDialogWidBool *passwdk =
+
+ addWidBool(i18n("Show events, that are done in \nWhat's Next view"),
+ &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
+ passwdk =
+ addWidBool(i18n("Show parent To-Do's in What's Next view"),
+ &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
passwdk =
- addWidBool(i18n("Show location in What's Next view"),
- &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
+ addWidBool(i18n("Show location in What's Next view"),
+ &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
passwdk =
- addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
- &(KOPrefs::instance()->mShowSyncEvents),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
- passwdk =
- addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
- &(KOPrefs::instance()->mShortDateInViewer),topFrame);
- topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1);
+ addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
+ &(KOPrefs::instance()->mShowSyncEvents),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
+ passwdk =
+ addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
+ &(KOPrefs::instance()->mShortDateInViewer),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
+
+
+
// *********************** Todo View
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 0f0bf11..aa33588 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -359,3 +359,3 @@ void KOWhatsNextView::updateView()
// mView->setBackgroundPixmap ( bPix );
- qDebug("%s ",mText.latin1());
+ // qDebug("%s ",mText.latin1());
}
@@ -438,2 +438,3 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
QDateTime noc;
+ QString tempText;
bool ok = true;
@@ -444,3 +445,3 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
}
- mText += "<tr><td><b>";
+ tempText += "<tr><td><b>";
if (ev->type()=="Event") {
@@ -448,5 +449,5 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if (!ev->doesFloat())
- mText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
+ tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
else
- mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
+ tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
@@ -483,10 +484,13 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if ( notRed )
- mText += dateText;
+ tempText += dateText;
else {
- if ( end < cdt )
- mText += "<font color=\"#F00000\">" + dateText + "</font>";
+ if ( end < cdt ) {
+ if ( !KOPrefs::instance()->mWNViewShowsPast )
+ return;
+ tempText += "<font color=\"#F00000\">" + dateText + "</font>";
+ }
else if ( st < cdt )
- mText += "<font color=\"#008000\">" + dateText + "</font>";
+ tempText += "<font color=\"#008000\">" + dateText + "</font>";
else
- mText += dateText;
+ tempText += dateText;
@@ -495,3 +499,3 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
} else {
- mText += i18n("Allday:");
+ tempText += i18n("Allday:");
@@ -501,7 +505,7 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
mTodos.append( ev );
- mText += i18n("ToDo:");
+ tempText += i18n("ToDo:");
if (reply) {
- mText += " ";
+ tempText += " ";
if ( noc != cdt ) {
- mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
+ tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
}
@@ -509,6 +513,6 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
- // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
+ // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
QString dfs = KGlobal::locale()->dateFormatShort();
KGlobal::locale()->setDateFormatShort("%d.%b");
- mText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
+ tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
KGlobal::locale()->setDateFormatShort(dfs);
@@ -517,3 +521,3 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if( ( (Todo*)ev)->dtDue() < cdt ) {
- mText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
+ tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
@@ -521,3 +525,3 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
} else
- mText +=((Todo*)ev)->dtDueTimeStr();
+ tempText +=((Todo*)ev)->dtDueTimeStr();
mTodos.append( ev );
@@ -526,6 +530,6 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
}
- mText += "</b></td><td>";
+ tempText += "</b></td><td>";
bool needClose = false;
if ( ev->cancelled() ) {
- mText += "<font color=\"#F00000\">[c";
+ tempText += "<font color=\"#F00000\">[c";
needClose =true;
@@ -535,4 +539,4 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if ( !needClose)
- mText +="[";
- mText += "a";
+ tempText +="[";
+ tempText += "a";
needClose =true;
@@ -542,4 +546,4 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if ( !needClose)
- mText +="[";
- mText += "i";
+ tempText +="[";
+ tempText += "i";
needClose =true;
@@ -548,4 +552,4 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if ( !needClose)
- mText +="[";
- mText += "r";
+ tempText +="[";
+ tempText += "r";
needClose =true;
@@ -553,21 +557,22 @@ void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
if ( needClose ) {
- mText += "] ";
+ tempText += "] ";
}
if ( ev->cancelled() )
- mText += "</font>";
- mText += "<a ";
- if (ev->type()=="Event") mText += "href=\"event:";
- if (ev->type()=="Todo") mText += "href=\"todo:";
- mText += ev->uid() + "\">";
+ tempText += "</font>";
+ tempText += "<a ";
+ if (ev->type()=="Event") tempText += "href=\"event:";
+ if (ev->type()=="Todo") tempText += "href=\"todo:";
+ tempText += ev->uid() + "\">";
if ( ev->summary().length() > 0 )
- mText += ev->summary();
+ tempText += ev->summary();
else
- mText += i18n("-no summary-");
- mText += "</a>";
+ tempText += i18n("-no summary-");
+ tempText += "</a>";
if ( KOPrefs::instance()->mWNViewShowLocation )
if ( !ev->location().isEmpty() )
- mText += " ("+ev->location() +")";
+ tempText += " ("+ev->location() +")";
if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents)
- mText += " ["+ev->relatedTo()->summary() +"]";
- mText += "</td></tr>\n";
+ tempText += " ["+ev->relatedTo()->summary() +"]";
+ tempText += "</td></tr>\n";
+ mText += tempText;
}