author | zautrix <zautrix> | 2004-07-03 16:49:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-03 16:49:55 (UTC) |
commit | 1da48d95d970233f0d1ea9a7fba5c98cfcf24798 (patch) (unidiff) | |
tree | ae690b33cbe50291a610842e24de33f9d766f2f2 /korganizer/koeventviewer.cpp | |
parent | e3b89230f065c48c84b48c88edb6eb088374c487 (diff) | |
download | kdepimpi-1da48d95d970233f0d1ea9a7fba5c98cfcf24798.zip kdepimpi-1da48d95d970233f0d1ea9a7fba5c98cfcf24798.tar.gz kdepimpi-1da48d95d970233f0d1ea9a7fba5c98cfcf24798.tar.bz2 |
Alarm Bugfix. Added connection to KM. Cleaned up main.
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 | |||
@@ -51,4 +51,8 @@ | |||
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) |
@@ -64,32 +68,44 @@ KOEventViewer::~KOEventViewer() | |||
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 | ||
@@ -171,4 +187,5 @@ void KOEventViewer::setColorMode( int m ) | |||
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; |
@@ -194,4 +211,5 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
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\">"; |
@@ -199,8 +217,10 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
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()) { |
@@ -239,8 +259,14 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
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 | ||
@@ -275,4 +301,5 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
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")); |
@@ -296,4 +323,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
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\">"; |
@@ -301,4 +329,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
301 | mText.append("<br>"); | 329 | mText.append("<br>"); |
302 | mText += "</font>"; | 330 | mText += "</font>"; |
331 | mMailSubject += i18n("(cancelled)"); | ||
303 | } | 332 | } |
304 | 333 | ||
@@ -306,7 +335,9 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
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: ")); |
@@ -406,7 +437,8 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
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"; |