author | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
commit | 83256090c493dab56f1afba4829e864598bf70d2 (patch) (side-by-side diff) | |
tree | 8d5b7ee0c6fe42f0f14c53b80c924ccddd5a1599 /korganizer/koeventviewer.cpp | |
parent | a96872e5ecff3a8fb1785aff71f5f7f150ef8604 (diff) | |
download | kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.zip kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.gz kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.bz2 |
mail send
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 @@ -128,4 +128,12 @@ void KOEventViewer::setSource(const QString& n) #ifndef DESKTOP_VERSION + if ( n.mid(7,3) == "ALL" ) { + qDebug("all "); + mailToAttendees( true ); + } else if ( n.mid(7,4) == "RSVP" ) { + mailToAttendees( false ); + qDebug("rsvp "); + } else { QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); e << n.mid(7); + } #endif @@ -176,3 +184,22 @@ void KOEventViewer::setSource(const QString& n) } +void KOEventViewer::mailToAttendees( bool all ) +{ + QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + if (attendees.count() == 0) return; + QStringList nameList; + QStringList emailList; + QStringList uidList; + Attendee* a; + for(a=attendees.first();a;a=attendees.next()) { + if ( !all && !a->RSVP() ) continue; + if (!a->email().isEmpty()) { + nameList.append (a->name() ); + emailList.append (a->email() ); + uidList.append (a->uid() ); + } + } + QString uid = "ComposeMailUIpick2"+mMailSubject; + bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); +} void KOEventViewer::addTag(const QString & tag,const QString & text) @@ -464,2 +491,5 @@ void KOEventViewer::formatAttendees(Incidence *event) mText.append("<ul>"); + int a_count = 0; + int a_count_nr = 0; + for(a=attendees.first();a;a=attendees.next()) { @@ -503,6 +533,10 @@ void KOEventViewer::formatAttendees(Incidence *event) mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; - if ( a->RSVP() ) + if ( a->RSVP() ) { + ++a_count; mText += "<IMG src=\"" + iconPath + "\">"; - else + } + else { + ++a_count_nr; mText += "<IMG src=\"" + NOiconPath + "\">"; + } mText += "</a>\n"; @@ -516,2 +550,20 @@ void KOEventViewer::formatAttendees(Incidence *event) mText.append("</li></ul>"); + if ( a_count > 1 ) { + mText += "<a href=\"mailto:ALL\">"; + mText += i18n( "Mail to all" ); + mText += "</a> ( "; + mText += "<IMG src=\"" + iconPath + "\">"; + mText += i18n( " and " ); + mText += "<IMG src=\"" + NOiconPath + "\"> )"; + mText += "<br>\n"; + + + } + if ( a_count_nr > 1 ) { + mText += "<a href=\"mailto:RSVP\">"; + mText += i18n( "Mail to selected" ); + mText += "</a> ( "; + mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); + mText += "\n"; + } } |