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
@@ -275,12 +275,13 @@ void KOEventViewer::setColorMode( int 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 ) {
@@ -328,79 +329,88 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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()));
@@ -414,12 +424,13 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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 }
@@ -466,54 +477,56 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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();
@@ -535,17 +548,16 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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()) {
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 0a608dc..25be63a 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -461,13 +461,16 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
461 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 461 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
462 } 462 }
463 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 463 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
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,
471 SLOT (editTodo())); 474 SLOT (editTodo()));
472 mItemPopupMenu->insertItem( i18n("Delete"), this, 475 mItemPopupMenu->insertItem( i18n("Delete"), this,
473 SLOT (deleteTodo())); 476 SLOT (deleteTodo()));
@@ -477,17 +480,16 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
477 SLOT (moveTodo())); 480 SLOT (moveTodo()));
478 mItemPopupMenu->insertItem( i18n("Beam..."), this, 481 mItemPopupMenu->insertItem( i18n("Beam..."), this,
479 SLOT (beamTodo())); 482 SLOT (beamTodo()));
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,
491 SLOT (unparentTodo()),0,21); 493 SLOT (unparentTodo()),0,21);
492 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 494 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
493 SLOT (reparentTodo()),0,22); 495 SLOT (reparentTodo()),0,22);