summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
Unidiff
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp112
1 files changed, 62 insertions, 50 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f39b5e1..c8c2f28 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -257,48 +257,49 @@ void KOEventViewer::addTag(const QString & tag,const QString & text)
257 tmpText=tmpText.right(tmpText.length()-pos-1); 257 tmpText=tmpText.right(tmpText.length()-pos-1);
258 tmpStr+=tmp+"<br>"; 258 tmpStr+=tmp+"<br>";
259 } 259 }
260 } 260 }
261 else tmpStr += tmpText; 261 else tmpStr += tmpText;
262 tmpStr+="</" + tag + ">"; 262 tmpStr+="</" + tag + ">";
263 mText.append(tmpStr); 263 mText.append(tmpStr);
264 } 264 }
265 else 265 else
266 { 266 {
267 str += text + "</" + tag + ">"; 267 str += text + "</" + tag + ">";
268 mText.append(str); 268 mText.append(str);
269 } 269 }
270} 270}
271 271
272void KOEventViewer::setColorMode( int m ) 272void KOEventViewer::setColorMode( int m )
273{ 273{
274 mColorMode = m; 274 mColorMode = m;
275} 275}
276void KOEventViewer::appendEvent(Event *event, int mode ) 276void KOEventViewer::appendEvent(Event *event, int mode )
277{ 277{
278 mMailSubject = ""; 278 mMailSubject = "";
279 mCurrentIncidence = event; 279 mCurrentIncidence = event;
280 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 280 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
281 bool wideScreen = ( QApplication::desktop()->width() >= 640 );
281 topLevelWidget()->setCaption(i18n("Event Viewer")); 282 topLevelWidget()->setCaption(i18n("Event Viewer"));
282 if ( mode == 0 ) { 283 if ( mode == 0 ) {
283 addTag("h2",deTag(event->summary())); 284 addTag("h2",deTag(event->summary()));
284 } 285 }
285 else { 286 else {
286 if ( mColorMode == 1 ) { 287 if ( mColorMode == 1 ) {
287 mText +="<font color=\"#00A000\">"; 288 mText +="<font color=\"#00A000\">";
288 } 289 }
289 if ( mColorMode == 2 ) { 290 if ( mColorMode == 2 ) {
290 mText +="<font color=\"#C00000\">"; 291 mText +="<font color=\"#C00000\">";
291 } 292 }
292 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 293 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
293 if ( mode == 1 ) { 294 if ( mode == 1 ) {
294 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 295 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
295 } else { 296 } else {
296 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 297 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
297 } 298 }
298 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 299 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
299 if ( mColorMode ) 300 if ( mColorMode )
300 mText += "</font>"; 301 mText += "</font>";
301 } 302 }
302 mMailSubject += i18n( "Meeting " )+ event->summary(); 303 mMailSubject += i18n( "Meeting " )+ event->summary();
303 if (event->cancelled ()) { 304 if (event->cancelled ()) {
304 mText +="<font color=\"#B00000\">"; 305 mText +="<font color=\"#B00000\">";
@@ -310,134 +311,144 @@ void KOEventViewer::appendEvent(Event *event, int mode )
310 311
311 if (event->doesFloat()) { 312 if (event->doesFloat()) {
312 if (event->isMultiDay()) { 313 if (event->isMultiDay()) {
313 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") 314 mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>")
314 .arg(event->dtStartDateStr(shortDate)) 315 .arg(event->dtStartDateStr(shortDate))
315 .arg(event->dtEndDateStr(shortDate))); 316 .arg(event->dtEndDateStr(shortDate)));
316 } else { 317 } else {
317 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); 318 mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate )));
318 } 319 }
319 } else { 320 } else {
320 if (event->isMultiDay()) { 321 if (event->isMultiDay()) {
321 mText.append(i18n("<p><b>From:</b> %1</p> ") 322 mText.append(i18n("<p><b>From:</b> %1</p> ")
322 .arg(event->dtStartStr( shortDate))); 323 .arg(event->dtStartStr( shortDate)));
323 mText.append(i18n("<p><b>To:</b> %1</p>") 324 mText.append(i18n("<p><b>To:</b> %1</p>")
324 .arg(event->dtEndStr(shortDate))); 325 .arg(event->dtEndStr(shortDate)));
325 } else { 326 } else {
326 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") 327 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
327 .arg(event->dtStartTimeStr()) 328 .arg(event->dtStartTimeStr())
328 .arg(event->dtEndTimeStr())); 329 .arg(event->dtEndTimeStr()));
329 mText.append(i18n("<p><b>On:</b> %1</p> ") 330 mText.append(i18n("<p><b>On:</b> %1</p> ")
330 .arg(event->dtStartDateStr( shortDate ))); 331 .arg(event->dtStartDateStr( shortDate )));
331 } 332 }
332 } 333 }
333 if (!event->location().isEmpty()) { 334 if (!event->location().isEmpty()) {
334 addTag("b",i18n("Location: ")); 335 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
335 mText.append(deTag(event->location())+"<br>");
336 mMailSubject += i18n(" at ") + event->location(); 336 mMailSubject += i18n(" at ") + event->location();
337 } 337 }
338 if (event->recurrence()->doesRecur()) { 338 if (event->recurrence()->doesRecur()) {
339 339
340 QString recurText = event->recurrence()->recurrenceText(); 340 QString recurText = event->recurrence()->recurrenceText();
341 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); 341 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
342 bool ok; 342 bool ok;
343 QDate start = QDate::currentDate(); 343 QDate start = QDate::currentDate();
344 QDateTime next; 344 QDateTime next;
345 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); 345 next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
346 if ( ok ) { 346 if ( ok ) {
347 addTag("p",i18n("<b>Next recurrence is on:</b>") ); 347 if ( wideScreen ){
348 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); 348 addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) );
349 } else {
350 addTag("p",i18n("<b>Next recurrence is on:</b>") );
351 addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
352 }
349 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); 353 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
350 354
351 } else { 355 } else {
352 bool last; 356 bool last;
353 QDate nextd; 357 QDate nextd;
354 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); 358 nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
355 if ( last ) { 359 if ( last ) {
356 addTag("p",i18n("<b>Last recurrence was on:</b>") ); 360 if ( wideScreen ){
357 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); 361 addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate ));
362 } else{
363 addTag("p",i18n("<b>Last recurrence was on:</b>") );
364 addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
365 }
358 } 366 }
359 } 367 }
360 } else { 368 } else {
361 mMailSubject += i18n(" - " )+event->dtStartStr( true ); 369 mMailSubject += i18n(" - " )+event->dtStartStr( true );
362 370
363 } 371 }
364 372
365 373
366 if (event->isAlarmEnabled()) { 374 if (event->isAlarmEnabled()) {
367 Alarm *alarm =event->alarms().first() ; 375 Alarm *alarm =event->alarms().first() ;
368 QDateTime t = alarm->time(); 376 QDateTime t = alarm->time();
369 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 377 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
370 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 378 if(wideScreen ){
371 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 379 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
380 }else{
381 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
382 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
383 }
372 //addTag("p",s); 384 //addTag("p",s);
373 } 385 }
374 386
375 addTag("b",i18n("Access: ")); 387 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
376 mText.append(event->secrecyStr()+"<br>");
377 388
378
379
380 formatCategories(event); 389 formatCategories(event);
381 390
382 formatReadOnly(event); 391 formatReadOnly(event);
383 formatAttendees(event); 392 formatAttendees(event);
384 393
385 if ( KOPrefs::instance()->mEVshowCreated ) { 394 if ( KOPrefs::instance()->mEVshowCreated ) {
386#ifdef DESKTOP_VERSION 395 if(wideScreen ){
387 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 396 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
388#else 397 }else{
389 addTag("p",i18n("<b>Created: ") +" </b>"); 398 addTag("p",i18n("<b>Created: ") +" </b>");
390 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 399 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
391#endif 400 }
401
392 402
393 } 403 }
394 if ( KOPrefs::instance()->mEVshowChanged ) { 404 if ( KOPrefs::instance()->mEVshowChanged ) {
395#ifdef DESKTOP_VERSION 405 if(wideScreen ){
396 addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); 406 addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
397#else 407 }else{
398 addTag("p",i18n("<b>Last modified: ") +" </b>"); 408 addTag("p",i18n("<b>Last modified: ") +" </b>");
399 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 409 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
400#endif 410 }
401 411
402 } 412 }
403 if ( KOPrefs::instance()->mEVshowDetails ) { 413 if ( KOPrefs::instance()->mEVshowDetails ) {
404 if (!event->description().isEmpty()) { 414 if (!event->description().isEmpty()) {
405 addTag("p",i18n("<b>Details: </b>")); 415 addTag("p",i18n("<b>Details: </b>"));
406 addTag("p",deTag(event->description())); 416 addTag("p",deTag(event->description()));
407 } 417 }
408 } 418 }
409 setText(mText); 419 setText(mText);
410 //QWhatsThis::add(this,mText); 420 //QWhatsThis::add(this,mText);
411 421
412} 422}
413 423
414void KOEventViewer::appendTodo(Todo *event, int mode ) 424void KOEventViewer::appendTodo(Todo *event, int mode )
415{ 425{
416 mMailSubject = ""; 426 mMailSubject = "";
417 mCurrentIncidence = event; 427 mCurrentIncidence = event;
418 topLevelWidget()->setCaption(i18n("Todo Viewer")); 428 topLevelWidget()->setCaption(i18n("Todo Viewer"));
419 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 429 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
430 bool wideScreen = ( QApplication::desktop()->width() >= 640 );
420 if (mode == 0 ) 431 if (mode == 0 )
421 addTag("h2",deTag(event->summary())); 432 addTag("h2",deTag(event->summary()));
422 else { 433 else {
423 if ( mColorMode == 1 ) { 434 if ( mColorMode == 1 ) {
424 mText +="<font color=\"#00A000\">"; 435 mText +="<font color=\"#00A000\">";
425 } 436 }
426 if ( mColorMode == 2 ) { 437 if ( mColorMode == 2 ) {
427 mText +="<font color=\"#B00000\">"; 438 mText +="<font color=\"#B00000\">";
428 } 439 }
429 if ( mode == 1 ) { 440 if ( mode == 1 ) {
430 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 441 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
431 } else { 442 } else {
432 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 443 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
433 } 444 }
434 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 445 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
435 if ( mColorMode ) 446 if ( mColorMode )
436 mText += "</font>"; 447 mText += "</font>";
437 } 448 }
438 mMailSubject += i18n( "Todo " )+ event->summary(); 449 mMailSubject += i18n( "Todo " )+ event->summary();
439 450
440 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { 451 if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
441 mText +="<font color=\"#B00000\">"; 452 mText +="<font color=\"#B00000\">";
442 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); 453 addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
443 mText += "</font>"; 454 mText += "</font>";
@@ -448,122 +459,123 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
448 459
449 if (event->cancelled ()) { 460 if (event->cancelled ()) {
450 mText +="<font color=\"#B00000\">"; 461 mText +="<font color=\"#B00000\">";
451 addTag("i",i18n("This todo has been cancelled!")); 462 addTag("i",i18n("This todo has been cancelled!"));
452 mText.append("<br>"); 463 mText.append("<br>");
453 mText += "</font>"; 464 mText += "</font>";
454 mMailSubject += i18n("(cancelled)"); 465 mMailSubject += i18n("(cancelled)");
455 } 466 }
456 467
457 468
458 469
459 if (event->recurrence()->doesRecur()) { 470 if (event->recurrence()->doesRecur()) {
460 471
461 QString recurText = event->recurrence()->recurrenceText(); 472 QString recurText = event->recurrence()->recurrenceText();
462 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); 473 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
463 474
464 } 475 }
465 if (event->hasStartDate()) { 476 if (event->hasStartDate()) {
466 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 477 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
467 } 478 }
468 if (event->hasDueDate()) { 479 if (event->hasDueDate()) {
469 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 480 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
470 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 481 mMailSubject += i18n(" - " )+event->dtDueStr( true );
471 } 482 }
472 if (!event->location().isEmpty()) { 483 if (!event->location().isEmpty()) {
473 addTag("b",i18n("Location: ")); 484 addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) );
474 mText.append(deTag(event->location())+"<br>");
475 mMailSubject += i18n(" at ") + event->location(); 485 mMailSubject += i18n(" at ") + event->location();
476 } 486 }
477 mText.append(i18n("<p><b>Priority:</b> %2</p>") 487 mText.append(i18n("<p><b>Priority:</b> %2</p>")
478 .arg(QString::number(event->priority()))); 488 .arg(QString::number(event->priority())));
479 489
480 if (event->isAlarmEnabled()) { 490 if (event->isAlarmEnabled()) {
481 Alarm *alarm =event->alarms().first() ; 491 Alarm *alarm =event->alarms().first() ;
482 QDateTime t = alarm->time(); 492 QDateTime t = alarm->time();
483 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 493 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
484 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 494 if ( wideScreen ) {
485 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 495 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
486 //addTag("p",s); 496 } else {
497 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
498 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
499 }
487 } 500 }
488 501
489 addTag("b",i18n("Access: ")); 502 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
490 mText.append(event->secrecyStr()+"<br>");
491 503
492 formatCategories(event); 504 formatCategories(event);
493 505
494 formatReadOnly(event); 506 formatReadOnly(event);
495 formatAttendees(event); 507 formatAttendees(event);
496 508
497 if ( KOPrefs::instance()->mEVshowCreated ) { 509 if ( KOPrefs::instance()->mEVshowCreated ) {
498#ifdef DESKTOP_VERSION 510 if(wideScreen ){
499 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 511
500#else 512 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
501 addTag("p",i18n("<b>Created: ") +" </b>"); 513
502 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); 514 } else {
503#endif 515 addTag("p",i18n("<b>Created: ") +" </b>");
504 516 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
517 }
505 } 518 }
506 if ( KOPrefs::instance()->mEVshowChanged ) { 519 if ( KOPrefs::instance()->mEVshowChanged ) {
507#ifdef DESKTOP_VERSION 520 if(wideScreen ){
508 addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); 521 addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) );
509#else 522
510 addTag("p",i18n("<b>Last modified: ") +" </b>"); 523 } else {
511 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); 524 addTag("p",i18n("<b>Last modified: ") +" </b>");
512#endif 525 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
513 526 }
514 } 527 }
515 if ( event->relatedTo() ) { 528 if ( event->relatedTo() ) {
516 addTag("b",i18n("Parent todo:<br>")); 529 addTag("b",i18n("Parent todo:<br>"));
517 mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); 530 mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
518 } 531 }
519 QPtrList<Incidence> Relations = event->relations(); 532 QPtrList<Incidence> Relations = event->relations();
520 Incidence *to; 533 Incidence *to;
521 if ( Relations.first() ) 534 if ( Relations.first() )
522 addTag("b",i18n("Sub todos:<br>")); 535 addTag("b",i18n("Sub todos:<br>"));
523 for (to=Relations.first();to;to=Relations.next()) { 536 for (to=Relations.first();to;to=Relations.next()) {
524 mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); 537 mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
525 538
526 } 539 }
527 540
528 if ( KOPrefs::instance()->mEVshowDetails ) { 541 if ( KOPrefs::instance()->mEVshowDetails ) {
529 if (!event->description().isEmpty()) { 542 if (!event->description().isEmpty()) {
530 addTag("p",i18n("<b>Details: </b>")); 543 addTag("p",i18n("<b>Details: </b>"));
531 addTag("p",deTag(event->description())); 544 addTag("p",deTag(event->description()));
532 } 545 }
533 } 546 }
534 setText(mText); 547 setText(mText);
535} 548}
536 549
537void KOEventViewer::formatCategories(Incidence *event) 550void KOEventViewer::formatCategories(Incidence *event)
538{ 551{
539 if (!event->categoriesStr().isEmpty()) { 552 if (!event->categoriesStr().isEmpty()) {
540 if (event->categories().count() == 1) { 553 if (event->categories().count() == 1) {
541 addTag("h3",i18n("Category")); 554 addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace());
542 } else { 555 } else {
543 addTag("h3",i18n("Categories")); 556 addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ;
544 } 557 }
545 addTag("p",event->categoriesStr());
546 } 558 }
547} 559}
548void KOEventViewer::formatAttendees(Incidence *event) 560void KOEventViewer::formatAttendees(Incidence *event)
549{ 561{
550 QPtrList<Attendee> attendees = event->attendees(); 562 QPtrList<Attendee> attendees = event->attendees();
551 if (attendees.count()) { 563 if (attendees.count()) {
552 564
553 565
554 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 566 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
555 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); 567 QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
556 addTag("h3",i18n("Organizer")); 568 addTag("h3",i18n("Organizer"));
557 mText.append("<ul><li>"); 569 mText.append("<ul><li>");
558#ifndef KORG_NOKABC 570#ifndef KORG_NOKABC
559 571
560#ifdef DESKTOP_VERSION 572#ifdef DESKTOP_VERSION
561 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 573 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
562 KABC::Addressee::List addressList; 574 KABC::Addressee::List addressList;
563 addressList = add_book->findByEmail(event->organizer()); 575 addressList = add_book->findByEmail(event->organizer());
564 KABC::Addressee o = addressList.first(); 576 KABC::Addressee o = addressList.first();
565 if (!o.isEmpty() && addressList.size()<2) { 577 if (!o.isEmpty() && addressList.size()<2) {
566 mText += "<a href=\"uid:" + o.uid() + "\">"; 578 mText += "<a href=\"uid:" + o.uid() + "\">";
567 mText += o.formattedName(); 579 mText += o.formattedName();
568 mText += "</a>\n"; 580 mText += "</a>\n";
569 } else { 581 } else {