Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewer.cpp | 80 |
1 files changed, 56 insertions, 24 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index bac66d3..1f69700 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -29,89 +29,105 @@ | |||
29 | #include <libkcal/event.h> | 29 | #include <libkcal/event.h> |
30 | #include <libkcal/todo.h> | 30 | #include <libkcal/todo.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
33 | #include <krun.h> | 33 | #include <krun.h> |
34 | #include <kglobal.h> | 34 | #include <kglobal.h> |
35 | #include <kprocess.h> | 35 | #include <kprocess.h> |
36 | #include "koprefs.h" | 36 | #include "koprefs.h" |
37 | 37 | ||
38 | #include <libkdepim/addresseeview.h> | 38 | #include <libkdepim/addresseeview.h> |
39 | #include <kabc/stdaddressbook.h> | 39 | #include <kabc/stdaddressbook.h> |
40 | 40 | ||
41 | #ifndef KORG_NODCOP | 41 | #ifndef KORG_NODCOP |
42 | #include <dcopclient.h> | 42 | #include <dcopclient.h> |
43 | #include "korganizer.h" | 43 | #include "korganizer.h" |
44 | #include "koprefs.h" | 44 | #include "koprefs.h" |
45 | #include "actionmanager.h" | 45 | #include "actionmanager.h" |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #include "koeventviewer.h" | 48 | #include "koeventviewer.h" |
49 | #ifndef KORG_NOKABC | 49 | #ifndef KORG_NOKABC |
50 | #include <kabc/stdaddressbook.h> | 50 | #include <kabc/stdaddressbook.h> |
51 | #define size count | 51 | #define size count |
52 | #endif | 52 | #endif |
53 | #ifndef DESKTOP_VERSION | ||
54 | #include <qtopia/qcopenvelope_qws.h> | ||
55 | #endif | ||
56 | |||
53 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) | 57 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) |
54 | : QTextBrowser(parent,name) | 58 | : QTextBrowser(parent,name) |
55 | { | 59 | { |
56 | mSyncMode = false; | 60 | mSyncMode = false; |
57 | mColorMode = 0; | 61 | mColorMode = 0; |
58 | } | 62 | } |
59 | 63 | ||
60 | KOEventViewer::~KOEventViewer() | 64 | KOEventViewer::~KOEventViewer() |
61 | { | 65 | { |
62 | } | 66 | } |
63 | 67 | ||
64 | void KOEventViewer::setSource(const QString& n) | 68 | void KOEventViewer::setSource(const QString& n) |
65 | { | 69 | { |
66 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 70 | |
67 | KABC::AddressBook::Iterator it; | 71 | if ( n.left(3) == "uid" ) { |
68 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 72 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
69 | // LR I do not understand, why the uid string is different on zaurus and desktop | 73 | KABC::AddressBook::Iterator it; |
74 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | ||
75 | // LR I do not understand, why the uid string is different on zaurus and desktop | ||
70 | #ifdef DESKTOP_VERSION | 76 | #ifdef DESKTOP_VERSION |
71 | QString uid = "uid://"+(*it).uid(); | 77 | QString uid = "uid://"+(*it).uid(); |
72 | #else | 78 | #else |
73 | QString uid = "uid:"+(*it).uid(); | 79 | QString uid = "uid:"+(*it).uid(); |
74 | #endif | 80 | #endif |
75 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 81 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
76 | if (n == uid ) { | 82 | if (n == uid ) { |
77 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 83 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
78 | QDialog dia( this,"dia123", true ); | 84 | QDialog dia( this,"dia123", true ); |
79 | dia.setCaption( i18n("Details of attendee") ); | 85 | dia.setCaption( i18n("Details of attendee") ); |
80 | QVBoxLayout lay ( &dia ); | 86 | QVBoxLayout lay ( &dia ); |
81 | KPIM::AddresseeView av ( &dia ); | 87 | KPIM::AddresseeView av ( &dia ); |
82 | av.setAddressee( (*it) ); | 88 | av.setAddressee( (*it) ); |
83 | lay.addWidget( &av ); | 89 | lay.addWidget( &av ); |
84 | if ( QApplication::desktop()->width() < 480 ) | 90 | if ( QApplication::desktop()->width() < 480 ) |
85 | dia.resize( 220, 240); | 91 | dia.resize( 220, 240); |
86 | else { | 92 | else { |
87 | dia.resize( 400,400); | 93 | dia.resize( 400,400); |
88 | 94 | ||
95 | } | ||
96 | dia.exec(); | ||
97 | break; | ||
98 | } | ||
89 | } | 99 | } |
90 | dia.exec(); | 100 | return; |
91 | break; | 101 | } |
92 | } | 102 | if ( n.left(6) == "mailto" ) { |
93 | } | 103 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
104 | #ifndef DESKTOP_VERSION | ||
105 | QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)" ); | ||
106 | e << n.mid(7); | ||
107 | #endif | ||
108 | |||
109 | } | ||
94 | 110 | ||
95 | 111 | ||
96 | #ifndef KORG_NODCOP | 112 | #ifndef KORG_NODCOP |
97 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; | 113 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; |
98 | QString tmpStr; | 114 | QString tmpStr; |
99 | if (n.startsWith("mailto:")) { | 115 | if (n.startsWith("mailto:")) { |
100 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); | 116 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); |
101 | //emit showIncidence(n); | 117 | //emit showIncidence(n); |
102 | return; | 118 | return; |
103 | } else if (n.startsWith("uid:")) { | 119 | } else if (n.startsWith("uid:")) { |
104 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 120 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
105 | const QByteArray noParamData; | 121 | const QByteArray noParamData; |
106 | const QByteArray paramData; | 122 | const QByteArray paramData; |
107 | QByteArray replyData; | 123 | QByteArray replyData; |
108 | QCString replyTypeStr; | 124 | QCString replyTypeStr; |
109 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 125 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
110 | bool foundAbbrowser = PING_ABBROWSER; | 126 | bool foundAbbrowser = PING_ABBROWSER; |
111 | 127 | ||
112 | if (foundAbbrowser) { | 128 | if (foundAbbrowser) { |
113 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 129 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
114 | //client->send("kaddressbook","KAddressBookIface", | 130 | //client->send("kaddressbook","KAddressBookIface", |
115 | QDataStream arg(paramData, IO_WriteOnly); | 131 | QDataStream arg(paramData, IO_WriteOnly); |
116 | arg << n.mid(6); | 132 | arg << n.mid(6); |
117 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 133 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
@@ -149,186 +165,201 @@ void KOEventViewer::addTag(const QString & tag,const QString & text) | |||
149 | for(int i=0;i<=number;i++) { | 165 | for(int i=0;i<=number;i++) { |
150 | pos=tmpText.find("\n"); | 166 | pos=tmpText.find("\n"); |
151 | tmp=tmpText.left(pos); | 167 | tmp=tmpText.left(pos); |
152 | tmpText=tmpText.right(tmpText.length()-pos-1); | 168 | tmpText=tmpText.right(tmpText.length()-pos-1); |
153 | tmpStr+=tmp+"<br>"; | 169 | tmpStr+=tmp+"<br>"; |
154 | } | 170 | } |
155 | } | 171 | } |
156 | else tmpStr += tmpText; | 172 | else tmpStr += tmpText; |
157 | tmpStr+="</" + tag + ">"; | 173 | tmpStr+="</" + tag + ">"; |
158 | mText.append(tmpStr); | 174 | mText.append(tmpStr); |
159 | } | 175 | } |
160 | else | 176 | else |
161 | { | 177 | { |
162 | str += text + "</" + tag + ">"; | 178 | str += text + "</" + tag + ">"; |
163 | mText.append(str); | 179 | mText.append(str); |
164 | } | 180 | } |
165 | } | 181 | } |
166 | 182 | ||
167 | void KOEventViewer::setColorMode( int m ) | 183 | void KOEventViewer::setColorMode( int m ) |
168 | { | 184 | { |
169 | mColorMode = m; | 185 | mColorMode = m; |
170 | } | 186 | } |
171 | void KOEventViewer::appendEvent(Event *event, int mode ) | 187 | void KOEventViewer::appendEvent(Event *event, int mode ) |
172 | { | 188 | { |
189 | mMailSubject = ""; | ||
173 | mCurrentIncidence = event; | 190 | mCurrentIncidence = event; |
174 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 191 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
175 | topLevelWidget()->setCaption(i18n("Event Viewer")); | 192 | topLevelWidget()->setCaption(i18n("Event Viewer")); |
176 | if ( mode == 0 ) { | 193 | if ( mode == 0 ) { |
177 | addTag("h2",event->summary()); | 194 | addTag("h2",event->summary()); |
178 | } | 195 | } |
179 | else { | 196 | else { |
180 | if ( mColorMode == 1 ) { | 197 | if ( mColorMode == 1 ) { |
181 | mText +="<font color=\"#00A000\">"; | 198 | mText +="<font color=\"#00A000\">"; |
182 | } | 199 | } |
183 | if ( mColorMode == 2 ) { | 200 | if ( mColorMode == 2 ) { |
184 | mText +="<font color=\"#C00000\">"; | 201 | mText +="<font color=\"#C00000\">"; |
185 | } | 202 | } |
186 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 203 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
187 | if ( mode == 1 ) { | 204 | if ( mode == 1 ) { |
188 | addTag("h2",i18n( "Local: " ) +event->summary()); | 205 | addTag("h2",i18n( "Local: " ) +event->summary()); |
189 | } else { | 206 | } else { |
190 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 207 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
191 | } | 208 | } |
192 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 209 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
193 | if ( mColorMode ) | 210 | if ( mColorMode ) |
194 | mText += "</font>"; | 211 | mText += "</font>"; |
195 | } | 212 | } |
213 | mMailSubject += i18n( "Meeting " )+ event->summary(); | ||
196 | if (event->cancelled ()) { | 214 | if (event->cancelled ()) { |
197 | mText +="<font color=\"#B00000\">"; | 215 | mText +="<font color=\"#B00000\">"; |
198 | addTag("i",i18n("This event has been cancelled!")); | 216 | addTag("i",i18n("This event has been cancelled!")); |
199 | mText.append("<br>"); | 217 | mText.append("<br>"); |
200 | mText += "</font>"; | 218 | mText += "</font>"; |
219 | mMailSubject += i18n("(cancelled)"); | ||
201 | } | 220 | } |
202 | if (!event->location().isEmpty()) { | 221 | if (!event->location().isEmpty()) { |
203 | addTag("b",i18n("Location: ")); | 222 | addTag("b",i18n("Location: ")); |
204 | mText.append(event->location()+"<br>"); | 223 | mText.append(event->location()+"<br>"); |
224 | mMailSubject += i18n(" at ") + event->location(); | ||
205 | } | 225 | } |
206 | if (event->doesFloat()) { | 226 | if (event->doesFloat()) { |
207 | if (event->isMultiDay()) { | 227 | if (event->isMultiDay()) { |
208 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 228 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
209 | .arg(event->dtStartDateStr(shortDate)) | 229 | .arg(event->dtStartDateStr(shortDate)) |
210 | .arg(event->dtEndDateStr(shortDate))); | 230 | .arg(event->dtEndDateStr(shortDate))); |
211 | } else { | 231 | } else { |
212 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 232 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
213 | } | 233 | } |
214 | } else { | 234 | } else { |
215 | if (event->isMultiDay()) { | 235 | if (event->isMultiDay()) { |
216 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 236 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
217 | .arg(event->dtStartStr( shortDate))); | 237 | .arg(event->dtStartStr( shortDate))); |
218 | mText.append(i18n("<p><b>To:</b> %1</p>") | 238 | mText.append(i18n("<p><b>To:</b> %1</p>") |
219 | .arg(event->dtEndStr(shortDate))); | 239 | .arg(event->dtEndStr(shortDate))); |
220 | } else { | 240 | } else { |
221 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 241 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
222 | .arg(event->dtStartDateStr( shortDate ))); | 242 | .arg(event->dtStartDateStr( shortDate ))); |
223 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 243 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
224 | .arg(event->dtStartTimeStr()) | 244 | .arg(event->dtStartTimeStr()) |
225 | .arg(event->dtEndTimeStr())); | 245 | .arg(event->dtEndTimeStr())); |
226 | } | 246 | } |
227 | } | 247 | } |
228 | 248 | ||
229 | if (event->recurrence()->doesRecur()) { | 249 | if (event->recurrence()->doesRecur()) { |
230 | 250 | ||
231 | QString recurText = event->recurrence()->recurrenceText(); | 251 | QString recurText = event->recurrence()->recurrenceText(); |
232 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 252 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
233 | bool last; | 253 | bool last; |
234 | QDate start = QDate::currentDate(); | 254 | QDate start = QDate::currentDate(); |
235 | QDate next; | 255 | QDate next; |
236 | next = event->recurrence()->getPreviousDate( start , &last ); | 256 | next = event->recurrence()->getPreviousDate( start , &last ); |
237 | if ( !last ) { | 257 | if ( !last ) { |
238 | next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); | 258 | next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); |
239 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 259 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
240 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | 260 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); |
261 | QDateTime nextdt = QDateTime( next, event->dtStart().time()); | ||
262 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); | ||
263 | |||
241 | } else { | 264 | } else { |
242 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 265 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
243 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | 266 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); |
244 | } | 267 | } |
268 | } else { | ||
269 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | ||
270 | |||
245 | } | 271 | } |
246 | 272 | ||
247 | 273 | ||
248 | if (event->isAlarmEnabled()) { | 274 | if (event->isAlarmEnabled()) { |
249 | Alarm *alarm =event->alarms().first() ; | 275 | Alarm *alarm =event->alarms().first() ; |
250 | QDateTime t = alarm->time(); | 276 | QDateTime t = alarm->time(); |
251 | int min = t.secsTo( event->dtStart() )/60; | 277 | int min = t.secsTo( event->dtStart() )/60; |
252 | QString s =i18n("( %1 min before )").arg( min ); | 278 | QString s =i18n("( %1 min before )").arg( min ); |
253 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 279 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
254 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 280 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
255 | //addTag("p",s); | 281 | //addTag("p",s); |
256 | } | 282 | } |
257 | 283 | ||
258 | addTag("b",i18n("Access: ")); | 284 | addTag("b",i18n("Access: ")); |
259 | mText.append(event->secrecyStr()+"<br>"); | 285 | mText.append(event->secrecyStr()+"<br>"); |
260 | if (!event->description().isEmpty()) { | 286 | if (!event->description().isEmpty()) { |
261 | addTag("p",i18n("<b>Details: </b>")); | 287 | addTag("p",i18n("<b>Details: </b>")); |
262 | addTag("p",event->description()); | 288 | addTag("p",event->description()); |
263 | } | 289 | } |
264 | 290 | ||
265 | formatCategories(event); | 291 | formatCategories(event); |
266 | 292 | ||
267 | formatReadOnly(event); | 293 | formatReadOnly(event); |
268 | formatAttendees(event); | 294 | formatAttendees(event); |
269 | 295 | ||
270 | setText(mText); | 296 | setText(mText); |
271 | //QWhatsThis::add(this,mText); | 297 | //QWhatsThis::add(this,mText); |
272 | 298 | ||
273 | } | 299 | } |
274 | 300 | ||
275 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 301 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
276 | { | 302 | { |
303 | mMailSubject = ""; | ||
277 | mCurrentIncidence = event; | 304 | mCurrentIncidence = event; |
278 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 305 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
279 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 306 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
280 | if (mode == 0 ) | 307 | if (mode == 0 ) |
281 | addTag("h2",event->summary()); | 308 | addTag("h2",event->summary()); |
282 | else { | 309 | else { |
283 | if ( mColorMode == 1 ) { | 310 | if ( mColorMode == 1 ) { |
284 | mText +="<font color=\"#00A000\">"; | 311 | mText +="<font color=\"#00A000\">"; |
285 | } | 312 | } |
286 | if ( mColorMode == 2 ) { | 313 | if ( mColorMode == 2 ) { |
287 | mText +="<font color=\"#B00000\">"; | 314 | mText +="<font color=\"#B00000\">"; |
288 | } | 315 | } |
289 | if ( mode == 1 ) { | 316 | if ( mode == 1 ) { |
290 | addTag("h2",i18n( "Local: " ) +event->summary()); | 317 | addTag("h2",i18n( "Local: " ) +event->summary()); |
291 | } else { | 318 | } else { |
292 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 319 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
293 | } | 320 | } |
294 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 321 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
295 | if ( mColorMode ) | 322 | if ( mColorMode ) |
296 | mText += "</font>"; | 323 | mText += "</font>"; |
297 | } | 324 | } |
325 | mMailSubject += i18n( "Todo " )+ event->summary(); | ||
298 | if (event->cancelled ()) { | 326 | if (event->cancelled ()) { |
299 | mText +="<font color=\"#B00000\">"; | 327 | mText +="<font color=\"#B00000\">"; |
300 | addTag("i",i18n("This todo has been cancelled!")); | 328 | addTag("i",i18n("This todo has been cancelled!")); |
301 | mText.append("<br>"); | 329 | mText.append("<br>"); |
302 | mText += "</font>"; | 330 | mText += "</font>"; |
331 | mMailSubject += i18n("(cancelled)"); | ||
303 | } | 332 | } |
304 | 333 | ||
305 | if (!event->location().isEmpty()) { | 334 | if (!event->location().isEmpty()) { |
306 | addTag("b",i18n("Location: ")); | 335 | addTag("b",i18n("Location: ")); |
307 | mText.append(event->location()+"<br>"); | 336 | mText.append(event->location()+"<br>"); |
337 | mMailSubject += i18n(" at ") + event->location(); | ||
308 | } | 338 | } |
309 | if (event->hasDueDate()) { | 339 | if (event->hasDueDate()) { |
310 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 340 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
341 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | ||
311 | } | 342 | } |
312 | addTag("b",i18n("Access: ")); | 343 | addTag("b",i18n("Access: ")); |
313 | mText.append(event->secrecyStr()+"<br>"); | 344 | mText.append(event->secrecyStr()+"<br>"); |
314 | if (!event->description().isEmpty()) { | 345 | if (!event->description().isEmpty()) { |
315 | addTag("p",i18n("<b>Details: </b>")); | 346 | addTag("p",i18n("<b>Details: </b>")); |
316 | addTag("p",event->description()); | 347 | addTag("p",event->description()); |
317 | } | 348 | } |
318 | 349 | ||
319 | formatCategories(event); | 350 | formatCategories(event); |
320 | 351 | ||
321 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 352 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
322 | .arg(QString::number(event->priority()))); | 353 | .arg(QString::number(event->priority()))); |
323 | 354 | ||
324 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 355 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
325 | .arg(event->percentComplete())); | 356 | .arg(event->percentComplete())); |
326 | 357 | ||
327 | formatReadOnly(event); | 358 | formatReadOnly(event); |
328 | formatAttendees(event); | 359 | formatAttendees(event); |
329 | 360 | ||
330 | setText(mText); | 361 | setText(mText); |
331 | } | 362 | } |
332 | 363 | ||
333 | void KOEventViewer::formatCategories(Incidence *event) | 364 | void KOEventViewer::formatCategories(Incidence *event) |
334 | { | 365 | { |
@@ -384,51 +415,52 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
384 | KABC::Addressee o = addressList.first(); | 415 | KABC::Addressee o = addressList.first(); |
385 | if (!o.isEmpty() && addressList.size()<2) { | 416 | if (!o.isEmpty() && addressList.size()<2) { |
386 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 417 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
387 | mText += o.formattedName(); | 418 | mText += o.formattedName(); |
388 | mText += "</a>\n"; | 419 | mText += "</a>\n"; |
389 | } else { | 420 | } else { |
390 | mText += "<li>"; | 421 | mText += "<li>"; |
391 | mText.append(a->email()); | 422 | mText.append(a->email()); |
392 | mText += "\n"; | 423 | mText += "\n"; |
393 | } | 424 | } |
394 | } else { | 425 | } else { |
395 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 426 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
396 | if (!a->name().isEmpty()) mText += a->name(); | 427 | if (!a->name().isEmpty()) mText += a->name(); |
397 | else mText += a->email(); | 428 | else mText += a->email(); |
398 | mText += "</a>\n"; | 429 | mText += "</a>\n"; |
399 | } | 430 | } |
400 | #else | 431 | #else |
401 | //qDebug("nokabc "); | 432 | //qDebug("nokabc "); |
402 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 433 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
403 | if (!a->name().isEmpty()) mText += a->name(); | 434 | if (!a->name().isEmpty()) mText += a->name(); |
404 | else mText += a->email(); | 435 | else mText += a->email(); |
405 | mText += "</a>\n"; | 436 | mText += "</a>\n"; |
406 | #endif | 437 | #endif |
407 | 438 | ||
439 | |||
408 | if (!a->email().isEmpty()) { | 440 | if (!a->email().isEmpty()) { |
409 | if (iconPath) { | 441 | if (iconPath) { |
410 | mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; | 442 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
411 | mText += "<IMG src=\"" + iconPath + "\">"; | 443 | mText += "<IMG src=\"" + iconPath + "\">"; |
412 | mText += "</a>\n"; | 444 | mText += "</a>\n"; |
413 | } | 445 | } |
414 | } | 446 | } |
415 | if (a->status() != Attendee::NeedsAction ) | 447 | if (a->status() != Attendee::NeedsAction ) |
416 | mText +="[" + a->statusStr() + "] "; | 448 | mText +="[" + a->statusStr() + "] "; |
417 | if (a->role() == Attendee::Chair ) | 449 | if (a->role() == Attendee::Chair ) |
418 | mText +="(" + a->roleStr().left(1) + ".)"; | 450 | mText +="(" + a->roleStr().left(1) + ".)"; |
419 | } | 451 | } |
420 | mText.append("</li></ul>"); | 452 | mText.append("</li></ul>"); |
421 | } | 453 | } |
422 | 454 | ||
423 | } | 455 | } |
424 | void KOEventViewer::appendJournal(Journal *jour, int mode ) | 456 | void KOEventViewer::appendJournal(Journal *jour, int mode ) |
425 | { | 457 | { |
426 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 458 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
427 | if (mode == 0 ) | 459 | if (mode == 0 ) |
428 | addTag("h2",i18n("Journal from: ")); | 460 | addTag("h2",i18n("Journal from: ")); |
429 | else { | 461 | else { |
430 | if ( mode == 1 ) { | 462 | if ( mode == 1 ) { |
431 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); | 463 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); |
432 | } else { | 464 | } else { |
433 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); | 465 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); |
434 | } | 466 | } |