summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorulf69 <ulf69>2004-08-17 00:09:26 (UTC)
committer ulf69 <ulf69>2004-08-17 00:09:26 (UTC)
commitab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb (patch) (side-by-side diff)
treea9f62469297dda2981807b5235e7812cac72f44c /kaddressbook
parent0e46d151bca931ff5c69a637d91cfcc381094e0b (diff)
downloadkdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.zip
kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.tar.gz
kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.tar.bz2
QCop implementation for KOrganizer to access Ka/pi directly
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
@@ -64,12 +64,14 @@
#else // KAB_EMBEDDED
#include <kapplication.h>
#include "KDGanttMinimizeSplitter.h"
#include "kaddressbookmain.h"
#include "kactioncollection.h"
+#include "addresseedialog.h"
+
#include <qapp.h>
#include <qmenubar.h>
//#include <qtoolbar.h>
#include <qmessagebox.h>
#include <kdebug.h>
#include <kiconloader.h> // needed for SmallIcon
@@ -208,19 +210,24 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
mJumpButtonBar, SLOT( recreateButtons() ) );
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& ) ) );
connect( mDetails, SIGNAL( browse( const QString& ) ),
SLOT( browse( const QString& ) ) );
+
mAddressBookService = new KAddressBookService( this );
#endif //KAB_EMBEDDED
mEditorDialog = 0;
createAddresseeEditorDialog( this );
setModified( false );
@@ -1962,10 +1969,36 @@ void KABCore::configureResources()
return;
KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
}
#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"
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index d4d28f1..fe778af 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -325,12 +325,15 @@ class KABCore : public QWidget
/**
Registers a new GUI client, so plugins can register its actions.
*/
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 );
public slots:
void setDetailsVisible( bool visible );
void setDetailsToState();
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 7f368eb..850e5b2 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -10,12 +10,13 @@
#include <kstandarddirs.h>
#include <kglobal.h>
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
+#include "externalapphandler.h"
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
@@ -50,13 +51,13 @@ int main( int argc, char **argv )
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#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
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );