author | ulf69 <ulf69> | 2004-08-17 00:09:26 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-17 00:09:26 (UTC) |
commit | ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb (patch) (side-by-side diff) | |
tree | a9f62469297dda2981807b5235e7812cac72f44c /kaddressbook | |
parent | 0e46d151bca931ff5c69a637d91cfcc381094e0b (diff) | |
download | kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.zip kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.tar.gz kdepimpi-ab3b10a5018152dedbdb64d0d5a4bd8ec752ccdb.tar.bz2 |
QCop implementation for KOrganizer to access Ka/pi directly
-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 @@ -62,16 +62,18 @@ #include "ldapsearchdialog.h" #include "printing/printingwizard.h" #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 #include <kresources/kcmkresources.h> #include <ktoolbar.h> @@ -206,23 +208,28 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), SLOT( incrementalSearch( const QString& ) ) ); 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 ); } @@ -1960,12 +1967,38 @@ void KABCore::configureResources() if ( !dlg.exec() ) 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 @@ -323,16 +323,19 @@ class KABCore : public QWidget */ void print(); /** 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(); private slots: void setJumpButtonBarVisible( bool visible ); diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 7f368eb..850e5b2 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -1,41 +1,42 @@ #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #include <stdlib.h> #else #include <qapplication.h> -#include <qwindowsstyle.h> -#include <qplatinumstyle.h> -#include <qmainwindow.h> +#include <qwindowsstyle.h> +#include <qplatinumstyle.h> +#include <qmainwindow.h> #endif #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 (); #else - QApplication a( argc, argv ); + QApplication a( argc, argv ); QApplication::setStyle( new QPlatinumStyle ()); #endif - + bool exitHelp = false; if ( argc > 1 ) { QString command = argv[1]; if ( command == "-help" ){ 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; } } if ( ! exitHelp ) { KGlobal::setAppName( "kaddressbook" ); #ifndef DESKTOP_VERSION @@ -44,31 +45,31 @@ int main( int argc, char **argv ) else KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); #else QString fileName ; fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 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 a.showMainWidget( &m ); #else a.setMainWidget( &m ); m.resize (640, 480 ); m.show(); #endif a.exec(); - + } qDebug("KA: Bye! "); } /* #include <stdlib.h> #include <qstring.h> |