summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 976ee2c..02b54da 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -48,27 +48,27 @@
48//#ifndef KORG_NOKABC 48//#ifndef KORG_NOKABC
49//#include <kabc/stdaddressbook.h> 49//#include <kabc/stdaddressbook.h>
50//#define size count 50//#define size count
51//#endif 51//#endif
52 52
53#ifdef DESKTOP_VERSION 53#ifdef DESKTOP_VERSION
54#include <kabc/addresseedialog.h> 54#include <kabc/addresseedialog.h>
55#include <kabc/addresseeview.h> 55#include <kabc/addresseeview.h>
56#include <qprinter.h> 56#include <qprinter.h>
57#include <qpainter.h> 57#include <qpainter.h>
58#include <qpaintdevicemetrics.h> 58#include <qpaintdevicemetrics.h>
59#else //DESKTOP_VERSION 59#else //DESKTOP_VERSION
60#include <externalapphandler.h>
61#include <qtopia/qcopenvelope_qws.h> 60#include <qtopia/qcopenvelope_qws.h>
62#endif //DESKTOP_VERSION 61#endif //DESKTOP_VERSION
62#include <externalapphandler.h>
63 63
64KOEventViewer::KOEventViewer(QWidget *parent,const char *name) 64KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
65 : QTextBrowser(parent,name) 65 : QTextBrowser(parent,name)
66{ 66{
67 mSyncMode = false; 67 mSyncMode = false;
68 mColorMode = 0; 68 mColorMode = 0;
69} 69}
70 70
71KOEventViewer::~KOEventViewer() 71KOEventViewer::~KOEventViewer()
72{ 72{
73} 73}
74 74
@@ -164,34 +164,35 @@ void KOEventViewer::setSource(const QString& n)
164 return; 164 return;
165 } 165 }
166 } 166 }
167 } 167 }
168 return; 168 return;
169 } 169 }
170 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 170 //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
171 // the result should now arrive through method insertAttendees 171 // the result should now arrive through method insertAttendees
172 //QString uid = "uid:"+(*it).uid(); 172 //QString uid = "uid:"+(*it).uid();
173#endif 173#endif
174 if ( n.left(6) == "mailto" ) { 174 if ( n.left(6) == "mailto" ) {
175 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); 175 // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1());
176#ifndef DESKTOP_VERSION 176 //#ifndef DESKTOP_VERSION
177 if ( n.mid(7,3) == "ALL" ) { 177 if ( n.mid(7,3) == "ALL" ) {
178 mailToAttendees( true ); 178 mailToAttendees( true );
179 } else if ( n.mid(7,4) == "RSVP" ) { 179 } else if ( n.mid(7,4) == "RSVP" ) {
180 mailToAttendees( false ); 180 mailToAttendees( false );
181 } else { 181 } else {
182 QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); 182 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
183 e << n.mid(7); 183 //QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" );
184 //e << n.mid(7);
184 } 185 }
185#endif 186 //#endif
186 187
187 } 188 }
188 189
189 190
190#ifndef KORG_NODCOP 191#ifndef KORG_NODCOP
191 kdDebug() << "KOEventViewer::setSource(): " << n << endl; 192 kdDebug() << "KOEventViewer::setSource(): " << n << endl;
192 QString tmpStr; 193 QString tmpStr;
193 if (n.startsWith("mailto:")) { 194 if (n.startsWith("mailto:")) {
194 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); 195 KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
195 //emit showIncidence(n); 196 //emit showIncidence(n);
196 return; 197 return;
197 } else if (n.startsWith("uid:")) { 198 } else if (n.startsWith("uid:")) {
@@ -230,32 +231,39 @@ void KOEventViewer::setSource(const QString& n)
230} 231}
231void KOEventViewer::mailToAttendees( bool all ) 232void KOEventViewer::mailToAttendees( bool all )
232{ 233{
233 QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); 234 QPtrList<Attendee> attendees = mCurrentIncidence->attendees();
234 if (attendees.count() == 0) return; 235 if (attendees.count() == 0) return;
235 QStringList nameList; 236 QStringList nameList;
236 QStringList emailList; 237 QStringList emailList;
237 QStringList uidList; 238 QStringList uidList;
238 Attendee* a; 239 Attendee* a;
239 for(a=attendees.first();a;a=attendees.next()) { 240 for(a=attendees.first();a;a=attendees.next()) {
240 if ( !all && !a->RSVP() ) continue; 241 if ( !all && !a->RSVP() ) continue;
241 if (!a->email().isEmpty()) { 242 if (!a->email().isEmpty()) {
242 nameList.append (a->name() ); 243#ifndef DESKTOP_VERSION
244 nameList.append (a->realName() );
243 emailList.append (a->email() ); 245 emailList.append (a->email() );
244 uidList.append (a->uid() ); 246 uidList.append (a->uid() );
247#else
248 emailList.append(a->realName() +" <" + a->email() +">");
249#endif
245 } 250 }
246 } 251 }
247 QString uid = "ComposeMailUIpick2"+mMailSubject;
248#ifndef DESKTOP_VERSION 252#ifndef DESKTOP_VERSION
253 QString uid = "ComposeMailUIpick2"+mMailSubject;
249 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 254 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
255
256#else
257 ExternalAppHandler::instance()->mailToMultipleContacts( emailList.join(","), mMailSubject );
250#endif 258#endif
251 259
252} 260}
253void KOEventViewer::addTag(const QString & tag,const QString & text) 261void KOEventViewer::addTag(const QString & tag,const QString & text)
254{ 262{
255 int number=text.contains("\n"); 263 int number=text.contains("\n");
256 QString str = "<" + tag + ">"; 264 QString str = "<" + tag + ">";
257 QString tmpText=text; 265 QString tmpText=text;
258 QString tmpStr=str; 266 QString tmpStr=str;
259 if(number !=-1) 267 if(number !=-1)
260 { 268 {
261 if (number > 0) { 269 if (number > 0) {
@@ -661,25 +669,25 @@ void KOEventViewer::formatAttendees(Incidence *event)
661#endif //DESKTOP_VERSION 669#endif //DESKTOP_VERSION
662#else 670#else
663 //qDebug("nokabc "); 671 //qDebug("nokabc ");
664 mText += "<li><a href=\"uid:" + a->uid() + "\">"; 672 mText += "<li><a href=\"uid:" + a->uid() + "\">";
665 if (!a->name().isEmpty()) mText += a->name(); 673 if (!a->name().isEmpty()) mText += a->name();
666 else mText += a->email(); 674 else mText += a->email();
667 mText += "</a>\n"; 675 mText += "</a>\n";
668#endif 676#endif
669 677
670 678
671 if (!a->email().isEmpty()) { 679 if (!a->email().isEmpty()) {
672 if (iconPath) { 680 if (iconPath) {
673 mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; 681 mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">";
674 if ( a->RSVP() ) { 682 if ( a->RSVP() ) {
675 ++a_count_nr; 683 ++a_count_nr;
676 mText += "<IMG src=\"" + iconPath + "\">"; 684 mText += "<IMG src=\"" + iconPath + "\">";
677 } 685 }
678 else { 686 else {
679 ++a_count; 687 ++a_count;
680 mText += "<IMG src=\"" + NOiconPath + "\">"; 688 mText += "<IMG src=\"" + NOiconPath + "\">";
681 } 689 }
682 mText += "</a>\n"; 690 mText += "</a>\n";
683 } 691 }
684 } 692 }
685 if (a->status() != Attendee::NeedsAction ) 693 if (a->status() != Attendee::NeedsAction )