summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp33
-rw-r--r--kaddressbook/kabcore.h3
-rw-r--r--kaddressbook/mainembedded.cpp3
3 files changed, 38 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6807bed..e7c815e 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -67,6 +67,8 @@
#include "KDGanttMinimizeSplitter.h"
#include "kaddressbookmain.h"
#include "kactioncollection.h"
+#include "addresseedialog.h"
+
#include <qapp.h>
#include <qmenubar.h>
//#include <qtoolbar.h>
@@ -211,6 +213,10 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
SLOT( sendMail( const QString& ) ) );
+
+ connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&, const QString&)));
+
+
#ifndef KAB_EMBEDDED
connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
mXXPortManager, SLOT( importVCard( const KURL& ) ) );
@@ -218,6 +224,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
connect( mDetails, SIGNAL( browse( const QString& ) ),
SLOT( browse( const QString& ) ) );
+
mAddressBookService = new KAddressBookService( this );
#endif //KAB_EMBEDDED
@@ -1965,6 +1972,32 @@ void KABCore::configureResources()
#endif //KAB_EMBEDDED
+/* this method will be called through the QCop interface from Ko/Pi to select addresses
+ * for the attendees list of an event.
+ */
+void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1)
+{
+ //param1 is usually empty for this kind of request
+
+ QStringList nameList;
+ QStringList emailList;
+ QStringList uidList;
+
+ KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
+ uint i=0;
+ for (i=0; i < list.count(); i++)
+ {
+ nameList.append(list[i].realName());
+ emailList.append(list[i].preferredEmail());
+ uidList.append(list[i].uid());
+ }
+
+ bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
+
+}
+
+
+
#ifndef KAB_EMBEDDED
#include "kabcore.moc"
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index d4d28f1..fe778af 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -328,6 +328,9 @@ class KABCore : public QWidget
*/
void addGUIClient( KXMLGUIClient *client );
+ void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1);
+
+
signals:
void contactSelected( const QString &name );
void contactSelected( const QPixmap &pixmap );
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 7f368eb..850e5b2 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -13,6 +13,7 @@
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
+#include "externalapphandler.h"
int main( int argc, char **argv )
{
@@ -53,7 +54,7 @@ int main( int argc, char **argv )
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
-//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
+ QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );