author | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
commit | 83256090c493dab56f1afba4829e864598bf70d2 (patch) (unidiff) | |
tree | 8d5b7ee0c6fe42f0f14c53b80c924ccddd5a1599 /korganizer | |
parent | a96872e5ecff3a8fb1785aff71f5f7f150ef8604 (diff) | |
download | kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.zip kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.gz kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.bz2 |
mail send
-rw-r--r-- | korganizer/koeventviewer.cpp | 56 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 3 |
2 files changed, 56 insertions, 3 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 7dc1880..bf41edb 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -127,6 +127,14 @@ void KOEventViewer::setSource(const QString& n) | |||
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 | ||
@@ -175,5 +183,24 @@ void KOEventViewer::setSource(const QString& n) | |||
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 | { |
@@ -463,4 +490,7 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
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 |
@@ -502,8 +532,12 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
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 | } |
@@ -515,4 +549,22 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
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 | ||
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 0cd3f33..cf44284 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h | |||
@@ -52,4 +52,5 @@ class KOEventViewer : public QTextBrowser { | |||
52 | void setSyncMode( bool ); | 52 | void setSyncMode( bool ); |
53 | void setColorMode( int ); | 53 | void setColorMode( int ); |
54 | void mailToAttendees( bool all ); | ||
54 | 55 | ||
55 | protected: | 56 | protected: |
@@ -67,5 +68,5 @@ class KOEventViewer : public QTextBrowser { | |||
67 | QString mText; | 68 | QString mText; |
68 | QString mMailSubject; | 69 | QString mMailSubject; |
69 | Incidence* mCurrentIncidence; | 70 | Incidence* mCurrentIncidence; |
70 | signals: | 71 | signals: |
71 | void launchaddressbook(QString uid); | 72 | void launchaddressbook(QString uid); |