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/mainembedded.cpp | |
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/mainembedded.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 7f368eb..850e5b2 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -1,152 +1,153 @@ #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #include <stdlib.h> #else #include <qapplication.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::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(" KA/E is exiting now. Bye!\n"); exitHelp = true; } } if ( ! exitHelp ) { KGlobal::setAppName( "kaddressbook" ); #ifndef DESKTOP_VERSION if ( QApplication::desktop()->width() > 320 ) KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 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 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> #include <kabc/stdaddressbook.h> #include <kaboutdata.h> #include <kcmdlineargs.h> #include <kcrash.h> #include <kdebug.h> #include <klocale.h> #include <kstartupinfo.h> #include <kuniqueapplication.h> #include <kwin.h> #include "kaddressbookmain.h" #include "kabcore.h" extern "C" { void crashHandler( int ) { KABC::StdAddressBook::handleCrash(); ::exit( 0 ); } } class KAddressBookApp : public KUniqueApplication { public: KAddressBookApp() : mMainWin( 0 ) {} ~KAddressBookApp() {} int newInstance(); private: KAddressBookMain *mMainWin; }; int KAddressBookApp::newInstance() { if ( isRestored() ) { // There can only be one main window if ( KMainWindow::canBeRestored( 1 ) ) { mMainWin = new KAddressBookMain; mMainWin->show(); mMainWin->restore( 1 ); } } else { KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); QCString addrStr = args->getOption( "addr" ); QCString uidStr = args->getOption( "uid" ); QString addr; QString uid; if ( !addrStr.isEmpty() ) addr = QString::fromLocal8Bit( addrStr ); if ( !uidStr.isEmpty() ) uid = QString::fromLocal8Bit( uidStr ); if ( args->isSet( "editor-only" ) ) { if ( !mMainWin ) mMainWin = new KAddressBookMain; KStartupInfo::appStarted(); mMainWin->hide(); } else { if ( mMainWin ) { mMainWin->show(); KWin::setActiveWindow( mMainWin->winId() ); } else { mMainWin = new KAddressBookMain; mMainWin->show(); } } // Can not see why anyone would pass both a uid and an email address, so I'll leave it that two contact editors will show if they do if ( !addr.isEmpty() ) mMainWin->addEmail( addr ); if ( !uid.isEmpty() ) mMainWin->showContactEditor( uid ); if ( args->isSet( "new-contact" ) ) { |