summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
Unidiff
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 2c45f21..c52f2b3 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -175,26 +175,32 @@ void KIncidenceFormatter::setTodo(Todo *event )
175 } 175 }
176 176
177 if (!event->location().isEmpty()) { 177 if (!event->location().isEmpty()) {
178 addTag("b",i18n("Location: ")); 178 addTag("b",i18n("Location: "));
179 mText.append(event->location()+"<br>"); 179 mText.append(event->location()+"<br>");
180 } 180 }
181 if (event->hasDueDate()) { 181 if (event->hasDueDate()) {
182 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); 182 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
183 } 183 }
184 mText.append(i18n("<p><b>Priority:</b> %2</p>") 184 mText.append(i18n("<p><b>Priority:</b> %2</p>")
185 .arg(QString::number(event->priority()))); 185 .arg(QString::number(event->priority())));
186 186
187 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
188 mText.append(i18n("<p><i>Completed on %1</i></p>")
189 .arg( event->completedStr() ));
190 } else {
187 mText.append(i18n("<p><i>%1 % completed</i></p>") 191 mText.append(i18n("<p><i>%1 % completed</i></p>")
188 .arg(event->percentComplete())); 192 .arg(event->percentComplete()));
193 }
194
189 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 195 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
190 formatCategories(event); 196 formatCategories(event);
191 if (!event->description().isEmpty()) { 197 if (!event->description().isEmpty()) {
192 addTag("p",i18n("<b>Details: </b>")); 198 addTag("p",i18n("<b>Details: </b>"));
193 addTag("p",event->description()); 199 addTag("p",event->description());
194 } 200 }
195 201
196 202
197 203
198 formatReadOnly(event); 204 formatReadOnly(event);
199 formatAttendees(event); 205 formatAttendees(event);
200 206
@@ -237,24 +243,25 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text)
237 else 243 else
238 { 244 {
239 str += text + "</" + tag + ">"; 245 str += text + "</" + tag + ">";
240 mText.append(str); 246 mText.append(str);
241 } 247 }
242} 248}
243 249
244void KIncidenceFormatter::formatAttendees(Incidence *event) 250void KIncidenceFormatter::formatAttendees(Incidence *event)
245{ 251{
246 QPtrList<Attendee> attendees = event->attendees(); 252 QPtrList<Attendee> attendees = event->attendees();
247 if (attendees.count()) { 253 if (attendees.count()) {
248 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 254 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
255 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
249 addTag("h3",i18n("Organizer")); 256 addTag("h3",i18n("Organizer"));
250 mText.append("<ul><li>"); 257 mText.append("<ul><li>");
251#if 0 258#if 0
252 //ndef KORG_NOKABC 259 //ndef KORG_NOKABC
253 260
254 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 261 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
255 KABC::Addressee::List addressList; 262 KABC::Addressee::List addressList;
256 addressList = add_book->findByEmail(event->organizer()); 263 addressList = add_book->findByEmail(event->organizer());
257 KABC::Addressee o = addressList.first(); 264 KABC::Addressee o = addressList.first();
258 if (!o.isEmpty() && addressList.size()<2) { 265 if (!o.isEmpty() && addressList.size()<2) {
259 mText += "<a href=\"uid:" + o.uid() + "\">"; 266 mText += "<a href=\"uid:" + o.uid() + "\">";
260 mText += o.formattedName(); 267 mText += o.formattedName();
@@ -298,25 +305,28 @@ void KIncidenceFormatter::formatAttendees(Incidence *event)
298 } 305 }
299#else 306#else
300 //qDebug("nokabc "); 307 //qDebug("nokabc ");
301 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 308 mText += "<li><a href=\"uid:" + a->uid() + "\">";
302 if (!a->name().isEmpty()) mText += a->name(); 309 if (!a->name().isEmpty()) mText += a->name();
303 else mText += a->email(); 310 else mText += a->email();
304 mText += "</a>\n"; 311 mText += "</a>\n";
305#endif 312#endif
306 313
307 if (!a->email().isEmpty()) { 314 if (!a->email().isEmpty()) {
308 if (iconPath) { 315 if (iconPath) {
309 mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; 316 mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">";
317 if ( a->RSVP() )
310 mText += "<IMG src=\"" + iconPath + "\">"; 318 mText += "<IMG src=\"" + iconPath + "\">";
319 else
320 mText += "<IMG src=\"" + NOiconPath + "\">";
311 mText += "</a>\n"; 321 mText += "</a>\n";
312 } 322 }
313 } 323 }
314 if (a->status() != Attendee::NeedsAction ) 324 if (a->status() != Attendee::NeedsAction )
315 mText +="[" + a->statusStr() + "] "; 325 mText +="[" + a->statusStr() + "] ";
316 if (a->role() == Attendee::Chair ) 326 if (a->role() == Attendee::Chair )
317 mText +="(" + a->roleStr().left(1) + ".)"; 327 mText +="(" + a->roleStr().left(1) + ".)";
318 } 328 }
319 mText.append("</li></ul>"); 329 mText.append("</li></ul>");
320 } 330 }
321} 331}
322 332