summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-30 01:41:12 (UTC)
committer zautrix <zautrix>2005-01-30 01:41:12 (UTC)
commit949c6e28c83668176fd9c29e12668322c6ae627f (patch) (side-by-side diff)
treef5b21c9fe6d9f1906a7bca6899b44bcf359f2cc6
parenta8fae20ad7bcb59df9a603c88accf3a10401c2f9 (diff)
downloadkdepimpi-949c6e28c83668176fd9c29e12668322c6ae627f.zip
kdepimpi-949c6e28c83668176fd9c29e12668322c6ae627f.tar.gz
kdepimpi-949c6e28c83668176fd9c29e12668322c6ae627f.tar.bz2
bugs
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/koagendaview.cpp16
-rw-r--r--korganizer/koeventviewer.cpp5
-rw-r--r--korganizer/koeventviewerdialog.cpp1
-rw-r--r--libkcal/kincidenceformatter.cpp16
-rw-r--r--libkcal/todo.cpp7
6 files changed, 37 insertions, 10 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 0538511..eec0b38 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1200,13 +1200,13 @@
{ "Next two weeks","Nächste zwei Wochen" },
{ "Next month","Nächster Monat" },
{ "Journal view","Journal" },
{ "Display all opened","Zeige alle geöffnet" },
{ "Display all closed","Zeige alle geschlossen" },
{ "Display all flat","Zeige alle flach" },
-{ "","" },
+{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index e0a1a21..1864e22 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1146,28 +1146,34 @@ void KOAgendaView::fillAgenda()
}
// ---------- [display Todos --------------
unsigned int numTodo;
for (numTodo = 0; numTodo < todos.count(); ++numTodo) {
Todo *todo = todos.at(numTodo);
- if ( ! todo->hasDueDate() ) continue; // todo shall not be displayed if it has no date
+ if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
// Already completed items can be displayed on their original due date
//if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda
bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda;
- if ( ((todo->dtDue().date() == currentDate) && !overdue) ||
+ if ( ((todo->dtDue().date() == currentDate) && !overdue) || ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
((currentDate == today) && overdue) ) {
- if ( todo->doesFloat() || overdue ) { // Todo has no due-time set or is already overdue
+ if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue
if ( KOPrefs::instance()->mShowTodoInAgenda )
mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol);
}
else {
-
- int endY = mAgenda->timeToY(todo->dtDue().time()) - 1;
+ QDateTime dt;
+ if ( todo->hasCompletedDate() )
+ dt = todo->completed();
+ else
+ dt = todo->dtDue();;
+
+
+ int endY = mAgenda->timeToY(dt.time()) - 1;
int hi = (18/KOPrefs::instance()->mHourSize);
//qDebug("hei %d ",KOPrefs::instance()->mHourSize);
int startY = endY -hi;
mAgenda->insertItem(todo,currentDate,curCol,startY,endY);
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 2f0fa9e..36a2947 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -376,14 +376,19 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
formatCategories(event);
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
+ if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
+ mText.append(i18n("<p><i>Completed on %1</i></p>")
+ .arg( event->completedStr() ));
+ } else {
mText.append(i18n("<p><i>%1 % completed</i></p>")
.arg(event->percentComplete()));
+ }
formatReadOnly(event);
formatAttendees(event);
if ( event->relatedTo() ) {
addTag("b",i18n("Parent todo: "));
mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 3979ed2..f6f7258 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -218,12 +218,13 @@ void KOEventViewerDialog::showIncidence()
globalFlagBlockAgenda = 2;
emit showAgendaView( false );
return;
}
*/
((Todo*)mIncidence)->setCompleted( true );
+ ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() );
hide();
emit todoCompleted(((Todo*)mIncidence));
return;
} else
date = mIncidence->dtStart().date();
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 2c45f21..c52f2b3 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -180,15 +180,21 @@ void KIncidenceFormatter::setTodo(Todo *event )
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
}
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
-
+
+ if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
+ mText.append(i18n("<p><i>Completed on %1</i></p>")
+ .arg( event->completedStr() ));
+ } else {
mText.append(i18n("<p><i>%1 % completed</i></p>")
.arg(event->percentComplete()));
+ }
+
addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
formatCategories(event);
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
addTag("p",event->description());
}
@@ -243,12 +249,13 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text)
void KIncidenceFormatter::formatAttendees(Incidence *event)
{
QPtrList<Attendee> attendees = event->attendees();
if (attendees.count()) {
QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
+ QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
addTag("h3",i18n("Organizer"));
mText.append("<ul><li>");
#if 0
//ndef KORG_NOKABC
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
@@ -303,14 +310,17 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
else mText += a->email();
mText += "</a>\n";
#endif
if (!a->email().isEmpty()) {
if (iconPath) {
- mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">";
- mText += "<IMG src=\"" + iconPath + "\">";
+ mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">";
+ if ( a->RSVP() )
+ mText += "<IMG src=\"" + iconPath + "\">";
+ else
+ mText += "<IMG src=\"" + NOiconPath + "\">";
mText += "</a>\n";
}
}
if (a->status() != Attendee::NeedsAction )
mText +="[" + a->statusStr() + "] ";
if (a->role() == Attendee::Chair )
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 3d2de61..7362bdf 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -285,13 +285,16 @@ bool Todo::isCompleted() const
else return false;
}
void Todo::setCompleted(bool completed)
{
if (completed) mPercentComplete = 100;
- else mPercentComplete = 0;
+ else {
+ mPercentComplete = 0;
+ mHasCompletedDate = false;
+ }
updated();
}
QDateTime Todo::completed() const
{
return mCompleted;
@@ -320,12 +323,14 @@ int Todo::percentComplete() const
return mPercentComplete;
}
void Todo::setPercentComplete(int v)
{
mPercentComplete = v;
+ if ( v != 100 )
+ mHasCompletedDate = false;
updated();
}
QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
{
if ( isCompleted() || ! hasDueDate() || cancelled() ) {
*ok = false;