summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-02-04 10:23:55 (UTC)
committer zautrix <zautrix>2005-02-04 10:23:55 (UTC)
commit83256090c493dab56f1afba4829e864598bf70d2 (patch) (unidiff)
tree8d5b7ee0c6fe42f0f14c53b80c924ccddd5a1599 /korganizer
parenta96872e5ecff3a8fb1785aff71f5f7f150ef8604 (diff)
downloadkdepimpi-83256090c493dab56f1afba4829e864598bf70d2.zip
kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.gz
kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.bz2
mail send
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp56
-rw-r--r--korganizer/koeventviewer.h3
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
@@ -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}
185void 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}
178void KOEventViewer::addTag(const QString & tag,const QString & text) 205void 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}
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 0cd3f33..cf44284 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -51,6 +51,7 @@ class KOEventViewer : public QTextBrowser {
51 void addText(QString text); 51 void addText(QString text);
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:
56 int mColorMode; 57 int mColorMode;
@@ -66,7 +67,7 @@ class KOEventViewer : public QTextBrowser {
66 67
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);
72}; 73};