-rw-r--r-- | korganizer/koeventviewer.cpp | 94 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 5 |
2 files changed, 59 insertions, 40 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index bdad248..fefc778 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -266,301 +266,319 @@ void KOEventViewer::addTag(const QString & tag,const QString & text) | |||
266 | tmpStr+="</" + tag + ">"; | 266 | tmpStr+="</" + tag + ">"; |
267 | mText.append(tmpStr); | 267 | mText.append(tmpStr); |
268 | } | 268 | } |
269 | else | 269 | else |
270 | { | 270 | { |
271 | str += text + "</" + tag + ">"; | 271 | str += text + "</" + tag + ">"; |
272 | mText.append(str); | 272 | mText.append(str); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | void KOEventViewer::setColorMode( int m ) | 276 | void KOEventViewer::setColorMode( int m ) |
277 | { | 277 | { |
278 | mColorMode = m; | 278 | mColorMode = m; |
279 | } | 279 | } |
280 | void KOEventViewer::appendEvent(Event *event, int mode ) | 280 | void KOEventViewer::appendEvent(Event *event, int mode ) |
281 | { | 281 | { |
282 | mMailSubject = ""; | 282 | mMailSubject = ""; |
283 | mCurrentIncidence = event; | 283 | mCurrentIncidence = event; |
284 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 284 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
285 | topLevelWidget()->setCaption(i18n("Event Viewer")); | 285 | topLevelWidget()->setCaption(i18n("Event Viewer")); |
286 | if ( mode == 0 ) { | 286 | if ( mode == 0 ) { |
287 | addTag("h2",deTag(event->summary())); | 287 | addTag("h2",deTag(event->summary())); |
288 | } | 288 | } |
289 | else { | 289 | else { |
290 | if ( mColorMode == 1 ) { | 290 | if ( mColorMode == 1 ) { |
291 | mText +="<font color=\"#00A000\">"; | 291 | mText +="<font color=\"#00A000\">"; |
292 | } | 292 | } |
293 | if ( mColorMode == 2 ) { | 293 | if ( mColorMode == 2 ) { |
294 | mText +="<font color=\"#C00000\">"; | 294 | mText +="<font color=\"#C00000\">"; |
295 | } | 295 | } |
296 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 296 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
297 | if ( mode == 1 ) { | 297 | if ( mode == 1 ) { |
298 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 298 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
299 | } else { | 299 | } else { |
300 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 300 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
301 | } | 301 | } |
302 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 302 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
303 | if ( mColorMode ) | 303 | if ( mColorMode ) |
304 | mText += "</font>"; | 304 | mText += "</font>"; |
305 | } | 305 | } |
306 | mMailSubject += i18n( "Meeting " )+ event->summary(); | 306 | mMailSubject += i18n( "Meeting " )+ event->summary(); |
307 | if (event->cancelled ()) { | 307 | if (event->cancelled ()) { |
308 | mText +="<font color=\"#B00000\">"; | 308 | mText +="<font color=\"#B00000\">"; |
309 | addTag("i",i18n("This event has been cancelled!")); | 309 | addTag("i",i18n("This event has been cancelled!")); |
310 | mText.append("<br>"); | 310 | mText.append("<br>"); |
311 | mText += "</font>"; | 311 | mText += "</font>"; |
312 | mMailSubject += i18n("(cancelled)"); | 312 | mMailSubject += i18n("(cancelled)"); |
313 | } | 313 | } |
314 | if (!event->location().isEmpty()) { | 314 | |
315 | addTag("b",i18n("Location: ")); | ||
316 | mText.append(deTag(event->location())+"<br>"); | ||
317 | mMailSubject += i18n(" at ") + event->location(); | ||
318 | } | ||
319 | if (event->doesFloat()) { | 315 | if (event->doesFloat()) { |
320 | if (event->isMultiDay()) { | 316 | if (event->isMultiDay()) { |
321 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 317 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
322 | .arg(event->dtStartDateStr(shortDate)) | 318 | .arg(event->dtStartDateStr(shortDate)) |
323 | .arg(event->dtEndDateStr(shortDate))); | 319 | .arg(event->dtEndDateStr(shortDate))); |
324 | } else { | 320 | } else { |
325 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 321 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
326 | } | 322 | } |
327 | } else { | 323 | } else { |
328 | if (event->isMultiDay()) { | 324 | if (event->isMultiDay()) { |
329 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 325 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
330 | .arg(event->dtStartStr( shortDate))); | 326 | .arg(event->dtStartStr( shortDate))); |
331 | mText.append(i18n("<p><b>To:</b> %1</p>") | 327 | mText.append(i18n("<p><b>To:</b> %1</p>") |
332 | .arg(event->dtEndStr(shortDate))); | 328 | .arg(event->dtEndStr(shortDate))); |
333 | } else { | 329 | } else { |
334 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
335 | .arg(event->dtStartDateStr( shortDate ))); | ||
336 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 330 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
337 | .arg(event->dtStartTimeStr()) | 331 | .arg(event->dtStartTimeStr()) |
338 | .arg(event->dtEndTimeStr())); | 332 | .arg(event->dtEndTimeStr())); |
333 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
334 | .arg(event->dtStartDateStr( shortDate ))); | ||
339 | } | 335 | } |
340 | } | 336 | } |
341 | 337 | if (!event->location().isEmpty()) { | |
338 | addTag("b",i18n("Location: ")); | ||
339 | mText.append(deTag(event->location())+"<br>"); | ||
340 | mMailSubject += i18n(" at ") + event->location(); | ||
341 | } | ||
342 | if (event->recurrence()->doesRecur()) { | 342 | if (event->recurrence()->doesRecur()) { |
343 | 343 | ||
344 | QString recurText = event->recurrence()->recurrenceText(); | 344 | QString recurText = event->recurrence()->recurrenceText(); |
345 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 345 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
346 | bool ok; | 346 | bool ok; |
347 | QDate start = QDate::currentDate(); | 347 | QDate start = QDate::currentDate(); |
348 | QDateTime next; | 348 | QDateTime next; |
349 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 349 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
350 | if ( ok ) { | 350 | if ( ok ) { |
351 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 351 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
352 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 352 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
353 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); | 353 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
354 | 354 | ||
355 | } else { | 355 | } else { |
356 | bool last; | 356 | bool last; |
357 | QDate nextd; | 357 | QDate nextd; |
358 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 358 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
359 | if ( last ) { | 359 | if ( last ) { |
360 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 360 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
361 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 361 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
362 | } | 362 | } |
363 | } | 363 | } |
364 | } else { | 364 | } else { |
365 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 365 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
366 | 366 | ||
367 | } | 367 | } |
368 | 368 | ||
369 | 369 | ||
370 | if (event->isAlarmEnabled()) { | 370 | if (event->isAlarmEnabled()) { |
371 | Alarm *alarm =event->alarms().first() ; | 371 | Alarm *alarm =event->alarms().first() ; |
372 | QDateTime t = alarm->time(); | 372 | QDateTime t = alarm->time(); |
373 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 373 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
374 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 374 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
375 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 375 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
376 | //addTag("p",s); | 376 | //addTag("p",s); |
377 | } | 377 | } |
378 | 378 | ||
379 | addTag("b",i18n("Access: ")); | 379 | addTag("b",i18n("Access: ")); |
380 | mText.append(event->secrecyStr()+"<br>"); | 380 | mText.append(event->secrecyStr()+"<br>"); |
381 | 381 | ||
382 | 382 | ||
383 | if ( KOPrefs::instance()->mEVshowDetails ) { | 383 | |
384 | if (!event->description().isEmpty()) { | ||
385 | addTag("p",i18n("<b>Details: </b>")); | ||
386 | addTag("p",deTag(event->description())); | ||
387 | } | ||
388 | } | ||
389 | formatCategories(event); | 384 | formatCategories(event); |
390 | 385 | ||
391 | formatReadOnly(event); | 386 | formatReadOnly(event); |
392 | formatAttendees(event); | 387 | formatAttendees(event); |
393 | 388 | ||
394 | if ( KOPrefs::instance()->mEVshowCreated ) { | 389 | if ( KOPrefs::instance()->mEVshowCreated ) { |
390 | #ifdef DESKTOP_VERSION | ||
391 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
392 | #else | ||
395 | addTag("p",i18n("<b>Created: ") +" </b>"); | 393 | addTag("p",i18n("<b>Created: ") +" </b>"); |
396 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 394 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
395 | #endif | ||
397 | 396 | ||
398 | } | 397 | } |
399 | if ( KOPrefs::instance()->mEVshowChanged ) { | 398 | if ( KOPrefs::instance()->mEVshowChanged ) { |
399 | #ifdef DESKTOP_VERSION | ||
400 | addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | ||
401 | #else | ||
400 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | 402 | addTag("p",i18n("<b>Last modified: ") +" </b>"); |
401 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | 403 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); |
404 | #endif | ||
402 | 405 | ||
406 | } | ||
407 | if ( KOPrefs::instance()->mEVshowDetails ) { | ||
408 | if (!event->description().isEmpty()) { | ||
409 | addTag("p",i18n("<b>Details: </b>")); | ||
410 | addTag("p",deTag(event->description())); | ||
411 | } | ||
403 | } | 412 | } |
404 | setText(mText); | 413 | setText(mText); |
405 | //QWhatsThis::add(this,mText); | 414 | //QWhatsThis::add(this,mText); |
406 | 415 | ||
407 | } | 416 | } |
408 | 417 | ||
409 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 418 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
410 | { | 419 | { |
411 | mMailSubject = ""; | 420 | mMailSubject = ""; |
412 | mCurrentIncidence = event; | 421 | mCurrentIncidence = event; |
413 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 422 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
414 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 423 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
415 | if (mode == 0 ) | 424 | if (mode == 0 ) |
416 | addTag("h2",deTag(event->summary())); | 425 | addTag("h2",deTag(event->summary())); |
417 | else { | 426 | else { |
418 | if ( mColorMode == 1 ) { | 427 | if ( mColorMode == 1 ) { |
419 | mText +="<font color=\"#00A000\">"; | 428 | mText +="<font color=\"#00A000\">"; |
420 | } | 429 | } |
421 | if ( mColorMode == 2 ) { | 430 | if ( mColorMode == 2 ) { |
422 | mText +="<font color=\"#B00000\">"; | 431 | mText +="<font color=\"#B00000\">"; |
423 | } | 432 | } |
424 | if ( mode == 1 ) { | 433 | if ( mode == 1 ) { |
425 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 434 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
426 | } else { | 435 | } else { |
427 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 436 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
428 | } | 437 | } |
429 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 438 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
430 | if ( mColorMode ) | 439 | if ( mColorMode ) |
431 | mText += "</font>"; | 440 | mText += "</font>"; |
432 | } | 441 | } |
433 | mMailSubject += i18n( "Todo " )+ event->summary(); | 442 | mMailSubject += i18n( "Todo " )+ event->summary(); |
434 | 443 | ||
435 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 444 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
436 | mText +="<font color=\"#B00000\">"; | 445 | mText +="<font color=\"#B00000\">"; |
437 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 446 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
438 | mText += "</font>"; | 447 | mText += "</font>"; |
439 | } else { | 448 | } else { |
440 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 449 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
441 | .arg(event->percentComplete())); | 450 | .arg(event->percentComplete())); |
442 | } | 451 | } |
443 | 452 | ||
444 | if (event->cancelled ()) { | 453 | if (event->cancelled ()) { |
445 | mText +="<font color=\"#B00000\">"; | 454 | mText +="<font color=\"#B00000\">"; |
446 | addTag("i",i18n("This todo has been cancelled!")); | 455 | addTag("i",i18n("This todo has been cancelled!")); |
447 | mText.append("<br>"); | 456 | mText.append("<br>"); |
448 | mText += "</font>"; | 457 | mText += "</font>"; |
449 | mMailSubject += i18n("(cancelled)"); | 458 | mMailSubject += i18n("(cancelled)"); |
450 | } | 459 | } |
451 | 460 | ||
452 | if (!event->location().isEmpty()) { | 461 | |
453 | addTag("b",i18n("Location: ")); | ||
454 | mText.append(deTag(event->location())+"<br>"); | ||
455 | mMailSubject += i18n(" at ") + event->location(); | ||
456 | } | ||
457 | 462 | ||
458 | if (event->recurrence()->doesRecur()) { | 463 | if (event->recurrence()->doesRecur()) { |
459 | 464 | ||
460 | QString recurText = event->recurrence()->recurrenceText(); | 465 | QString recurText = event->recurrence()->recurrenceText(); |
461 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 466 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
462 | 467 | ||
463 | } | 468 | } |
464 | if (event->hasStartDate()) { | 469 | if (event->hasStartDate()) { |
465 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 470 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
466 | } | 471 | } |
467 | if (event->hasDueDate()) { | 472 | if (event->hasDueDate()) { |
468 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 473 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
469 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 474 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
470 | } | 475 | } |
471 | 476 | if (!event->location().isEmpty()) { | |
477 | addTag("b",i18n("Location: ")); | ||
478 | mText.append(deTag(event->location())+"<br>"); | ||
479 | mMailSubject += i18n(" at ") + event->location(); | ||
480 | } | ||
481 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | ||
482 | .arg(QString::number(event->priority()))); | ||
472 | 483 | ||
473 | if (event->isAlarmEnabled()) { | 484 | if (event->isAlarmEnabled()) { |
474 | Alarm *alarm =event->alarms().first() ; | 485 | Alarm *alarm =event->alarms().first() ; |
475 | QDateTime t = alarm->time(); | 486 | QDateTime t = alarm->time(); |
476 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 487 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
477 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 488 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
478 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 489 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
479 | //addTag("p",s); | 490 | //addTag("p",s); |
480 | } | 491 | } |
481 | 492 | ||
482 | addTag("b",i18n("Access: ")); | 493 | addTag("b",i18n("Access: ")); |
483 | mText.append(event->secrecyStr()+"<br>"); | 494 | mText.append(event->secrecyStr()+"<br>"); |
484 | if ( KOPrefs::instance()->mEVshowDetails ) { | ||
485 | if (!event->description().isEmpty()) { | ||
486 | addTag("p",i18n("<b>Details: </b>")); | ||
487 | addTag("p",deTag(event->description())); | ||
488 | } | ||
489 | } | ||
490 | 495 | ||
491 | formatCategories(event); | 496 | formatCategories(event); |
492 | 497 | ||
493 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | ||
494 | .arg(QString::number(event->priority()))); | ||
495 | |||
496 | formatReadOnly(event); | 498 | formatReadOnly(event); |
497 | formatAttendees(event); | 499 | formatAttendees(event); |
500 | |||
501 | if ( KOPrefs::instance()->mEVshowCreated ) { | ||
502 | #ifdef DESKTOP_VERSION | ||
503 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
504 | #else | ||
505 | addTag("p",i18n("<b>Created: ") +" </b>"); | ||
506 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
507 | #endif | ||
508 | |||
509 | } | ||
510 | if ( KOPrefs::instance()->mEVshowChanged ) { | ||
511 | #ifdef DESKTOP_VERSION | ||
512 | addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | ||
513 | #else | ||
514 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
515 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
516 | #endif | ||
517 | |||
518 | } | ||
498 | if ( event->relatedTo() ) { | 519 | if ( event->relatedTo() ) { |
499 | addTag("b",i18n("Parent todo:<br>")); | 520 | addTag("b",i18n("Parent todo:<br>")); |
500 | mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 521 | mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
501 | } | 522 | } |
502 | QPtrList<Incidence> Relations = event->relations(); | 523 | QPtrList<Incidence> Relations = event->relations(); |
503 | Incidence *to; | 524 | Incidence *to; |
504 | if ( Relations.first() ) | 525 | if ( Relations.first() ) |
505 | addTag("b",i18n("Sub todos:<br>")); | 526 | addTag("b",i18n("Sub todos:<br>")); |
506 | for (to=Relations.first();to;to=Relations.next()) { | 527 | for (to=Relations.first();to;to=Relations.next()) { |
507 | mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); | 528 | mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); |
508 | 529 | ||
509 | } | 530 | } |
510 | if ( KOPrefs::instance()->mEVshowCreated ) { | 531 | |
511 | addTag("p",i18n("<b>Created: ") +" </b>"); | 532 | if ( KOPrefs::instance()->mEVshowDetails ) { |
512 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 533 | if (!event->description().isEmpty()) { |
513 | 534 | addTag("p",i18n("<b>Details: </b>")); | |
514 | } | 535 | addTag("p",deTag(event->description())); |
515 | if ( KOPrefs::instance()->mEVshowChanged ) { | 536 | } |
516 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
517 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
518 | |||
519 | } | 537 | } |
520 | setText(mText); | 538 | setText(mText); |
521 | } | 539 | } |
522 | 540 | ||
523 | void KOEventViewer::formatCategories(Incidence *event) | 541 | void KOEventViewer::formatCategories(Incidence *event) |
524 | { | 542 | { |
525 | if (!event->categoriesStr().isEmpty()) { | 543 | if (!event->categoriesStr().isEmpty()) { |
526 | if (event->categories().count() == 1) { | 544 | if (event->categories().count() == 1) { |
527 | addTag("h3",i18n("Category")); | 545 | addTag("h3",i18n("Category")); |
528 | } else { | 546 | } else { |
529 | addTag("h3",i18n("Categories")); | 547 | addTag("h3",i18n("Categories")); |
530 | } | 548 | } |
531 | addTag("p",event->categoriesStr()); | 549 | addTag("p",event->categoriesStr()); |
532 | } | 550 | } |
533 | } | 551 | } |
534 | void KOEventViewer::formatAttendees(Incidence *event) | 552 | void KOEventViewer::formatAttendees(Incidence *event) |
535 | { | 553 | { |
536 | QPtrList<Attendee> attendees = event->attendees(); | 554 | QPtrList<Attendee> attendees = event->attendees(); |
537 | if (attendees.count()) { | 555 | if (attendees.count()) { |
538 | 556 | ||
539 | 557 | ||
540 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 558 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
541 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 559 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
542 | addTag("h3",i18n("Organizer")); | 560 | addTag("h3",i18n("Organizer")); |
543 | mText.append("<ul><li>"); | 561 | mText.append("<ul><li>"); |
544 | #ifndef KORG_NOKABC | 562 | #ifndef KORG_NOKABC |
545 | 563 | ||
546 | #ifdef DESKTOP_VERSION | 564 | #ifdef DESKTOP_VERSION |
547 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 565 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
548 | KABC::Addressee::List addressList; | 566 | KABC::Addressee::List addressList; |
549 | addressList = add_book->findByEmail(event->organizer()); | 567 | addressList = add_book->findByEmail(event->organizer()); |
550 | KABC::Addressee o = addressList.first(); | 568 | KABC::Addressee o = addressList.first(); |
551 | if (!o.isEmpty() && addressList.size()<2) { | 569 | if (!o.isEmpty() && addressList.size()<2) { |
552 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 570 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
553 | mText += o.formattedName(); | 571 | mText += o.formattedName(); |
554 | mText += "</a>\n"; | 572 | mText += "</a>\n"; |
555 | } else { | 573 | } else { |
556 | mText.append(event->organizer()); | 574 | mText.append(event->organizer()); |
557 | } | 575 | } |
558 | #else //DESKTOP_VERSION | 576 | #else //DESKTOP_VERSION |
559 | mText += "<a href=\"uid:organizer\">"; | 577 | mText += "<a href=\"uid:organizer\">"; |
560 | mText += event->organizer(); | 578 | mText += event->organizer(); |
561 | mText += "</a>\n"; | 579 | mText += "</a>\n"; |
562 | #endif //DESKTOP_VERSION | 580 | #endif //DESKTOP_VERSION |
563 | 581 | ||
564 | 582 | ||
565 | #else | 583 | #else |
566 | mText.append(event->organizer()); | 584 | mText.append(event->organizer()); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 65d6acf..b175f9a 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -597,97 +597,97 @@ void MonthViewCell::startUpdateCell() | |||
597 | mitem->setBlockRepaint( true ); | 597 | mitem->setBlockRepaint( true ); |
598 | mitem = (MonthViewItem *)mitem->next(); | 598 | mitem = (MonthViewItem *)mitem->next(); |
599 | } | 599 | } |
600 | if ( mAvailItemList.count() > 20 ) { | 600 | if ( mAvailItemList.count() > 20 ) { |
601 | mAvailItemList.setAutoDelete( true ); | 601 | mAvailItemList.setAutoDelete( true ); |
602 | mAvailItemList.clear(); | 602 | mAvailItemList.clear(); |
603 | mAvailItemList.setAutoDelete( false ); | 603 | mAvailItemList.setAutoDelete( false ); |
604 | } | 604 | } |
605 | /* | 605 | /* |
606 | if ( !isVisible() ){ | 606 | if ( !isVisible() ){ |
607 | return; | 607 | return; |
608 | } | 608 | } |
609 | */ | 609 | */ |
610 | // qDebug("MonthViewCell::updateCell() "); | 610 | // qDebug("MonthViewCell::updateCell() "); |
611 | setPrimary( mDate.month()%2 ); | 611 | setPrimary( mDate.month()%2 ); |
612 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); | 612 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); |
613 | if ( mDate == QDate::currentDate() ) { | 613 | if ( mDate == QDate::currentDate() ) { |
614 | setLineWidth( 3 ); | 614 | setLineWidth( 3 ); |
615 | } else { | 615 | } else { |
616 | setLineWidth( 1 ); | 616 | setLineWidth( 1 ); |
617 | } | 617 | } |
618 | MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); | 618 | MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); |
619 | //clear(); | 619 | //clear(); |
620 | while ( CurrentAvailItem ) { | 620 | while ( CurrentAvailItem ) { |
621 | MonthViewItem *item = CurrentAvailItem; | 621 | MonthViewItem *item = CurrentAvailItem; |
622 | CurrentAvailItem = (MonthViewItem *)item->next(); | 622 | CurrentAvailItem = (MonthViewItem *)item->next(); |
623 | mAvailItemList.append( item ); | 623 | mAvailItemList.append( item ); |
624 | takeItem ( item ); | 624 | takeItem ( item ); |
625 | } | 625 | } |
626 | 626 | ||
627 | #ifdef DESKTOP_VERSION | 627 | #ifdef DESKTOP_VERSION |
628 | QToolTip::remove(this); | 628 | QToolTip::remove(this); |
629 | #endif | 629 | #endif |
630 | mToolTip.clear(); | 630 | mToolTip.clear(); |
631 | //qApp->processEvents(); | 631 | //qApp->processEvents(); |
632 | #if 0 | 632 | #if 0 |
633 | if ( !mHolidayString.isEmpty() ) { | 633 | if ( !mHolidayString.isEmpty() ) { |
634 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); | 634 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); |
635 | item->setPalette( mHolidayPalette ); | 635 | item->setPalette( mHolidayPalette ); |
636 | insertItem( item ); | 636 | insertItem( item ); |
637 | mToolTip.append ( mHolidayString ); | 637 | mToolTip.append ( mHolidayString ); |
638 | } | 638 | } |
639 | #endif | 639 | #endif |
640 | } | 640 | } |
641 | 641 | ||
642 | int MonthViewCell::insertEvent(Event *event) | 642 | int MonthViewCell::insertEvent(Event *event) |
643 | { | 643 | { |
644 | bool useToolTips = true; | 644 | bool useToolTips = true; |
645 | #ifndef DEKSTOP_VERSION | 645 | #ifndef DESKTOP_VERSION |
646 | useToolTips = false; | 646 | useToolTips = false; |
647 | #endif | 647 | #endif |
648 | QString mToolTipText; | 648 | QString mToolTipText; |
649 | setFocusPolicy(WheelFocus); | 649 | setFocusPolicy(WheelFocus); |
650 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 650 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
651 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 651 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
652 | return mdayCount; | 652 | return mdayCount; |
653 | else | 653 | else |
654 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 654 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
655 | return mdayCount; | 655 | return mdayCount; |
656 | } | 656 | } |
657 | 657 | ||
658 | if ( event->isHoliday()) { | 658 | if ( event->isHoliday()) { |
659 | setHoliday( true ); | 659 | setHoliday( true ); |
660 | if ( mDate.dayOfWeek() == 7 ) | 660 | if ( mDate.dayOfWeek() == 7 ) |
661 | setLineWidth( 3 ); | 661 | setLineWidth( 3 ); |
662 | } | 662 | } |
663 | QString text; | 663 | QString text; |
664 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 664 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
665 | if (event->isMultiDay()) { | 665 | if (event->isMultiDay()) { |
666 | QString prefix = "<->";multiday = 2; | 666 | QString prefix = "<->";multiday = 2; |
667 | QString time; | 667 | QString time; |
668 | if ( event->doesRecur() ) { | 668 | if ( event->doesRecur() ) { |
669 | if ( event->recursOn( mDate) ) { | 669 | if ( event->recursOn( mDate) ) { |
670 | prefix ="->" ;multiday = 1; | 670 | prefix ="->" ;multiday = 1; |
671 | } | 671 | } |
672 | else { | 672 | else { |
673 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 673 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
674 | if ( event->recursOn( mDate.addDays( -days)) ) { | 674 | if ( event->recursOn( mDate.addDays( -days)) ) { |
675 | prefix ="<-" ;multiday = 3; | 675 | prefix ="<-" ;multiday = 3; |
676 | } | 676 | } |
677 | } | 677 | } |
678 | 678 | ||
679 | } else { | 679 | } else { |
680 | if (mDate == event->dtStart().date()) { | 680 | if (mDate == event->dtStart().date()) { |
681 | prefix ="->" ;multiday = 1; | 681 | prefix ="->" ;multiday = 1; |
682 | } else if (mDate == event->dtEnd().date()) { | 682 | } else if (mDate == event->dtEnd().date()) { |
683 | prefix ="<-" ;multiday = 3; | 683 | prefix ="<-" ;multiday = 3; |
684 | } | 684 | } |
685 | } | 685 | } |
686 | if ( !event->doesFloat() ) { | 686 | if ( !event->doesFloat() ) { |
687 | if ( mDate == event->dtStart().date () ) | 687 | if ( mDate == event->dtStart().date () ) |
688 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 688 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
689 | else if ( mDate == event->dtEnd().date () ) | 689 | else if ( mDate == event->dtEnd().date () ) |
690 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 690 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
691 | 691 | ||
692 | } | 692 | } |
693 | text = time + event->summary(); | 693 | text = time + event->summary(); |
@@ -729,98 +729,99 @@ int MonthViewCell::insertEvent(Event *event) | |||
729 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 729 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
730 | } else { | 730 | } else { |
731 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 731 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
732 | } | 732 | } |
733 | 733 | ||
734 | } else { | 734 | } else { |
735 | if (cat.isEmpty()) { | 735 | if (cat.isEmpty()) { |
736 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 736 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
737 | } else { | 737 | } else { |
738 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 738 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
739 | } | 739 | } |
740 | } | 740 | } |
741 | 741 | ||
742 | } else { | 742 | } else { |
743 | pal = mStandardPalette ; | 743 | pal = mStandardPalette ; |
744 | } | 744 | } |
745 | item->setPalette( pal ); | 745 | item->setPalette( pal ); |
746 | item->setRecur( event->recurrence()->doesRecur() ); | 746 | item->setRecur( event->recurrence()->doesRecur() ); |
747 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); | 747 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); |
748 | item->setMoreInfo( event->description().length() > 0 ); | 748 | item->setMoreInfo( event->description().length() > 0 ); |
749 | #ifdef DESKTOP_VERSION | 749 | #ifdef DESKTOP_VERSION |
750 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 750 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
751 | KOPrefs::instance()->email()); | 751 | KOPrefs::instance()->email()); |
752 | if ( me != 0 ) { | 752 | if ( me != 0 ) { |
753 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 753 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
754 | item->setReply(true && multiday < 2); | 754 | item->setReply(true && multiday < 2); |
755 | else | 755 | else |
756 | item->setReply(false); | 756 | item->setReply(false); |
757 | } else | 757 | } else |
758 | item->setReply(false); | 758 | item->setReply(false); |
759 | #endif | 759 | #endif |
760 | item->setMultiDay( multiday ); | 760 | item->setMultiDay( multiday ); |
761 | if ( multiday ) { | 761 | if ( multiday ) { |
762 | insertItem( item ,mdayCount); | 762 | insertItem( item ,mdayCount); |
763 | ++mdayCount; | 763 | ++mdayCount; |
764 | } else { | 764 | } else { |
765 | uint i; | 765 | uint i; |
766 | int pos = mdayCount; | 766 | int pos = mdayCount; |
767 | for ( i = mdayCount; i < count();++i ) { | 767 | for ( i = mdayCount; i < count();++i ) { |
768 | QListBoxItem* it = this->item ( i ); | 768 | QListBoxItem* it = this->item ( i ); |
769 | if ( text < it->text() ) { | 769 | if ( text < it->text() ) { |
770 | pos = i; | 770 | pos = i; |
771 | break; | 771 | break; |
772 | } | 772 | } |
773 | ++pos; | 773 | ++pos; |
774 | } | 774 | } |
775 | insertItem( item ,pos); | 775 | insertItem( item ,pos); |
776 | } | 776 | } |
777 | if ( useToolTips ) | 777 | if ( useToolTips ) { |
778 | mToolTip.append( mToolTipText ); | 778 | mToolTip.append( mToolTipText ); |
779 | } | ||
779 | return mdayCount; | 780 | return mdayCount; |
780 | } | 781 | } |
781 | void MonthViewCell::insertTodo(Todo *todo) | 782 | void MonthViewCell::insertTodo(Todo *todo) |
782 | { | 783 | { |
783 | setFocusPolicy(WheelFocus); | 784 | setFocusPolicy(WheelFocus); |
784 | QString text; | 785 | QString text; |
785 | if (todo->hasDueDate()) { | 786 | if (todo->hasDueDate()) { |
786 | if (!todo->doesFloat()) { | 787 | if (!todo->doesFloat()) { |
787 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 788 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
788 | text += " "; | 789 | text += " "; |
789 | } | 790 | } |
790 | } | 791 | } |
791 | text += todo->summary(); | 792 | text += todo->summary(); |
792 | MonthViewItem *item ; | 793 | MonthViewItem *item ; |
793 | if ( mAvailItemList.count() ) { | 794 | if ( mAvailItemList.count() ) { |
794 | item = mAvailItemList.first(); | 795 | item = mAvailItemList.first(); |
795 | mAvailItemList.remove( item ); | 796 | mAvailItemList.remove( item ); |
796 | item->recycle( todo, mDate, text ); | 797 | item->recycle( todo, mDate, text ); |
797 | } else { | 798 | } else { |
798 | item = new MonthViewItem( todo, mDate, text ); | 799 | item = new MonthViewItem( todo, mDate, text ); |
799 | } | 800 | } |
800 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 801 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
801 | //item->setPalette( mStandardPalette ); | 802 | //item->setPalette( mStandardPalette ); |
802 | QPalette pal; | 803 | QPalette pal; |
803 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 804 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
804 | QStringList categories = todo->categories(); | 805 | QStringList categories = todo->categories(); |
805 | QString cat = categories.first(); | 806 | QString cat = categories.first(); |
806 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 807 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
807 | pal = getPalette(); | 808 | pal = getPalette(); |
808 | if (cat.isEmpty()) { | 809 | if (cat.isEmpty()) { |
809 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 810 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
810 | } else { | 811 | } else { |
811 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 812 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
812 | } | 813 | } |
813 | 814 | ||
814 | } else { | 815 | } else { |
815 | if (cat.isEmpty()) { | 816 | if (cat.isEmpty()) { |
816 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 817 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
817 | } else { | 818 | } else { |
818 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 819 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
819 | } | 820 | } |
820 | } | 821 | } |
821 | 822 | ||
822 | } else { | 823 | } else { |
823 | pal = mStandardPalette ; | 824 | pal = mStandardPalette ; |
824 | } | 825 | } |
825 | item->setPalette( pal ); | 826 | item->setPalette( pal ); |
826 | item->setRecur( todo->recurrence()->doesRecur() ); | 827 | item->setRecur( todo->recurrence()->doesRecur() ); |