author | ulf69 <ulf69> | 2004-08-19 00:38:41 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-19 00:38:41 (UTC) |
commit | 895e3797f6437347fd73b87a3bf9d4cecfa5a5a9 (patch) (unidiff) | |
tree | 514daed00896a1a902b63f2deefa745b34d51ea4 | |
parent | 00101d27c9305ac3163e1a0c8ed27408b41fa192 (diff) | |
download | kdepimpi-895e3797f6437347fd73b87a3bf9d4cecfa5a5a9.zip kdepimpi-895e3797f6437347fd73b87a3bf9d4cecfa5a5a9.tar.gz kdepimpi-895e3797f6437347fd73b87a3bf9d4cecfa5a5a9.tar.bz2 |
updated version of detailed view when called through QCop
-rw-r--r-- | kaddressbook/kabcore.cpp | 79 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 3 |
2 files changed, 77 insertions, 5 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index e7c815e..dabb8e9 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -68,6 +68,8 @@ | |||
68 | #include "kaddressbookmain.h" | 68 | #include "kaddressbookmain.h" |
69 | #include "kactioncollection.h" | 69 | #include "kactioncollection.h" |
70 | #include "addresseedialog.h" | 70 | #include "addresseedialog.h" |
71 | //US | ||
72 | #include <libkdepim/addresseeview.h> | ||
71 | 73 | ||
72 | #include <qapp.h> | 74 | #include <qapp.h> |
73 | #include <qmenubar.h> | 75 | #include <qmenubar.h> |
@@ -84,6 +86,9 @@ | |||
84 | 86 | ||
85 | #ifndef DESKTOP_VERSION | 87 | #ifndef DESKTOP_VERSION |
86 | #include <qpe/ir.h> | 88 | #include <qpe/ir.h> |
89 | #include <qtopia/qcopenvelope_qws.h> | ||
90 | #else | ||
91 | |||
87 | #endif | 92 | #endif |
88 | 93 | ||
89 | #endif // KAB_EMBEDDED | 94 | #endif // KAB_EMBEDDED |
@@ -214,7 +219,8 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
214 | SLOT( sendMail( const QString& ) ) ); | 219 | SLOT( sendMail( const QString& ) ) ); |
215 | 220 | ||
216 | 221 | ||
217 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&, const QString&))); | 222 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
223 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | ||
218 | 224 | ||
219 | 225 | ||
220 | #ifndef KAB_EMBEDDED | 226 | #ifndef KAB_EMBEDDED |
@@ -1975,10 +1981,8 @@ void KABCore::configureResources() | |||
1975 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 1981 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
1976 | * for the attendees list of an event. | 1982 | * for the attendees list of an event. |
1977 | */ | 1983 | */ |
1978 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1) | 1984 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
1979 | { | 1985 | { |
1980 | //param1 is usually empty for this kind of request | ||
1981 | |||
1982 | QStringList nameList; | 1986 | QStringList nameList; |
1983 | QStringList emailList; | 1987 | QStringList emailList; |
1984 | QStringList uidList; | 1988 | QStringList uidList; |
@@ -1996,6 +2000,73 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt | |||
1996 | 2000 | ||
1997 | } | 2001 | } |
1998 | 2002 | ||
2003 | /* this method will be called through the QCop interface from other apps to show details of a contact. | ||
2004 | */ | ||
2005 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | ||
2006 | { | ||
2007 | // qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); | ||
2008 | |||
2009 | QString foundUid = QString::null; | ||
2010 | if (uid.isEmpty()) | ||
2011 | { | ||
2012 | //find the uid of the person first | ||
2013 | Addressee::List namelist; | ||
2014 | Addressee::List emaillist; | ||
2015 | |||
2016 | if (!name.isEmpty()) | ||
2017 | namelist = mAddressBook->findByName( name ); | ||
2018 | |||
2019 | if (!email.isEmpty()) | ||
2020 | emaillist = mAddressBook->findByEmail( email ); | ||
2021 | |||
2022 | //check if we have a match in Namelist and Emaillist | ||
2023 | if ((namelist.count() == 0) && (emaillist.count() > 0)) | ||
2024 | foundUid == emaillist[0].uid(); | ||
2025 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) | ||
2026 | foundUid == namelist[0].uid(); | ||
2027 | else | ||
2028 | { | ||
2029 | for (int i = 0; i < namelist.count(); i++) | ||
2030 | { | ||
2031 | for (int j = 0; j < emaillist.count(); j++) | ||
2032 | { | ||
2033 | if (namelist[i] == emaillist[j]) | ||
2034 | { | ||
2035 | foundUid == namelist[i].uid(); | ||
2036 | } | ||
2037 | } | ||
2038 | } | ||
2039 | } | ||
2040 | } | ||
2041 | else | ||
2042 | { | ||
2043 | foundUid = uid; | ||
2044 | } | ||
2045 | |||
2046 | if (!foundUid.isEmpty()) | ||
2047 | { | ||
2048 | // raise Ka/Pi if it is in the background | ||
2049 | #ifndef DESKTOP_VERSION | ||
2050 | #ifndef KORG_NODCOP | ||
2051 | QCopEnvelope e("QPE/Application/kapi", "raise()"); | ||
2052 | #endif | ||
2053 | #endif | ||
2054 | |||
2055 | mMainWindow->showMaximized(); | ||
2056 | |||
2057 | mViewManager->setSelected( "", false); | ||
2058 | mViewManager->refreshView( "" ); | ||
2059 | mViewManager->setSelected( foundUid, true ); | ||
2060 | mViewManager->refreshView( foundUid ); | ||
2061 | |||
2062 | if ( !mMultipleViewsAtOnce ) | ||
2063 | { | ||
2064 | setDetailsVisible( true ); | ||
2065 | mActionDetails->setChecked(true); | ||
2066 | } | ||
2067 | } | ||
2068 | } | ||
2069 | |||
1999 | 2070 | ||
2000 | 2071 | ||
2001 | 2072 | ||
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index fe778af..040b6aa 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -328,7 +328,8 @@ class KABCore : public QWidget | |||
328 | */ | 328 | */ |
329 | void addGUIClient( KXMLGUIClient *client ); | 329 | void addGUIClient( KXMLGUIClient *client ); |
330 | 330 | ||
331 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1); | 331 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); |
332 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | ||
332 | 333 | ||
333 | 334 | ||
334 | signals: | 335 | signals: |