summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
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
@@ -66,8 +66,10 @@
66#include <kapplication.h> 66#include <kapplication.h>
67#include "KDGanttMinimizeSplitter.h" 67#include "KDGanttMinimizeSplitter.h"
68#include "kaddressbookmain.h" 68#include "kaddressbookmain.h"
69#include "kactioncollection.h" 69#include "kactioncollection.h"
70#include "addresseedialog.h"
71
70#include <qapp.h> 72#include <qapp.h>
71#include <qmenubar.h> 73#include <qmenubar.h>
72//#include <qtoolbar.h> 74//#include <qtoolbar.h>
73#include <qmessagebox.h> 75#include <qmessagebox.h>
@@ -210,15 +212,20 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
210 212
211 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 213 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
212 SLOT( sendMail( const QString& ) ) ); 214 SLOT( sendMail( const QString& ) ) );
213 215
216
217 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&, const QString&)));
218
219
214#ifndef KAB_EMBEDDED 220#ifndef KAB_EMBEDDED
215 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 221 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
216 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 222 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
217 223
218 connect( mDetails, SIGNAL( browse( const QString& ) ), 224 connect( mDetails, SIGNAL( browse( const QString& ) ),
219 SLOT( browse( const QString& ) ) ); 225 SLOT( browse( const QString& ) ) );
220 226
227
221 mAddressBookService = new KAddressBookService( this ); 228 mAddressBookService = new KAddressBookService( this );
222 229
223#endif //KAB_EMBEDDED 230#endif //KAB_EMBEDDED
224 mEditorDialog = 0; 231 mEditorDialog = 0;
@@ -1964,8 +1971,34 @@ void KABCore::configureResources()
1964} 1971}
1965#endif //KAB_EMBEDDED 1972#endif //KAB_EMBEDDED
1966 1973
1967 1974
1975/* this method will be called through the QCop interface from Ko/Pi to select addresses
1976 * for the attendees list of an event.
1977 */
1978void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid, const QString& param1)
1979{
1980 //param1 is usually empty for this kind of request
1981
1982 QStringList nameList;
1983 QStringList emailList;
1984 QStringList uidList;
1985
1986 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
1987 uint i=0;
1988 for (i=0; i < list.count(); i++)
1989 {
1990 nameList.append(list[i].realName());
1991 emailList.append(list[i].preferredEmail());
1992 uidList.append(list[i].uid());
1993 }
1994
1995 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
1996
1997}
1998
1999
2000
1968 2001
1969#ifndef KAB_EMBEDDED 2002#ifndef KAB_EMBEDDED
1970#include "kabcore.moc" 2003#include "kabcore.moc"
1971#endif //KAB_EMBEDDED 2004#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
@@ -327,8 +327,11 @@ class KABCore : public QWidget
327 Registers a new GUI client, so plugins can register its actions. 327 Registers a new GUI client, so plugins can register its actions.
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);
332
333
331 signals: 334 signals:
332 void contactSelected( const QString &name ); 335 void contactSelected( const QString &name );
333 void contactSelected( const QPixmap &pixmap ); 336 void contactSelected( const QPixmap &pixmap );
334 public slots: 337 public slots:
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 7f368eb..850e5b2 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -2,36 +2,37 @@
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#else 4#else
5#include <qapplication.h> 5#include <qapplication.h>
6#include <qwindowsstyle.h> 6#include <qwindowsstyle.h>
7#include <qplatinumstyle.h> 7#include <qplatinumstyle.h>
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#endif 9#endif
10 10
11#include <kstandarddirs.h> 11#include <kstandarddirs.h>
12#include <kglobal.h> 12#include <kglobal.h>
13#include <stdio.h> 13#include <stdio.h>
14#include <qdir.h> 14#include <qdir.h>
15#include "kaddressbookmain.h" 15#include "kaddressbookmain.h"
16#include "externalapphandler.h"
16 17
17int main( int argc, char **argv ) 18int main( int argc, char **argv )
18{ 19{
19#ifndef DESKTOP_VERSION 20#ifndef DESKTOP_VERSION
20 QPEApplication a( argc, argv ); 21 QPEApplication a( argc, argv );
21 a.setKeepRunning (); 22 a.setKeepRunning ();
22#else 23#else
23 QApplication a( argc, argv ); 24 QApplication a( argc, argv );
24 QApplication::setStyle( new QPlatinumStyle ()); 25 QApplication::setStyle( new QPlatinumStyle ());
25#endif 26#endif
26 27
27 bool exitHelp = false; 28 bool exitHelp = false;
28 if ( argc > 1 ) { 29 if ( argc > 1 ) {
29 QString command = argv[1]; 30 QString command = argv[1];
30 if ( command == "-help" ){ 31 if ( command == "-help" ){
31 printf("KA/E command line commands:\n"); 32 printf("KA/E command line commands:\n");
32 printf(" no command: Start KA/E in usual way\n"); 33 printf(" no command: Start KA/E in usual way\n");
33 printf(" -help: This output\n"); 34 printf(" -help: This output\n");
34 printf(" KA/E is exiting now. Bye!\n"); 35 printf(" KA/E is exiting now. Bye!\n");
35 exitHelp = true; 36 exitHelp = true;
36 } 37 }
37 } 38 }
@@ -48,13 +49,13 @@ int main( int argc, char **argv )
48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 49 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
49 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 50 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
50 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 51 QApplication::addLibraryPath ( qApp->applicationDirPath () );
51 52
52#endif 53#endif
53 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 54 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
54 KAddressBookMain m ; 55 KAddressBookMain m ;
55//US MainWindow m; 56//US MainWindow m;
56//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 57 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
57 58
58#ifndef DESKTOP_VERSION 59#ifndef DESKTOP_VERSION
59 a.showMainWidget( &m ); 60 a.showMainWidget( &m );
60#else 61#else
@@ -62,9 +63,9 @@ int main( int argc, char **argv )
62 m.resize (640, 480 ); 63 m.resize (640, 480 );
63 m.show(); 64 m.show();
64#endif 65#endif
65 a.exec(); 66 a.exec();
66 67
67 } 68 }
68 qDebug("KA: Bye! "); 69 qDebug("KA: Bye! ");
69} 70}
70 71