summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp16
-rw-r--r--korganizer/koeventviewerdialog.cpp3
2 files changed, 18 insertions, 1 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 1fcc977..cee0466 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -267,214 +267,228 @@ void KOEventViewer::appendEvent(Event *event, int mode )
267 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") 267 mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
268 .arg(event->dtStartTimeStr()) 268 .arg(event->dtStartTimeStr())
269 .arg(event->dtEndTimeStr())); 269 .arg(event->dtEndTimeStr()));
270 } 270 }
271 } 271 }
272 272
273 if (event->recurrence()->doesRecur()) { 273 if (event->recurrence()->doesRecur()) {
274 274
275 QString recurText = event->recurrence()->recurrenceText(); 275 QString recurText = event->recurrence()->recurrenceText();
276 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); 276 addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
277 bool last; 277 bool last;
278 QDate start = QDate::currentDate(); 278 QDate start = QDate::currentDate();
279 QDate next; 279 QDate next;
280 next = event->recurrence()->getPreviousDate( start , &last ); 280 next = event->recurrence()->getPreviousDate( start , &last );
281 if ( !last ) { 281 if ( !last ) {
282 next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); 282 next = event->recurrence()->getNextDate( start.addDays( - 1 ) );
283 addTag("p",i18n("<b>Next recurrence is on:</b>") ); 283 addTag("p",i18n("<b>Next recurrence is on:</b>") );
284 addTag("p", KGlobal::locale()->formatDate( next, shortDate )); 284 addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
285 QDateTime nextdt = QDateTime( next, event->dtStart().time()); 285 QDateTime nextdt = QDateTime( next, event->dtStart().time());
286 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); 286 mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true );
287 287
288 } else { 288 } else {
289 addTag("p",i18n("<b>Last recurrence was on:</b>") ); 289 addTag("p",i18n("<b>Last recurrence was on:</b>") );
290 addTag("p", KGlobal::locale()->formatDate( next, shortDate )); 290 addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
291 } 291 }
292 } else { 292 } else {
293 mMailSubject += i18n(" - " )+event->dtStartStr( true ); 293 mMailSubject += i18n(" - " )+event->dtStartStr( true );
294 294
295 } 295 }
296 296
297 297
298 if (event->isAlarmEnabled()) { 298 if (event->isAlarmEnabled()) {
299 Alarm *alarm =event->alarms().first() ; 299 Alarm *alarm =event->alarms().first() ;
300 QDateTime t = alarm->time(); 300 QDateTime t = alarm->time();
301 int min = t.secsTo( event->dtStart() )/60; 301 int min = t.secsTo( event->dtStart() )/60;
302 QString s =i18n("( %1 min before )").arg( min ); 302 QString s =i18n("( %1 min before )").arg( min );
303 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 303 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
304 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 304 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
305 //addTag("p",s); 305 //addTag("p",s);
306 } 306 }
307 307
308 addTag("b",i18n("Access: ")); 308 addTag("b",i18n("Access: "));
309 mText.append(event->secrecyStr()+"<br>"); 309 mText.append(event->secrecyStr()+"<br>");
310 if (!event->description().isEmpty()) { 310 if (!event->description().isEmpty()) {
311 addTag("p",i18n("<b>Details: </b>")); 311 addTag("p",i18n("<b>Details: </b>"));
312 addTag("p",event->description()); 312 addTag("p",event->description());
313 } 313 }
314 314
315 formatCategories(event); 315 formatCategories(event);
316 316
317 formatReadOnly(event); 317 formatReadOnly(event);
318 formatAttendees(event); 318 formatAttendees(event);
319 319
320 setText(mText); 320 setText(mText);
321 //QWhatsThis::add(this,mText); 321 //QWhatsThis::add(this,mText);
322 322
323} 323}
324 324
325void KOEventViewer::appendTodo(Todo *event, int mode ) 325void KOEventViewer::appendTodo(Todo *event, int mode )
326{ 326{
327 mMailSubject = ""; 327 mMailSubject = "";
328 mCurrentIncidence = event; 328 mCurrentIncidence = event;
329 topLevelWidget()->setCaption(i18n("Todo Viewer")); 329 topLevelWidget()->setCaption(i18n("Todo Viewer"));
330 bool shortDate = KOPrefs::instance()->mShortDateInViewer; 330 bool shortDate = KOPrefs::instance()->mShortDateInViewer;
331 if (mode == 0 ) 331 if (mode == 0 )
332 addTag("h2",event->summary()); 332 addTag("h2",event->summary());
333 else { 333 else {
334 if ( mColorMode == 1 ) { 334 if ( mColorMode == 1 ) {
335 mText +="<font color=\"#00A000\">"; 335 mText +="<font color=\"#00A000\">";
336 } 336 }
337 if ( mColorMode == 2 ) { 337 if ( mColorMode == 2 ) {
338 mText +="<font color=\"#B00000\">"; 338 mText +="<font color=\"#B00000\">";
339 } 339 }
340 if ( mode == 1 ) { 340 if ( mode == 1 ) {
341 addTag("h2",i18n( "Local: " ) +event->summary()); 341 addTag("h2",i18n( "Local: " ) +event->summary());
342 } else { 342 } else {
343 addTag("h2",i18n( "Remote: " ) +event->summary()); 343 addTag("h2",i18n( "Remote: " ) +event->summary());
344 } 344 }
345 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 345 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
346 if ( mColorMode ) 346 if ( mColorMode )
347 mText += "</font>"; 347 mText += "</font>";
348 } 348 }
349 mMailSubject += i18n( "Todo " )+ event->summary(); 349 mMailSubject += i18n( "Todo " )+ event->summary();
350 if (event->cancelled ()) { 350 if (event->cancelled ()) {
351 mText +="<font color=\"#B00000\">"; 351 mText +="<font color=\"#B00000\">";
352 addTag("i",i18n("This todo has been cancelled!")); 352 addTag("i",i18n("This todo has been cancelled!"));
353 mText.append("<br>"); 353 mText.append("<br>");
354 mText += "</font>"; 354 mText += "</font>";
355 mMailSubject += i18n("(cancelled)"); 355 mMailSubject += i18n("(cancelled)");
356 } 356 }
357 357
358 if (!event->location().isEmpty()) { 358 if (!event->location().isEmpty()) {
359 addTag("b",i18n("Location: ")); 359 addTag("b",i18n("Location: "));
360 mText.append(event->location()+"<br>"); 360 mText.append(event->location()+"<br>");
361 mMailSubject += i18n(" at ") + event->location(); 361 mMailSubject += i18n(" at ") + event->location();
362 } 362 }
363 if (event->hasStartDate()) {
364 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
365 }
363 if (event->hasDueDate()) { 366 if (event->hasDueDate()) {
364 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 367 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
365 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 368 mMailSubject += i18n(" - " )+event->dtDueStr( true );
366 } 369 }
367 addTag("b",i18n("Access: ")); 370 addTag("b",i18n("Access: "));
368 mText.append(event->secrecyStr()+"<br>"); 371 mText.append(event->secrecyStr()+"<br>");
369 if (!event->description().isEmpty()) { 372 if (!event->description().isEmpty()) {
370 addTag("p",i18n("<b>Details: </b>")); 373 addTag("p",i18n("<b>Details: </b>"));
371 addTag("p",event->description()); 374 addTag("p",event->description());
372 } 375 }
373 376
374 formatCategories(event); 377 formatCategories(event);
375 378
376 mText.append(i18n("<p><b>Priority:</b> %2</p>") 379 mText.append(i18n("<p><b>Priority:</b> %2</p>")
377 .arg(QString::number(event->priority()))); 380 .arg(QString::number(event->priority())));
378 381
379 mText.append(i18n("<p><i>%1 % completed</i></p>") 382 mText.append(i18n("<p><i>%1 % completed</i></p>")
380 .arg(event->percentComplete())); 383 .arg(event->percentComplete()));
381 384
382 formatReadOnly(event); 385 formatReadOnly(event);
383 formatAttendees(event); 386 formatAttendees(event);
384 387 if ( event->relatedTo() ) {
388 addTag("b",i18n("Parent todo: "));
389 mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
390 }
391 QPtrList<Incidence> Relations = event->relations();
392 Incidence *to;
393 if ( Relations.first() )
394 addTag("b",i18n("Sub todos:<br>"));
395 for (to=Relations.first();to;to=Relations.next()) {
396 mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
397
398 }
385 setText(mText); 399 setText(mText);
386} 400}
387 401
388void KOEventViewer::formatCategories(Incidence *event) 402void KOEventViewer::formatCategories(Incidence *event)
389{ 403{
390 if (!event->categoriesStr().isEmpty()) { 404 if (!event->categoriesStr().isEmpty()) {
391 if (event->categories().count() == 1) { 405 if (event->categories().count() == 1) {
392 addTag("h3",i18n("Category")); 406 addTag("h3",i18n("Category"));
393 } else { 407 } else {
394 addTag("h3",i18n("Categories")); 408 addTag("h3",i18n("Categories"));
395 } 409 }
396 addTag("p",event->categoriesStr()); 410 addTag("p",event->categoriesStr());
397 } 411 }
398} 412}
399void KOEventViewer::formatAttendees(Incidence *event) 413void KOEventViewer::formatAttendees(Incidence *event)
400{ 414{
401 QPtrList<Attendee> attendees = event->attendees(); 415 QPtrList<Attendee> attendees = event->attendees();
402 if (attendees.count()) { 416 if (attendees.count()) {
403 417
404 418
405 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); 419 QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
406 addTag("h3",i18n("Organizer")); 420 addTag("h3",i18n("Organizer"));
407 mText.append("<ul><li>"); 421 mText.append("<ul><li>");
408#ifndef KORG_NOKABC 422#ifndef KORG_NOKABC
409 423
410#ifdef DESKTOP_VERSION 424#ifdef DESKTOP_VERSION
411 KABC::AddressBook *add_book = KABC::StdAddressBook::self(); 425 KABC::AddressBook *add_book = KABC::StdAddressBook::self();
412 KABC::Addressee::List addressList; 426 KABC::Addressee::List addressList;
413 addressList = add_book->findByEmail(event->organizer()); 427 addressList = add_book->findByEmail(event->organizer());
414 KABC::Addressee o = addressList.first(); 428 KABC::Addressee o = addressList.first();
415 if (!o.isEmpty() && addressList.size()<2) { 429 if (!o.isEmpty() && addressList.size()<2) {
416 mText += "<a href=\"uid:" + o.uid() + "\">"; 430 mText += "<a href=\"uid:" + o.uid() + "\">";
417 mText += o.formattedName(); 431 mText += o.formattedName();
418 mText += "</a>\n"; 432 mText += "</a>\n";
419 } else { 433 } else {
420 mText.append(event->organizer()); 434 mText.append(event->organizer());
421 } 435 }
422#else //DESKTOP_VERSION 436#else //DESKTOP_VERSION
423 mText += "<a href=\"uid:organizer\">"; 437 mText += "<a href=\"uid:organizer\">";
424 mText += event->organizer(); 438 mText += event->organizer();
425 mText += "</a>\n"; 439 mText += "</a>\n";
426#endif //DESKTOP_VERSION 440#endif //DESKTOP_VERSION
427 441
428 442
429#else 443#else
430 mText.append(event->organizer()); 444 mText.append(event->organizer());
431#endif 445#endif
432 446
433 if (iconPath) { 447 if (iconPath) {
434 mText += " <a href=\"mailto:" + event->organizer() + "\">"; 448 mText += " <a href=\"mailto:" + event->organizer() + "\">";
435 mText += "<IMG src=\"" + iconPath + "\">"; 449 mText += "<IMG src=\"" + iconPath + "\">";
436 mText += "</a>\n"; 450 mText += "</a>\n";
437 } 451 }
438 mText.append("</li></ul>"); 452 mText.append("</li></ul>");
439 453
440 addTag("h3",i18n("Attendees")); 454 addTag("h3",i18n("Attendees"));
441 Attendee *a; 455 Attendee *a;
442 mText.append("<ul>"); 456 mText.append("<ul>");
443 for(a=attendees.first();a;a=attendees.next()) { 457 for(a=attendees.first();a;a=attendees.next()) {
444#ifndef KORG_NOKABC 458#ifndef KORG_NOKABC
445#ifdef DESKTOP_VERSION 459#ifdef DESKTOP_VERSION
446 if (a->name().isEmpty()) { 460 if (a->name().isEmpty()) {
447 addressList = add_book->findByEmail(a->email()); 461 addressList = add_book->findByEmail(a->email());
448 KABC::Addressee o = addressList.first(); 462 KABC::Addressee o = addressList.first();
449 if (!o.isEmpty() && addressList.size()<2) { 463 if (!o.isEmpty() && addressList.size()<2) {
450 mText += "<a href=\"uid:" + o.uid() + "\">"; 464 mText += "<a href=\"uid:" + o.uid() + "\">";
451 mText += o.formattedName(); 465 mText += o.formattedName();
452 mText += "</a>\n"; 466 mText += "</a>\n";
453 } else { 467 } else {
454 mText += "<li>"; 468 mText += "<li>";
455 mText.append(a->email()); 469 mText.append(a->email());
456 mText += "\n"; 470 mText += "\n";
457 } 471 }
458 } else { 472 } else {
459 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 473 mText += "<li><a href=\"uid:" + a->uid() + "\">";
460 if (!a->name().isEmpty()) mText += a->name(); 474 if (!a->name().isEmpty()) mText += a->name();
461 else mText += a->email(); 475 else mText += a->email();
462 mText += "</a>\n"; 476 mText += "</a>\n";
463 } 477 }
464#else //DESKTOP_VERSION 478#else //DESKTOP_VERSION
465 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 479 mText += "<li><a href=\"uid:" + a->uid() + "\">";
466 if (!a->name().isEmpty()) mText += a->name(); 480 if (!a->name().isEmpty()) mText += a->name();
467 else mText += a->email(); 481 else mText += a->email();
468 mText += "</a>\n"; 482 mText += "</a>\n";
469#endif //DESKTOP_VERSION 483#endif //DESKTOP_VERSION
470#else 484#else
471 //qDebug("nokabc "); 485 //qDebug("nokabc ");
472 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 486 mText += "<li><a href=\"uid:" + a->uid() + "\">";
473 if (!a->name().isEmpty()) mText += a->name(); 487 if (!a->name().isEmpty()) mText += a->name();
474 else mText += a->email(); 488 else mText += a->email();
475 mText += "</a>\n"; 489 mText += "</a>\n";
476#endif 490#endif
477 491
478 492
479 if (!a->email().isEmpty()) { 493 if (!a->email().isEmpty()) {
480 if (iconPath) { 494 if (iconPath) {
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 772fd95..3979ed2 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -28,192 +28,195 @@
28#include "qapp.h" 28#include "qapp.h"
29 29
30#include "koeventviewerdialog.h" 30#include "koeventviewerdialog.h"
31extern int globalFlagBlockAgenda; 31extern int globalFlagBlockAgenda;
32 32
33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) 33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
34 : KDialogBase(parent,name, 34 : KDialogBase(parent,name,
35#ifndef DESKTOP_VERSION 35#ifndef DESKTOP_VERSION
36 true , 36 true ,
37#else 37#else
38 false, 38 false,
39#endif 39#endif
40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
41{ 41{
42 42
43 mEventViewer = new KOEventViewer(this); 43 mEventViewer = new KOEventViewer(this);
44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
45 setMainWidget(mEventViewer); 45 setMainWidget(mEventViewer);
46 setButtonText(Ok, i18n("Edit") ); 46 setButtonText(Ok, i18n("Edit") );
47 47
48 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 48 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
49 SLOT(editIncidence())); 49 SLOT(editIncidence()));
50 QObject::connect(this,SIGNAL(user1Clicked()), 50 QObject::connect(this,SIGNAL(user1Clicked()),
51 SLOT(showIncidence())); 51 SLOT(showIncidence()));
52 mIncidence = 0; 52 mIncidence = 0;
53 // TODO: Set a sensible size (based on the content?). 53 // TODO: Set a sensible size (based on the content?).
54 //showMaximized(); 54 //showMaximized();
55 //qDebug("++++++++++++KOEventViewerDialog() "); 55 //qDebug("++++++++++++KOEventViewerDialog() ");
56 // if ( KOPrefs::instance()->mCompactDialogs ) { 56 // if ( KOPrefs::instance()->mCompactDialogs ) {
57// setFixedSize( 240,284 ); 57// setFixedSize( 240,284 );
58// move( 0, 15 ); 58// move( 0, 15 );
59// } else { 59// } else {
60// setMinimumSize(300,200); 60// setMinimumSize(300,200);
61// resize(320,300); 61// resize(320,300);
62// } 62// }
63 mSyncMode = false; 63 mSyncMode = false;
64 mSyncResult = 0; 64 mSyncResult = 0;
65 65
66} 66}
67 67
68KOEventViewerDialog::~KOEventViewerDialog() 68KOEventViewerDialog::~KOEventViewerDialog()
69{ 69{
70 //qDebug("-------~KOEventViewerDialog() "); 70 //qDebug("-------~KOEventViewerDialog() ");
71} 71}
72void KOEventViewerDialog::showMe() 72void KOEventViewerDialog::showMe()
73{ 73{
74 74
75#ifdef DESKTOP_VERSION 75#ifdef DESKTOP_VERSION
76 show(); 76 show();
77#else 77#else
78 showMaximized(); 78 showMaximized();
79#endif 79#endif
80 setFocus(); 80 setFocus();
81 setActiveWindow(); 81 setActiveWindow();
82 82
83} 83}
84void KOEventViewerDialog::setSyncMode( bool b ) 84void KOEventViewerDialog::setSyncMode( bool b )
85{ 85{
86 mSyncMode = b; 86 mSyncMode = b;
87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
88 if ( mSyncMode ) { 88 if ( mSyncMode ) {
89 findButton( Close )->setText( i18n("Cancel Sync")); 89 findButton( Close )->setText( i18n("Cancel Sync"));
90 findButton( Ok )->setText( i18n("Remote")); 90 findButton( Ok )->setText( i18n("Remote"));
91 findButton( User1 )->setText( i18n("Local")); 91 findButton( User1 )->setText( i18n("Local"));
92 } else { 92 } else {
93 findButton( Close )->setText( i18n("Close")); 93 findButton( Close )->setText( i18n("Close"));
94 findButton( Ok )->setText( i18n("Edit")); 94 findButton( Ok )->setText( i18n("Edit"));
95 findButton( User1 )->setText( i18n("Agenda")); 95 findButton( User1 )->setText( i18n("Agenda"));
96 } 96 }
97 mEventViewer->setSyncMode( b ); 97 mEventViewer->setSyncMode( b );
98} 98}
99void KOEventViewerDialog::setColorMode( int m ) 99void KOEventViewerDialog::setColorMode( int m )
100{ 100{
101 mEventViewer->setColorMode( m ); 101 mEventViewer->setColorMode( m );
102} 102}
103int KOEventViewerDialog::executeS( bool local ) 103int KOEventViewerDialog::executeS( bool local )
104{ 104{
105 mSyncResult = 3; 105 mSyncResult = 3;
106 if ( local ) 106 if ( local )
107 findButton( User1 )->setFocus(); 107 findButton( User1 )->setFocus();
108 else 108 else
109 findButton( Ok )->setFocus(); 109 findButton( Ok )->setFocus();
110 exec(); 110 exec();
111 return mSyncResult; 111 return mSyncResult;
112} 112}
113 113
114void KOEventViewerDialog::updateConfig() 114void KOEventViewerDialog::updateConfig()
115{ 115{
116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
117 117
118} 118}
119void KOEventViewerDialog::setEvent(Event *event) 119void KOEventViewerDialog::setEvent(Event *event)
120{ 120{
121 mEventViewer->setEvent(event); 121 mEventViewer->setEvent(event);
122 mIncidence = event; 122 mIncidence = event;
123 findButton( Close )->setFocus(); 123 findButton( Close )->setFocus();
124 if ( !mSyncMode ) {
125 findButton( User1 )->setText( i18n("Agenda"));
126 }
124} 127}
125void KOEventViewerDialog::setIncidence(Incidence *in ) 128void KOEventViewerDialog::setIncidence(Incidence *in )
126{ 129{
127 if ( in->type() == "Event" ) 130 if ( in->type() == "Event" )
128 setEvent( (Event*) in ); 131 setEvent( (Event*) in );
129 else if ( in->type() =="Todo" ) 132 else if ( in->type() =="Todo" )
130 setTodo( (Todo*) in ); 133 setTodo( (Todo*) in );
131 else if ( in->type() =="Journal" ) 134 else if ( in->type() =="Journal" )
132 setJournal( (Journal*) in ); 135 setJournal( (Journal*) in );
133} 136}
134void KOEventViewerDialog::addIncidence(Incidence *in) 137void KOEventViewerDialog::addIncidence(Incidence *in)
135{ 138{
136 if ( in->type() == "Event" ) 139 if ( in->type() == "Event" )
137 addEvent( (Event*) in ); 140 addEvent( (Event*) in );
138 else if ( in->type() =="Todo" ) 141 else if ( in->type() =="Todo" )
139 mEventViewer->setTodo( (Todo*) in, false ); 142 mEventViewer->setTodo( (Todo*) in, false );
140 else if ( in->type() =="Journal" ) 143 else if ( in->type() =="Journal" )
141 mEventViewer->setJournal( (Journal*) in, false ); 144 mEventViewer->setJournal( (Journal*) in, false );
142 if ( mSyncMode ) { 145 if ( mSyncMode ) {
143 findButton( User1 )->setFocus(); 146 findButton( User1 )->setFocus();
144 setCaption(i18n("Conflict! Please choose entry")); 147 setCaption(i18n("Conflict! Please choose entry"));
145 } 148 }
146} 149}
147 150
148void KOEventViewerDialog::addEvent(Event *event) 151void KOEventViewerDialog::addEvent(Event *event)
149{ 152{
150 mEventViewer->addEvent(event); 153 mEventViewer->addEvent(event);
151 mIncidence = event; 154 mIncidence = event;
152 findButton( Close )->setFocus(); 155 findButton( Close )->setFocus();
153 if ( !mSyncMode ) { 156 if ( !mSyncMode ) {
154 findButton( User1 )->setText( i18n("Agenda")); 157 findButton( User1 )->setText( i18n("Agenda"));
155 } 158 }
156} 159}
157 160
158void KOEventViewerDialog::setTodo(Todo *event) 161void KOEventViewerDialog::setTodo(Todo *event)
159{ 162{
160 mEventViewer->setTodo(event); 163 mEventViewer->setTodo(event);
161 mIncidence = (Incidence*)event; 164 mIncidence = (Incidence*)event;
162 findButton( Close )->setFocus(); 165 findButton( Close )->setFocus();
163 if ( !mSyncMode ) { 166 if ( !mSyncMode ) {
164 findButton( User1 )->setText( i18n("Set complete")); 167 findButton( User1 )->setText( i18n("Set complete"));
165 } 168 }
166} 169}
167void KOEventViewerDialog::setJournal(Journal *j) 170void KOEventViewerDialog::setJournal(Journal *j)
168{ 171{
169 mEventViewer->setJournal(j); 172 mEventViewer->setJournal(j);
170 mIncidence = (Incidence*)j; 173 mIncidence = (Incidence*)j;
171 findButton( Close )->setFocus(); 174 findButton( Close )->setFocus();
172 if ( !mSyncMode ) { 175 if ( !mSyncMode ) {
173 findButton( User1 )->setText( i18n("Agenda")); 176 findButton( User1 )->setText( i18n("Agenda"));
174 } 177 }
175} 178}
176 179
177void KOEventViewerDialog::addText(QString text) 180void KOEventViewerDialog::addText(QString text)
178{ 181{
179 mEventViewer->addText(text); 182 mEventViewer->addText(text);
180 findButton( Close )->setFocus(); 183 findButton( Close )->setFocus();
181} 184}
182void KOEventViewerDialog::editIncidence() 185void KOEventViewerDialog::editIncidence()
183{ 186{
184 if ( mSyncMode ) { 187 if ( mSyncMode ) {
185 mSyncResult = 2; 188 mSyncResult = 2;
186 accept(); 189 accept();
187 return; 190 return;
188 } 191 }
189 if ( mIncidence ){ 192 if ( mIncidence ){
190#ifndef DESKTOP_VERSION 193#ifndef DESKTOP_VERSION
191 hide(); 194 hide();
192#endif 195#endif
193 emit editIncidence( mIncidence ); 196 emit editIncidence( mIncidence );
194 } 197 }
195} 198}
196void KOEventViewerDialog::showIncidence() 199void KOEventViewerDialog::showIncidence()
197{ 200{
198 201
199 if ( mSyncMode ) { 202 if ( mSyncMode ) {
200 mSyncResult = 1; 203 mSyncResult = 1;
201 accept(); 204 accept();
202 return; 205 return;
203 } 206 }
204 207
205 if ( mIncidence ){ 208 if ( mIncidence ){
206#ifndef DESKTOP_VERSION 209#ifndef DESKTOP_VERSION
207 hide(); 210 hide();
208#endif 211#endif
209 QDate date; 212 QDate date;
210 if ( mIncidence->type() == "Todo" ) { 213 if ( mIncidence->type() == "Todo" ) {
211 /* 214 /*
212 if ( ((Todo*)mIncidence)->hasDueDate() ) 215 if ( ((Todo*)mIncidence)->hasDueDate() )
213 date = ((Todo*)mIncidence)->dtDue().date(); 216 date = ((Todo*)mIncidence)->dtDue().date();
214 else { 217 else {
215 globalFlagBlockAgenda = 2; 218 globalFlagBlockAgenda = 2;
216 emit showAgendaView( false ); 219 emit showAgendaView( false );
217 return; 220 return;
218 } 221 }
219 */ 222 */