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
@@ -50,6 +50,10 @@
#include <kabc/stdaddressbook.h>
#define size count
#endif
+#ifndef DESKTOP_VERSION
+#include <qtopia/qcopenvelope_qws.h>
+#endif
+
KOEventViewer::KOEventViewer(QWidget *parent,const char *name)
: QTextBrowser(parent,name)
{
@@ -63,34 +67,46 @@ 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
+
+ }
#ifndef KORG_NODCOP
@@ -170,6 +186,7 @@ void KOEventViewer::setColorMode( int m )
}
void KOEventViewer::appendEvent(Event *event, int mode )
{
+ mMailSubject = "";
mCurrentIncidence = event;
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
topLevelWidget()->setCaption(i18n("Event Viewer"));
@@ -193,15 +210,18 @@ void KOEventViewer::appendEvent(Event *event, int mode )
if ( mColorMode )
mText += "</font>";
}
+ mMailSubject += i18n( "Meeting " )+ event->summary();
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This event has been cancelled!"));
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()) {
if (event->isMultiDay()) {
@@ -238,10 +258,16 @@ void KOEventViewer::appendEvent(Event *event, int mode )
next = event->recurrence()->getNextDate( start.addDays( - 1 ) );
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 );
+
}
@@ -274,6 +300,7 @@ void KOEventViewer::appendEvent(Event *event, int mode )
void KOEventViewer::appendTodo(Todo *event, int mode )
{
+ mMailSubject = "";
mCurrentIncidence = event;
topLevelWidget()->setCaption(i18n("Todo Viewer"));
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
@@ -295,19 +322,23 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
if ( mColorMode )
mText += "</font>";
}
+ mMailSubject += i18n( "Todo " )+ event->summary();
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This todo has been cancelled!"));
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->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: "));
mText.append(event->secrecyStr()+"<br>");
@@ -405,9 +436,10 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText += "</a>\n";
#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";
}