-rw-r--r-- | korganizer/koeventviewer.cpp | 50 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
2 files changed, 44 insertions, 8 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 1f69700..0866939 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -47,15 +47,19 @@ #include "koeventviewer.h" #ifndef KORG_NOKABC #include <kabc/stdaddressbook.h> #define size count #endif -#ifndef DESKTOP_VERSION + +#ifdef DESKTOP_VERSION +#include <kabc/addresseedialog.h> +#else //DESKTOP_VERSION +#include <externalapphandler.h> #include <qtopia/qcopenvelope_qws.h> -#endif +#endif //DESKTOP_VERSION KOEventViewer::KOEventViewer(QWidget *parent,const char *name) : QTextBrowser(parent,name) { mSyncMode = false; mColorMode = 0; @@ -65,22 +69,21 @@ KOEventViewer::~KOEventViewer() { } void KOEventViewer::setSource(const QString& n) { - if ( n.left(3) == "uid" ) { + if ( n.left(3) == "uid" ) +#ifdef DESKTOP_VERSION + { 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(); -#else - 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 ); @@ -96,16 +99,34 @@ void KOEventViewer::setSource(const QString& n) dia.exec(); break; } } return; } +#else + { + QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + if (attendees.count()) { + Attendee *a; + for(a=attendees.first();a;a=attendees.next()) { + if ( "uid:"+a->uid() == n ) { + bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), ""); + return; + } + } + } + return; + } + //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); + // the result should now arrive through method insertAttendees + //QString uid = "uid:"+(*it).uid(); +#endif if ( n.left(6) == "mailto" ) { // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); #ifndef DESKTOP_VERSION - QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)" ); + QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); e << n.mid(7); #endif } @@ -380,23 +401,29 @@ void KOEventViewer::formatAttendees(Incidence *event) QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); addTag("h3",i18n("Organizer")); mText.append("<ul><li>"); #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION KABC::AddressBook *add_book = KABC::StdAddressBook::self(); KABC::Addressee::List addressList; addressList = add_book->findByEmail(event->organizer()); KABC::Addressee o = addressList.first(); if (!o.isEmpty() && addressList.size()<2) { mText += "<a href=\"uid:" + o.uid() + "\">"; mText += o.formattedName(); mText += "</a>\n"; } else { mText.append(event->organizer()); } +#else //DESKTOP_VERSION + mText.append(event->organizer()); +#endif //DESKTOP_VERSION + + #else mText.append(event->organizer()); #endif if (iconPath) { mText += " <a href=\"mailto:" + event->organizer() + "\">"; @@ -407,12 +434,13 @@ void KOEventViewer::formatAttendees(Incidence *event) addTag("h3",i18n("Attendees")); Attendee *a; mText.append("<ul>"); for(a=attendees.first();a;a=attendees.next()) { #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION if (a->name().isEmpty()) { addressList = add_book->findByEmail(a->email()); KABC::Addressee o = addressList.first(); if (!o.isEmpty() && addressList.size()<2) { mText += "<a href=\"uid:" + o.uid() + "\">"; mText += o.formattedName(); @@ -425,12 +453,18 @@ void KOEventViewer::formatAttendees(Incidence *event) } else { mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; } +#else //DESKTOP_VERSION + mText += "<li><a href=\"uid:" + a->uid() + "\">"; + if (!a->name().isEmpty()) mText += a->name(); + else mText += a->email(); + mText += "</a>\n"; +#endif //DESKTOP_VERSION #else //qDebug("nokabc "); mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d4fadcb..7978b46 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -199,13 +199,15 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); qApp->processEvents(); mView->dialogManager()->showSyncOptions(); } //US listen for result adressed from Ka/Pi +#ifndef DESKTOP_VERSION connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); +#endif } MainWindow::~MainWindow() { //qDebug("MainWindow::~MainWindow() "); //save toolbar location |