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) (unidiff)
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 @@
64#else // KAB_EMBEDDED 64#else // KAB_EMBEDDED
65 65
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>
74#include <kdebug.h> 76#include <kdebug.h>
75#include <kiconloader.h> // needed for SmallIcon 77#include <kiconloader.h> // needed for SmallIcon
@@ -208,19 +210,24 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
208 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 210 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
209 mJumpButtonBar, SLOT( recreateButtons() ) ); 211 mJumpButtonBar, SLOT( recreateButtons() ) );
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;
225 createAddresseeEditorDialog( this ); 232 createAddresseeEditorDialog( this );
226 setModified( false ); 233 setModified( false );
@@ -1962,10 +1969,36 @@ void KABCore::configureResources()
1962 return; 1969 return;
1963 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 1970 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
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
@@ -325,12 +325,15 @@ class KABCore : public QWidget
325 325
326 /** 326 /**
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:
335 void setDetailsVisible( bool visible ); 338 void setDetailsVisible( bool visible );
336 void setDetailsToState(); 339 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 @@
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 ();
@@ -50,13 +51,13 @@ int main( int argc, char **argv )
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
61 a.setMainWidget( &m ); 62 a.setMainWidget( &m );
62 m.resize (640, 480 ); 63 m.resize (640, 480 );