-rw-r--r-- | korganizer/koeventviewer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 92d2a80..c0acf34 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -134,97 +134,97 @@ void KOEventViewer::setSource(const QString& n) | |||
134 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 134 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
135 | QDialog dia( this,"dia123", true ); | 135 | QDialog dia( this,"dia123", true ); |
136 | dia.setCaption( i18n("Details of attendee") ); | 136 | dia.setCaption( i18n("Details of attendee") ); |
137 | QVBoxLayout lay ( &dia ); | 137 | QVBoxLayout lay ( &dia ); |
138 | KABC::AddresseeView av ( &dia ); | 138 | KABC::AddresseeView av ( &dia ); |
139 | av.setAddressee( (*it) ); | 139 | av.setAddressee( (*it) ); |
140 | lay.addWidget( &av ); | 140 | lay.addWidget( &av ); |
141 | if ( QApplication::desktop()->width() < 480 ) | 141 | if ( QApplication::desktop()->width() < 480 ) |
142 | dia.resize( 220, 240); | 142 | dia.resize( 220, 240); |
143 | else { | 143 | else { |
144 | dia.resize( 400,400); | 144 | dia.resize( 400,400); |
145 | } | 145 | } |
146 | dia.exec(); | 146 | dia.exec(); |
147 | break; | 147 | break; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | return; | 150 | return; |
151 | } | 151 | } |
152 | #else | 152 | #else |
153 | { | 153 | { |
154 | if ( "uid:organizer" == n ) { | 154 | if ( "uid:organizer" == n ) { |
155 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); | 155 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); |
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 158 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
159 | if (attendees.count()) { | 159 | if (attendees.count()) { |
160 | Attendee *a; | 160 | Attendee *a; |
161 | for(a=attendees.first();a;a=attendees.next()) { | 161 | for(a=attendees.first();a;a=attendees.next()) { |
162 | if ( "uid:"+a->uid() == n ) { | 162 | if ( "uid:"+a->uid() == n ) { |
163 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); | 163 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); |
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | } | 166 | } |
167 | } | 167 | } |
168 | return; | 168 | return; |
169 | } | 169 | } |
170 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 170 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
171 | // the result should now arrive through method insertAttendees | 171 | // the result should now arrive through method insertAttendees |
172 | //QString uid = "uid:"+(*it).uid(); | 172 | //QString uid = "uid:"+(*it).uid(); |
173 | #endif | 173 | #endif |
174 | if ( n.left(6) == "mailto" ) { | 174 | if ( n.left(6) == "mailto" ) { |
175 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 175 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
176 | //#ifndef DESKTOP_VERSION | 176 | //#ifndef DESKTOP_VERSION |
177 | if ( n.mid(7,3) == "ALL" ) { | 177 | if ( n.mid(7,3) == "ALL" ) { |
178 | mailToAttendees( true ); | 178 | mailToAttendees( true ); |
179 | } else if ( n.mid(7,4) == "RSVP" ) { | 179 | } else if ( n.mid(7,4) == "RSVP" ) { |
180 | mailToAttendees( false ); | 180 | mailToAttendees( false ); |
181 | } else { | 181 | } else { |
182 | ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); | 182 | ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); |
183 | //QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); | 183 | //QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
184 | //e << n.mid(7); | 184 | //e << n.mid(7); |
185 | } | 185 | } |
186 | //#endif | 186 | //#endif |
187 | 187 | ||
188 | } | 188 | } |
189 | 189 | ||
190 | 190 | ||
191 | #ifndef KORG_NODCOP | 191 | #ifndef KORG_NODCOP |
192 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; | 192 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; |
193 | QString tmpStr; | 193 | QString tmpStr; |
194 | if (n.startsWith("mailto:")) { | 194 | if (n.startsWith("mailto:")) { |
195 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); | 195 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); |
196 | //emit showIncidence(n); | 196 | //emit showIncidence(n); |
197 | return; | 197 | return; |
198 | } else if (n.startsWith("uid:")) { | 198 | } else if (n.startsWith("uid:")) { |
199 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 199 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
200 | const QByteArray noParamData; | 200 | const QByteArray noParamData; |
201 | const QByteArray paramData; | 201 | const QByteArray paramData; |
202 | QByteArray replyData; | 202 | QByteArray replyData; |
203 | QCString replyTypeStr; | 203 | QCString replyTypeStr; |
204 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 204 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
205 | bool foundAbbrowser = PING_ABBROWSER; | 205 | bool foundAbbrowser = PING_ABBROWSER; |
206 | 206 | ||
207 | if (foundAbbrowser) { | 207 | if (foundAbbrowser) { |
208 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 208 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
209 | //client->send("kaddressbook","KAddressBookIface", | 209 | //client->send("kaddressbook","KAddressBookIface", |
210 | QDataStream arg(paramData, IO_WriteOnly); | 210 | QDataStream arg(paramData, IO_WriteOnly); |
211 | arg << n.mid(6); | 211 | arg << n.mid(6); |
212 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 212 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
213 | return; | 213 | return; |
214 | } else { | 214 | } else { |
215 | /* | 215 | /* |
216 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. | 216 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. |
217 | We start it without its main interface | 217 | We start it without its main interface |
218 | */ | 218 | */ |
219 | KIconLoader* iconLoader = new KIconLoader(); | 219 | KIconLoader* iconLoader = new KIconLoader(); |
220 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); | 220 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); |
221 | ActionManager::setStartedKAddressBook(true); | 221 | ActionManager::setStartedKAddressBook(true); |
222 | tmpStr = "kaddressbook --editor-only --uid "; | 222 | tmpStr = "kaddressbook --editor-only --uid "; |
223 | tmpStr += KProcess::quote(n.mid(6)); | 223 | tmpStr += KProcess::quote(n.mid(6)); |
224 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); | 224 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); |
225 | return; | 225 | return; |
226 | } | 226 | } |
227 | } else { | 227 | } else { |
228 | //QTextBrowser::setSource(n); | 228 | //QTextBrowser::setSource(n); |
229 | } | 229 | } |
230 | #endif | 230 | #endif |
@@ -310,97 +310,97 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
310 | mText +="<font color=\"#C00000\">"; | 310 | mText +="<font color=\"#C00000\">"; |
311 | } | 311 | } |
312 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 312 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
313 | if ( mode == 1 ) { | 313 | if ( mode == 1 ) { |
314 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 314 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
315 | } else { | 315 | } else { |
316 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 316 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
317 | } | 317 | } |
318 | formatReadOnly(event); | 318 | formatReadOnly(event); |
319 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 319 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
320 | if ( mColorMode ) | 320 | if ( mColorMode ) |
321 | mText += "</font>"; | 321 | mText += "</font>"; |
322 | } | 322 | } |
323 | mMailSubject += i18n( "Meeting " )+ event->summary(); | 323 | mMailSubject += i18n( "Meeting " )+ event->summary(); |
324 | if (event->cancelled ()) { | 324 | if (event->cancelled ()) { |
325 | mText +="<font color=\"#B00000\">"; | 325 | mText +="<font color=\"#B00000\">"; |
326 | addTag("i",i18n("This event has been cancelled!")); | 326 | addTag("i",i18n("This event has been cancelled!")); |
327 | mText.append("<br>"); | 327 | mText.append("<br>"); |
328 | mText += "</font>"; | 328 | mText += "</font>"; |
329 | mMailSubject += i18n("(cancelled)"); | 329 | mMailSubject += i18n("(cancelled)"); |
330 | } | 330 | } |
331 | 331 | ||
332 | if (event->doesFloat()) { | 332 | if (event->doesFloat()) { |
333 | if (event->isMultiDay()) { | 333 | if (event->isMultiDay()) { |
334 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 334 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
335 | .arg(event->dtStartDateStr(shortDate)) | 335 | .arg(event->dtStartDateStr(shortDate)) |
336 | .arg(event->dtEndDateStr(shortDate))); | 336 | .arg(event->dtEndDateStr(shortDate))); |
337 | mText.append(i18n("<p><b>Duration:</b> %1 days</p>") | 337 | mText.append(i18n("<p><b>Duration:</b> %1 days</p>") |
338 | .arg(event->dtStart().daysTo(event->dtEnd())+1)); | 338 | .arg(event->dtStart().daysTo(event->dtEnd())+1)); |
339 | } else { | 339 | } else { |
340 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 340 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
341 | } | 341 | } |
342 | } else { | 342 | } else { |
343 | if (event->isMultiDay()) { | 343 | if (event->isMultiDay()) { |
344 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 344 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
345 | .arg(event->dtStartStr( shortDate))); | 345 | .arg(event->dtStartStr( shortDate))); |
346 | mText.append(i18n("<p><b>To:</b> %1</p>") | 346 | mText.append(i18n("<p><b>To:</b> %1</p>") |
347 | .arg(event->dtEndStr(shortDate))); | 347 | .arg(event->dtEndStr(shortDate))); |
348 | } else { | 348 | } else { |
349 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 349 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
350 | .arg(event->dtStartTimeStr()) | 350 | .arg(event->dtStartTimeStr()) |
351 | .arg(event->dtEndTimeStr())); | 351 | .arg(event->dtEndTimeStr())); |
352 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 352 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
353 | .arg(event->dtStartDateStr( shortDate ))); | 353 | .arg(event->dtStartDateStr( shortDate ))); |
354 | } | 354 | } |
355 | } | 355 | } |
356 | if (!event->location().isEmpty()) { | 356 | if (!event->location().isEmpty()) { |
357 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 357 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
358 | mMailSubject += i18n(" at ") + event->location(); | 358 | mMailSubject += " (" + i18n("Location: ") + event->location() + ")"; |
359 | } | 359 | } |
360 | if (event->doesRecur()) { | 360 | if (event->doesRecur()) { |
361 | 361 | ||
362 | QString recurText = event->recurrenceText(); | 362 | QString recurText = event->recurrenceText(); |
363 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 363 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
364 | bool ok; | 364 | bool ok; |
365 | QDate start = QDate::currentDate(); | 365 | QDate start = QDate::currentDate(); |
366 | QDateTime next; | 366 | QDateTime next; |
367 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 367 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
368 | if ( ok ) { | 368 | if ( ok ) { |
369 | if ( wideScreen ){ | 369 | if ( wideScreen ){ |
370 | addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); | 370 | addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); |
371 | } else { | 371 | } else { |
372 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 372 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
373 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 373 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
374 | } | 374 | } |
375 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); | 375 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
376 | 376 | ||
377 | } else { | 377 | } else { |
378 | bool last; | 378 | bool last; |
379 | QDate nextd; | 379 | QDate nextd; |
380 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 380 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
381 | if ( last ) { | 381 | if ( last ) { |
382 | if ( wideScreen ){ | 382 | if ( wideScreen ){ |
383 | addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); | 383 | addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); |
384 | } else{ | 384 | } else{ |
385 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 385 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
386 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 386 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
387 | } | 387 | } |
388 | } | 388 | } |
389 | } | 389 | } |
390 | } else { | 390 | } else { |
391 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 391 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
392 | 392 | ||
393 | } | 393 | } |
394 | 394 | ||
395 | 395 | ||
396 | if (event->isAlarmEnabled()) { | 396 | if (event->isAlarmEnabled()) { |
397 | Alarm *alarm =event->alarms().first() ; | 397 | Alarm *alarm =event->alarms().first() ; |
398 | QDateTime t = alarm->time(); | 398 | QDateTime t = alarm->time(); |
399 | 399 | ||
400 | if (event->doesRecur()) { | 400 | if (event->doesRecur()) { |
401 | bool ok = false; | 401 | bool ok = false; |
402 | int offset = 0; | 402 | int offset = 0; |
403 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | 403 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; |
404 | if ( ok ) { | 404 | if ( ok ) { |
405 | t = next; | 405 | t = next; |
406 | } | 406 | } |
@@ -469,103 +469,104 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
469 | } | 469 | } |
470 | else { | 470 | else { |
471 | if ( mColorMode == 1 ) { | 471 | if ( mColorMode == 1 ) { |
472 | mText +="<font color=\"#00A000\">"; | 472 | mText +="<font color=\"#00A000\">"; |
473 | } | 473 | } |
474 | if ( mColorMode == 2 ) { | 474 | if ( mColorMode == 2 ) { |
475 | mText +="<font color=\"#B00000\">"; | 475 | mText +="<font color=\"#B00000\">"; |
476 | } | 476 | } |
477 | if ( mode == 1 ) { | 477 | if ( mode == 1 ) { |
478 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 478 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
479 | } else { | 479 | } else { |
480 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 480 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
481 | } | 481 | } |
482 | formatReadOnly(event); | 482 | formatReadOnly(event); |
483 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 483 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
484 | if ( mColorMode ) | 484 | if ( mColorMode ) |
485 | mText += "</font>"; | 485 | mText += "</font>"; |
486 | } | 486 | } |
487 | mMailSubject += i18n( "Todo " )+ event->summary(); | 487 | mMailSubject += i18n( "Todo " )+ event->summary(); |
488 | 488 | ||
489 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 489 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
490 | mText +="<font color=\"#B00000\">"; | 490 | mText +="<font color=\"#B00000\">"; |
491 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 491 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
492 | mText += "</font>"; | 492 | mText += "</font>"; |
493 | } else { | 493 | } else { |
494 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 494 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
495 | .arg(event->percentComplete())); | 495 | .arg(event->percentComplete())); |
496 | } | 496 | } |
497 | 497 | ||
498 | if (event->cancelled ()) { | 498 | if (event->cancelled ()) { |
499 | mText +="<font color=\"#B00000\">"; | 499 | mText +="<font color=\"#B00000\">"; |
500 | addTag("i",i18n("This todo has been cancelled!")); | 500 | addTag("i",i18n("This todo has been cancelled!")); |
501 | mText.append("<br>"); | 501 | mText.append("<br>"); |
502 | mText += "</font>"; | 502 | mText += "</font>"; |
503 | mMailSubject += i18n("(cancelled)"); | 503 | mMailSubject += i18n("(cancelled)"); |
504 | } | 504 | } |
505 | 505 | ||
506 | 506 | ||
507 | 507 | ||
508 | if (event->doesRecur()) { | 508 | if (event->doesRecur()) { |
509 | 509 | ||
510 | QString recurText = event->recurrence()->recurrenceText(); | 510 | QString recurText = event->recurrence()->recurrenceText(); |
511 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 511 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
512 | 512 | ||
513 | } | 513 | } |
514 | if (event->hasStartDate()) { | 514 | if (event->hasStartDate()) { |
515 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 515 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
516 | } | 516 | } |
517 | if (!event->location().isEmpty()) { | ||
518 | mMailSubject += " (" + i18n("Location: ") + event->location() + ")"; | ||
519 | } | ||
517 | if (event->hasDueDate()) { | 520 | if (event->hasDueDate()) { |
518 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 521 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
519 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | ||
520 | } | 522 | } |
521 | if (!event->location().isEmpty()) { | 523 | if (!event->location().isEmpty()) { |
522 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 524 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
523 | mMailSubject += i18n(" at ") + event->location(); | ||
524 | } | 525 | } |
525 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 526 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
526 | .arg(QString::number(event->priority()))); | 527 | .arg(QString::number(event->priority()))); |
527 | 528 | ||
528 | if (event->isAlarmEnabled()) { | 529 | if (event->isAlarmEnabled()) { |
529 | Alarm *alarm =event->alarms().first() ; | 530 | Alarm *alarm =event->alarms().first() ; |
530 | QDateTime t = alarm->time(); | 531 | QDateTime t = alarm->time(); |
531 | if (event->doesRecur()) { | 532 | if (event->doesRecur()) { |
532 | bool ok = false; | 533 | bool ok = false; |
533 | int offset = 0; | 534 | int offset = 0; |
534 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; | 535 | QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ; |
535 | if ( ok ) { | 536 | if ( ok ) { |
536 | t = next; | 537 | t = next; |
537 | } | 538 | } |
538 | } | 539 | } |
539 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 540 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
540 | if ( wideScreen ) { | 541 | if ( wideScreen ) { |
541 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); | 542 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); |
542 | } else { | 543 | } else { |
543 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 544 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
544 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 545 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
545 | } | 546 | } |
546 | if ( !(event->alarmEnabled() ) ) { | 547 | if ( !(event->alarmEnabled() ) ) { |
547 | addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>"); | 548 | addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>"); |
548 | 549 | ||
549 | } | 550 | } |
550 | } | 551 | } |
551 | 552 | ||
552 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); | 553 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); |
553 | 554 | ||
554 | formatCategories(event); | 555 | formatCategories(event); |
555 | 556 | ||
556 | formatAttendees(event); | 557 | formatAttendees(event); |
557 | 558 | ||
558 | if ( KOPrefs::instance()->mEVshowCreated ) { | 559 | if ( KOPrefs::instance()->mEVshowCreated ) { |
559 | if(wideScreen ){ | 560 | if(wideScreen ){ |
560 | 561 | ||
561 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 562 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
562 | 563 | ||
563 | } else { | 564 | } else { |
564 | addTag("p",i18n("<b>Created: ") +" </b>"); | 565 | addTag("p",i18n("<b>Created: ") +" </b>"); |
565 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 566 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
566 | } | 567 | } |
567 | } | 568 | } |
568 | if ( KOPrefs::instance()->mEVshowChanged ) { | 569 | if ( KOPrefs::instance()->mEVshowChanged ) { |
569 | if(wideScreen ){ | 570 | if(wideScreen ){ |
570 | addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | 571 | addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); |
571 | 572 | ||