summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp33
-rw-r--r--kaddressbook/kabcore.h3
-rw-r--r--kaddressbook/mainembedded.cpp19
3 files changed, 46 insertions, 9 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6807bed..e7c815e 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -68,4 +68,6 @@
#include "kaddressbookmain.h"
#include "kactioncollection.h"
+#include "addresseedialog.h"
+
#include <qapp.h>
#include <qmenubar.h>
@@ -212,4 +214,8 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
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& ) ),
@@ -219,4 +225,5 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
SLOT( browse( const QString& ) ) );
+
mAddressBookService = new KAddressBookService( this );
@@ -1966,4 +1973,30 @@ void KABCore::configureResources()
+/* 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
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index d4d28f1..fe778af 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -329,4 +329,7 @@ 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 );
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 7f368eb..850e5b2 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -4,7 +4,7 @@
#else
#include <qapplication.h>
-#include <qwindowsstyle.h>
-#include <qplatinumstyle.h>
-#include <qmainwindow.h>
+#include <qwindowsstyle.h>
+#include <qplatinumstyle.h>
+#include <qmainwindow.h>
#endif
@@ -14,4 +14,5 @@
#include <qdir.h>
#include "kaddressbookmain.h"
+#include "externalapphandler.h"
int main( int argc, char **argv )
@@ -21,8 +22,8 @@ int main( int argc, char **argv )
a.setKeepRunning ();
#else
- QApplication a( argc, argv );
+ QApplication a( argc, argv );
QApplication::setStyle( new QPlatinumStyle ());
#endif
-
+
bool exitHelp = false;
if ( argc > 1 ) {
@@ -31,5 +32,5 @@ int main( int argc, char **argv )
printf("KA/E command line commands:\n");
printf(" no command: Start KA/E in usual way\n");
- printf(" -help: This output\n");
+ printf(" -help: This output\n");
printf(" KA/E is exiting now. Bye!\n");
exitHelp = true;
@@ -50,9 +51,9 @@ int main( int argc, char **argv )
QApplication::addLibraryPath ( qApp->applicationDirPath () );
-#endif
+#endif
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
@@ -64,5 +65,5 @@ int main( int argc, char **argv )
#endif
a.exec();
-
+
}
qDebug("KA: Bye! ");