summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-04-17 16:49:25 (UTC)
committer zautrix <zautrix>2005-04-17 16:49:25 (UTC)
commit70b45fe97813c4fd336b7ca8fdedab13f9c2e039 (patch) (unidiff)
tree37e89cf6cc411af8c646003fcfb0d5975f38272c /korganizer
parent02dc5d8173393d2069951a5f847db5bdf69137f6 (diff)
downloadkdepimpi-70b45fe97813c4fd336b7ca8fdedab13f9c2e039.zip
kdepimpi-70b45fe97813c4fd336b7ca8fdedab13f9c2e039.tar.gz
kdepimpi-70b45fe97813c4fd336b7ca8fdedab13f9c2e039.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp112
-rw-r--r--korganizer/kotodoview.cpp10
2 files changed, 68 insertions, 54 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f39b5e1..c8c2f28 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -278,6 +278,7 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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()));
@@ -331,8 +332,7 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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()) {
@@ -344,8 +344,12 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 {
@@ -353,8 +357,12 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 {
@@ -367,37 +375,39 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 ) {
@@ -417,6 +427,7 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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 {
@@ -469,9 +480,8 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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>")
@@ -480,14 +490,16 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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
@@ -495,22 +507,23 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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>"));
@@ -538,11 +551,10 @@ void 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)
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 0a608dc..25be63a 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -464,7 +464,10 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
464 464
465 465
466 466
467 mItemPopupMenu = new QPopupMenu(this); 467 mItemPopupMenu = new QPopupMenu(this);
468 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
469 SLOT (toggleRunningItem()));
470 mItemPopupMenu->insertSeparator();
468 mItemPopupMenu->insertItem(i18n("Show..."), this, 471 mItemPopupMenu->insertItem(i18n("Show..."), this,
469 SLOT (showTodo())); 472 SLOT (showTodo()));
470 mItemPopupMenu->insertItem(i18n("Edit..."), this, 473 mItemPopupMenu->insertItem(i18n("Edit..."), this,
@@ -480,11 +483,10 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
480 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 483 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
481 SLOT (cancelTodo())); 484 SLOT (cancelTodo()));
482 mItemPopupMenu->insertSeparator(); 485 mItemPopupMenu->insertSeparator();
483 486 /*
484 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
485 SLOT (toggleRunningItem()));
486 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 487 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
487 SLOT (newTodo())); 488 SLOT (newTodo()));
489 */
488 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 490 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
489 SLOT (newSubTodo())); 491 SLOT (newSubTodo()));
490 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 492 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,