From 83256090c493dab56f1afba4829e864598bf70d2 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 04 Feb 2005 10:23:55 +0000 Subject: mail send --- (limited to 'korganizer/koeventviewer.cpp') 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) if ( n.left(6) == "mailto" ) { // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); #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 } @@ -174,7 +182,26 @@ void KOEventViewer::setSource(const QString& n) } #endif } +void KOEventViewer::mailToAttendees( bool all ) +{ + QPtrList 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) { int number=text.contains("\n"); @@ -462,6 +489,9 @@ void KOEventViewer::formatAttendees(Incidence *event) addTag("h3",i18n("Attendees")); Attendee *a; mText.append(""); + if ( a_count > 1 ) { + mText += ""; + mText += i18n( "Mail to all" ); + mText += " ( "; + mText += ""; + mText += i18n( " and " ); + mText += " )"; + mText += "
\n"; + + + } + if ( a_count_nr > 1 ) { + mText += ""; + mText += i18n( "Mail to selected" ); + mText += " ( "; + mText += i18n( " only )").arg ( iconPath ); + mText += "\n"; + } } } -- cgit v0.9.0.2