author | zautrix <zautrix> | 2004-07-03 16:49:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-03 16:49:55 (UTC) |
commit | 1da48d95d970233f0d1ea9a7fba5c98cfcf24798 (patch) (side-by-side diff) | |
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 @@ -52,2 +52,6 @@ #endif +#ifndef DESKTOP_VERSION +#include <qtopia/qcopenvelope_qws.h> +#endif + KOEventViewer::KOEventViewer(QWidget *parent,const char *name) @@ -65,30 +69,42 @@ void KOEventViewer::setSource(const QString& n) { - KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); - KABC::AddressBook::Iterator it; - for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { - // LR I do not understand, why the uid string is different on zaurus and desktop + + if ( n.left(3) == "uid" ) { + KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); + KABC::AddressBook::Iterator it; + for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { + // LR I do not understand, why the uid string is different on zaurus and desktop #ifdef DESKTOP_VERSION - QString uid = "uid://"+(*it).uid(); + QString uid = "uid://"+(*it).uid(); #else - QString uid = "uid:"+(*it).uid(); + QString uid = "uid:"+(*it).uid(); #endif - //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); - if (n == uid ) { - //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); - QDialog dia( this,"dia123", true ); - dia.setCaption( i18n("Details of attendee") ); - QVBoxLayout lay ( &dia ); - KPIM::AddresseeView av ( &dia ); - av.setAddressee( (*it) ); - lay.addWidget( &av ); - if ( QApplication::desktop()->width() < 480 ) - dia.resize( 220, 240); - else { - dia.resize( 400,400); + //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); + if (n == uid ) { + //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); + QDialog dia( this,"dia123", true ); + dia.setCaption( i18n("Details of attendee") ); + QVBoxLayout lay ( &dia ); + KPIM::AddresseeView av ( &dia ); + av.setAddressee( (*it) ); + lay.addWidget( &av ); + if ( QApplication::desktop()->width() < 480 ) + dia.resize( 220, 240); + else { + dia.resize( 400,400); + } + dia.exec(); + break; + } } - dia.exec(); - break; - } - } + return; + } + if ( n.left(6) == "mailto" ) { + // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); +#ifndef DESKTOP_VERSION + QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)" ); + e << n.mid(7); +#endif + + } @@ -172,2 +188,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) { + mMailSubject = ""; mCurrentIncidence = event; @@ -195,2 +212,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) } + mMailSubject += i18n( "Meeting " )+ event->summary(); if (event->cancelled ()) { @@ -200,2 +218,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) mText += "</font>"; + mMailSubject += i18n("(cancelled)"); } @@ -204,2 +223,3 @@ void KOEventViewer::appendEvent(Event *event, int mode ) mText.append(event->location()+"<br>"); + mMailSubject += i18n(" at ") + event->location(); } @@ -240,2 +260,5 @@ void KOEventViewer::appendEvent(Event *event, int mode ) addTag("p", KGlobal::locale()->formatDate( next, shortDate )); + QDateTime nextdt = QDateTime( next, event->dtStart().time()); + mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); + } else { @@ -244,2 +267,5 @@ void KOEventViewer::appendEvent(Event *event, int mode ) } + } else { + mMailSubject += i18n(" - " )+event->dtStartStr( true ); + } @@ -276,2 +302,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) { + mMailSubject = ""; mCurrentIncidence = event; @@ -297,2 +324,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) } + mMailSubject += i18n( "Todo " )+ event->summary(); if (event->cancelled ()) { @@ -302,2 +330,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) mText += "</font>"; + mMailSubject += i18n("(cancelled)"); } @@ -307,2 +336,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) mText.append(event->location()+"<br>"); + mMailSubject += i18n(" at ") + event->location(); } @@ -310,2 +340,3 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); + mMailSubject += i18n(" - " )+event->dtDueStr( true ); } @@ -407,5 +438,6 @@ void KOEventViewer::formatAttendees(Incidence *event) + if (!a->email().isEmpty()) { if (iconPath) { - mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; + mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; |