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
@@ -279,4 +279,5 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 ) {
@@ -332,6 +333,5 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 }
@@ -345,6 +345,10 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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
@@ -354,6 +358,10 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 }
@@ -368,14 +376,15 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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
@@ -384,19 +393,20 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 }
@@ -418,4 +428,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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()));
@@ -470,7 +481,6 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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 }
@@ -481,12 +491,14 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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);
@@ -496,20 +508,21 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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() ) {
@@ -539,9 +552,8 @@ void KOEventViewer::formatCategories(Incidence *event)
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}