Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewer.cpp | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 7dc1880..bf41edb 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -126,8 +126,16 @@ void KOEventViewer::setSource(const QString& n) | |||
126 | if ( n.left(6) == "mailto" ) { | 126 | if ( n.left(6) == "mailto" ) { |
127 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 127 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
128 | #ifndef DESKTOP_VERSION | 128 | #ifndef DESKTOP_VERSION |
129 | if ( n.mid(7,3) == "ALL" ) { | ||
130 | qDebug("all "); | ||
131 | mailToAttendees( true ); | ||
132 | } else if ( n.mid(7,4) == "RSVP" ) { | ||
133 | mailToAttendees( false ); | ||
134 | qDebug("rsvp "); | ||
135 | } else { | ||
129 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); | 136 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
130 | e << n.mid(7); | 137 | e << n.mid(7); |
138 | } | ||
131 | #endif | 139 | #endif |
132 | 140 | ||
133 | } | 141 | } |
@@ -174,7 +182,26 @@ void KOEventViewer::setSource(const QString& n) | |||
174 | } | 182 | } |
175 | #endif | 183 | #endif |
176 | } | 184 | } |
185 | void KOEventViewer::mailToAttendees( bool all ) | ||
186 | { | ||
187 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | ||
188 | if (attendees.count() == 0) return; | ||
189 | QStringList nameList; | ||
190 | QStringList emailList; | ||
191 | QStringList uidList; | ||
192 | Attendee* a; | ||
193 | for(a=attendees.first();a;a=attendees.next()) { | ||
194 | if ( !all && !a->RSVP() ) continue; | ||
195 | if (!a->email().isEmpty()) { | ||
196 | nameList.append (a->name() ); | ||
197 | emailList.append (a->email() ); | ||
198 | uidList.append (a->uid() ); | ||
199 | } | ||
200 | } | ||
201 | QString uid = "ComposeMailUIpick2"+mMailSubject; | ||
202 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | ||
177 | 203 | ||
204 | } | ||
178 | void KOEventViewer::addTag(const QString & tag,const QString & text) | 205 | void KOEventViewer::addTag(const QString & tag,const QString & text) |
179 | { | 206 | { |
180 | int number=text.contains("\n"); | 207 | int number=text.contains("\n"); |
@@ -462,6 +489,9 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
462 | addTag("h3",i18n("Attendees")); | 489 | addTag("h3",i18n("Attendees")); |
463 | Attendee *a; | 490 | Attendee *a; |
464 | mText.append("<ul>"); | 491 | mText.append("<ul>"); |
492 | int a_count = 0; | ||
493 | int a_count_nr = 0; | ||
494 | |||
465 | for(a=attendees.first();a;a=attendees.next()) { | 495 | for(a=attendees.first();a;a=attendees.next()) { |
466 | #ifndef KORG_NOKABC | 496 | #ifndef KORG_NOKABC |
467 | #ifdef DESKTOP_VERSION | 497 | #ifdef DESKTOP_VERSION |
@@ -501,10 +531,14 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
501 | if (!a->email().isEmpty()) { | 531 | if (!a->email().isEmpty()) { |
502 | if (iconPath) { | 532 | if (iconPath) { |
503 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; | 533 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
504 | if ( a->RSVP() ) | 534 | if ( a->RSVP() ) { |
535 | ++a_count; | ||
505 | mText += "<IMG src=\"" + iconPath + "\">"; | 536 | mText += "<IMG src=\"" + iconPath + "\">"; |
506 | else | 537 | } |
538 | else { | ||
539 | ++a_count_nr; | ||
507 | mText += "<IMG src=\"" + NOiconPath + "\">"; | 540 | mText += "<IMG src=\"" + NOiconPath + "\">"; |
541 | } | ||
508 | mText += "</a>\n"; | 542 | mText += "</a>\n"; |
509 | } | 543 | } |
510 | } | 544 | } |
@@ -514,6 +548,24 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
514 | mText +="(" + a->roleStr().left(1) + ".)"; | 548 | mText +="(" + a->roleStr().left(1) + ".)"; |
515 | } | 549 | } |
516 | mText.append("</li></ul>"); | 550 | mText.append("</li></ul>"); |
551 | if ( a_count > 1 ) { | ||
552 | mText += "<a href=\"mailto:ALL\">"; | ||
553 | mText += i18n( "Mail to all" ); | ||
554 | mText += "</a> ( "; | ||
555 | mText += "<IMG src=\"" + iconPath + "\">"; | ||
556 | mText += i18n( " and " ); | ||
557 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; | ||
558 | mText += "<br>\n"; | ||
559 | |||
560 | |||
561 | } | ||
562 | if ( a_count_nr > 1 ) { | ||
563 | mText += "<a href=\"mailto:RSVP\">"; | ||
564 | mText += i18n( "Mail to selected" ); | ||
565 | mText += "</a> ( "; | ||
566 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); | ||
567 | mText += "\n"; | ||
568 | } | ||
517 | } | 569 | } |
518 | 570 | ||
519 | } | 571 | } |