summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
authorzautrix <zautrix>2004-07-03 16:49:55 (UTC)
committer zautrix <zautrix>2004-07-03 16:49:55 (UTC)
commit1da48d95d970233f0d1ea9a7fba5c98cfcf24798 (patch) (side-by-side diff)
treeae690b33cbe50291a610842e24de33f9d766f2f2 /korganizer/koeventviewer.cpp
parente3b89230f065c48c84b48c88edb6eb088374c487 (diff)
downloadkdepimpi-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.cpp80
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 @@
#define size count
#endif
+#ifndef DESKTOP_VERSION
+#include <qtopia/qcopenvelope_qws.h>
+#endif
+
KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
: QTextBrowser(parent,name)
@@ -64,32 +68,44 @@ KOEventViewer::~KOEventViewer()
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
+
+ }
@@ -171,4 +187,5 @@ void KOEventViewer::setColorMode( int m )
void KOEventViewer::appendEvent(Event *event, int mode )
{
+ mMailSubject = "";
mCurrentIncidence = event;
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
@@ -194,4 +211,5 @@ void KOEventViewer::appendEvent(Event *event, int mode )
mText += "</font>";
}
+ mMailSubject += i18n( "Meeting " )+ event->summary();
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
@@ -199,8 +217,10 @@ void KOEventViewer::appendEvent(Event *event, int mode )
mText.append("<br>");
mText += "</font>";
+ mMailSubject += i18n("(cancelled)");
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
+ mMailSubject += i18n(" at ") + event->location();
}
if (event->doesFloat()) {
@@ -239,8 +259,14 @@ void KOEventViewer::appendEvent(Event *event, int mode )
addTag("p",i18n("<b>Next recurrence is on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
+ QDateTime nextdt = QDateTime( next, event->dtStart().time());
+ mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true );
+
} else {
addTag("p",i18n("<b>Last recurrence was on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next, shortDate ));
}
+ } else {
+ mMailSubject += i18n(" - " )+event->dtStartStr( true );
+
}
@@ -275,4 +301,5 @@ void KOEventViewer::appendEvent(Event *event, int mode )
void KOEventViewer::appendTodo(Todo *event, int mode )
{
+ mMailSubject = "";
mCurrentIncidence = event;
topLevelWidget()->setCaption(i18n("Todo Viewer"));
@@ -296,4 +323,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
mText += "</font>";
}
+ mMailSubject += i18n( "Todo " )+ event->summary();
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
@@ -301,4 +329,5 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
mText.append("<br>");
mText += "</font>";
+ mMailSubject += i18n("(cancelled)");
}
@@ -306,7 +335,9 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
+ mMailSubject += i18n(" at ") + event->location();
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
+ mMailSubject += i18n(" - " )+event->dtDueStr( true );
}
addTag("b",i18n("Access: "));
@@ -406,7 +437,8 @@ void KOEventViewer::formatAttendees(Incidence *event)
#endif
+
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 + "\">";
mText += "</a>\n";