author | zautrix <zautrix> | 2004-07-03 16:54:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-03 16:54:31 (UTC) |
commit | 6c035951faeaea6d7651e5fd028c7fd2a674cdfc (patch) (side-by-side diff) | |
tree | f55c6dd1f4457a5c3d387e6511d596438988955e | |
parent | 1da48d95d970233f0d1ea9a7fba5c98cfcf24798 (diff) | |
download | kdepimpi-6c035951faeaea6d7651e5fd028c7fd2a674cdfc.zip kdepimpi-6c035951faeaea6d7651e5fd028c7fd2a674cdfc.tar.gz kdepimpi-6c035951faeaea6d7651e5fd028c7fd2a674cdfc.tar.bz2 |
Added connection to KM when clicking on email
-rw-r--r-- | libkdepim/addresseeview.cpp | 18 | ||||
-rw-r--r-- | libkdepim/addresseeview.h | 2 | ||||
-rw-r--r-- | libkdepim/kincidenceformatter.cpp | 6 |
3 files changed, 22 insertions, 4 deletions
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp index deafd34..70fc57c 100644 --- a/libkdepim/addresseeview.cpp +++ b/libkdepim/addresseeview.cpp @@ -30,16 +30,23 @@ #include <qscrollview.h> #include <qregexp.h> #include <qfile.h> #include <qapplication.h> #include "addresseeview.h" + +#ifndef DESKTOP_VERSION +#include <qtopia/qcopenvelope_qws.h> +#endif + + + using namespace KPIM; AddresseeView::AddresseeView( QWidget *parent, const char *name ) //US : KTextBrowser( parent, name ) : QTextBrowser( parent, name ) { @@ -48,17 +55,25 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name ) // setVScrollBarMode( QScrollView::AlwaysOff ); //setHScrollBarMode( QScrollView::AlwaysOff ); //US QStyleSheet *sheet = styleSheet(); //US QStyleSheetItem *link = sheet->item( "a" ); //US link->setColor( KGlobalSettings::linkColor() ); } +void AddresseeView::setSource(const QString& n) +{ + //qDebug("********AddresseeView::setSource %s", n.mid(7).latin1()); +#ifndef DESKTOP_VERSION + QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)"); + e << n.mid(7); +#endif +} void AddresseeView::setAddressee( const KABC::Addressee& addr ) { mAddressee = addr; // clear view setText( QString::null ); if ( mAddressee.isEmpty() ) @@ -80,18 +95,19 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) } QStringList emails = mAddressee.emails(); QStringList::ConstIterator emailIt; QString type = i18n( "Email" ); for ( emailIt = emails.begin(); emailIt != emails.end(); ++emailIt ) { dynamicPart += QString( "<tr><td align=\"right\"><b>%1</b></td>" - "<td align=\"left\"><a href=\"mailto:%2\">%3</a></td></tr>" ) + "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) .arg( type ) + .arg( name ) .arg( *emailIt ) .arg( *emailIt ); type = i18n( "Other" ); } if ( !mAddressee.url().url().isEmpty() ) { dynamicPart += QString( "<tr><td align=\"right\"><b>%1</b></td>" diff --git a/libkdepim/addresseeview.h b/libkdepim/addresseeview.h index 598ef0d..1865fc4 100644 --- a/libkdepim/addresseeview.h +++ b/libkdepim/addresseeview.h @@ -36,17 +36,17 @@ class AddresseeView : public QTextBrowser AddresseeView( QWidget *parent = 0, const char *name = 0 ); /** Sets the addressee object. The addressee is displayed immediately. @param addr The addressee object. */ void setAddressee( const KABC::Addressee& addr ); - + void setSource(const QString& n); /** Returns the current addressee object. */ KABC::Addressee addressee() const; private: KABC::Addressee mAddressee; QString mText; diff --git a/libkdepim/kincidenceformatter.cpp b/libkdepim/kincidenceformatter.cpp index 4815519..2f41409 100644 --- a/libkdepim/kincidenceformatter.cpp +++ b/libkdepim/kincidenceformatter.cpp @@ -243,17 +243,18 @@ void KIncidenceFormatter::addTag(const QString & tag,const QString & text) void KIncidenceFormatter::formatAttendees(Incidence *event) { QPtrList<Attendee> attendees = event->attendees(); if (attendees.count()) { QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); addTag("h3",i18n("Organizer")); mText.append("<ul><li>"); -#ifndef KORG_NOKABC +#if 0 + //ndef KORG_NOKABC 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(); @@ -270,17 +271,18 @@ void KIncidenceFormatter::formatAttendees(Incidence *event) mText += "</a>\n"; } mText.append("</li></ul>"); addTag("h3",i18n("Attendees")); Attendee *a; mText.append("<ul>"); for(a=attendees.first();a;a=attendees.next()) { -#ifndef KORG_NOKABC +#if 0 +//ndef KORG_NOKABC 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(); mText += "</a>\n"; } else { |