-rw-r--r-- | kaddressbook/kabcore.cpp | 33 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 3 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 19 |
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 @@ -69,2 +69,4 @@ #include "kactioncollection.h" +#include "addresseedialog.h" + #include <qapp.h> @@ -213,2 +215,6 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const + + connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&, const QString&))); + + #ifndef KAB_EMBEDDED @@ -220,2 +226,3 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const + mAddressBookService = new KAddressBookService( this ); @@ -1967,2 +1974,28 @@ 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); + +} + + + diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index d4d28f1..fe778af 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -330,2 +330,5 @@ class KABCore : public QWidget + void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1); + + signals: diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 7f368eb..850e5b2 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -5,5 +5,5 @@ #include <qapplication.h> -#include <qwindowsstyle.h> -#include <qplatinumstyle.h> -#include <qmainwindow.h> +#include <qwindowsstyle.h> +#include <qplatinumstyle.h> +#include <qmainwindow.h> #endif @@ -15,2 +15,3 @@ #include "kaddressbookmain.h" +#include "externalapphandler.h" @@ -22,6 +23,6 @@ int main( int argc, char **argv ) #else - QApplication a( argc, argv ); + QApplication a( argc, argv ); QApplication::setStyle( new QPlatinumStyle ()); #endif - + bool exitHelp = false; @@ -32,3 +33,3 @@ int main( int argc, char **argv ) 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"); @@ -51,3 +52,3 @@ int main( int argc, char **argv ) -#endif +#endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); @@ -55,3 +56,3 @@ int main( int argc, char **argv ) //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 & ))); @@ -65,3 +66,3 @@ int main( int argc, char **argv ) a.exec(); - + } |