author | ulf69 <ulf69> | 2004-11-07 01:13:59 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-11-07 01:13:59 (UTC) |
commit | c3168210fffc83fbab58f44ce456fd241d44716d (patch) (unidiff) | |
tree | c93de33dd16e9b0f1e0752d6006aa75bd003fccf /libkdepim | |
parent | 023e0e82dd8bf6421d12492a2dd25534fc43ad31 (diff) | |
download | kdepimpi-c3168210fffc83fbab58f44ce456fd241d44716d.zip kdepimpi-c3168210fffc83fbab58f44ce456fd241d44716d.tar.gz kdepimpi-c3168210fffc83fbab58f44ce456fd241d44716d.tar.bz2 |
added support for mailit opie mailer,
now we check for applications in QTDIR, QPEDIR and OPIEDIR
-rw-r--r-- | libkdepim/externalapphandler.cpp | 17 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 3 |
2 files changed, 17 insertions, 3 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 9f12152..3079141 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -287,279 +287,292 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString | |||
287 | 287 | ||
288 | QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); | 288 | QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); |
289 | //US we need no names in the To field. The emailadresses are enough | 289 | //US we need no names in the To field. The emailadresses are enough |
290 | 290 | ||
291 | e << uid << list1 << list2 << list3 << list4 << list5 << list6; | 291 | e << uid << list1 << list2 << list3 << list4 << list5 << list6; |
292 | 292 | ||
293 | qApp->processEvents(); | 293 | qApp->processEvents(); |
294 | 294 | ||
295 | return true; | 295 | return true; |
296 | 296 | ||
297 | #else | 297 | #else |
298 | KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); | 298 | KMessageBox::sorry( 0, i18n( "This version does not support QCop." ) ); |
299 | return false; | 299 | return false; |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | } | 302 | } |
303 | 303 | ||
304 | 304 | ||
305 | /*********************************************************************************/ | 305 | /*********************************************************************************/ |
306 | bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) | 306 | bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) |
307 | { | 307 | { |
308 | bool res = QCopTransferItem::appMessage( cmsg, data ); | 308 | bool res = QCopTransferItem::appMessage( cmsg, data ); |
309 | #ifdef DEBUG_EXT_APP_HANDLER | 309 | #ifdef DEBUG_EXT_APP_HANDLER |
310 | qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); | 310 | qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); |
311 | #endif | 311 | #endif |
312 | 312 | ||
313 | if (res == false) | 313 | if (res == false) |
314 | { | 314 | { |
315 | QDataStream stream( data, IO_ReadOnly ); | 315 | QDataStream stream( data, IO_ReadOnly ); |
316 | 316 | ||
317 | #ifdef DEBUG_EXT_APP_HANDLER | 317 | #ifdef DEBUG_EXT_APP_HANDLER |
318 | qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); | 318 | qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); |
319 | #endif | 319 | #endif |
320 | 320 | ||
321 | //we are in the source and get an answer from the target | 321 | //we are in the source and get an answer from the target |
322 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) | 322 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) |
323 | { | 323 | { |
324 | QStringList list1; | 324 | QStringList list1; |
325 | QStringList list2; | 325 | QStringList list2; |
326 | QStringList list3; | 326 | QStringList list3; |
327 | QStringList list4; | 327 | QStringList list4; |
328 | QStringList list5; | 328 | QStringList list5; |
329 | QStringList list6; | 329 | QStringList list6; |
330 | QString uid; | 330 | QString uid; |
331 | 331 | ||
332 | #ifdef DEBUG_EXT_APP_HANDLER | 332 | #ifdef DEBUG_EXT_APP_HANDLER |
333 | qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); | 333 | qDebug("3QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); |
334 | #endif | 334 | #endif |
335 | 335 | ||
336 | stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6; | 336 | stream >> uid >> list1 >> list2 >> list3 >> list4 >> list5 >> list6; |
337 | emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6); | 337 | emit receivedMessageFromTarget(uid, list1, list2, list3, list4, list5, list6); |
338 | 338 | ||
339 | 339 | ||
340 | return true; | 340 | return true; |
341 | } | 341 | } |
342 | } | 342 | } |
343 | 343 | ||
344 | return false; | 344 | return false; |
345 | } | 345 | } |
346 | 346 | ||
347 | 347 | ||
348 | 348 | ||
349 | /********************************************************************************* | 349 | /********************************************************************************* |
350 | * | 350 | * |
351 | ********************************************************************************/ | 351 | ********************************************************************************/ |
352 | 352 | ||
353 | 353 | ||
354 | ExternalAppHandler *ExternalAppHandler::sInstance = 0; | 354 | ExternalAppHandler *ExternalAppHandler::sInstance = 0; |
355 | static KStaticDeleter<ExternalAppHandler> staticDeleter; | 355 | static KStaticDeleter<ExternalAppHandler> staticDeleter; |
356 | 356 | ||
357 | ExternalAppHandler::ExternalAppHandler() | 357 | ExternalAppHandler::ExternalAppHandler() |
358 | { | 358 | { |
359 | mDefaultItems.setAutoDelete(true); | 359 | mDefaultItems.setAutoDelete(true); |
360 | 360 | ||
361 | mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); | 361 | mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); |
362 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); | 362 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); |
363 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 363 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
364 | 364 | ||
365 | //US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); | 365 | //US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); |
366 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); | 366 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); |
367 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 367 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
368 | 368 | ||
369 | mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); | 369 | mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); |
370 | connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 370 | connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
371 | 371 | ||
372 | 372 | ||
373 | 373 | ||
374 | mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList"); | 374 | mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList"); |
375 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&))); | 375 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&))); |
376 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 376 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
377 | 377 | ||
378 | 378 | ||
379 | } | 379 | } |
380 | 380 | ||
381 | ExternalAppHandler::~ExternalAppHandler() | 381 | ExternalAppHandler::~ExternalAppHandler() |
382 | { | 382 | { |
383 | delete mNameEmailUidListFromKAPITransfer; | 383 | delete mNameEmailUidListFromKAPITransfer; |
384 | //delete mFindByEmailFromKAPITransfer; | 384 | //delete mFindByEmailFromKAPITransfer; |
385 | delete mDisplayDetails; | 385 | delete mDisplayDetails; |
386 | delete mBirthdayListFromKAPITransfer; | 386 | delete mBirthdayListFromKAPITransfer; |
387 | } | 387 | } |
388 | 388 | ||
389 | void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid, | 389 | void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid, |
390 | const QStringList& nameList, | 390 | const QStringList& nameList, |
391 | const QStringList& emailList, | 391 | const QStringList& emailList, |
392 | const QStringList& uidList, | 392 | const QStringList& uidList, |
393 | const QStringList&, | 393 | const QStringList&, |
394 | const QStringList&, | 394 | const QStringList&, |
395 | const QStringList& ) | 395 | const QStringList& ) |
396 | { | 396 | { |
397 | // this method is a conevnient way to reduce the number of parameters I have to pass | 397 | // this method is a conevnient way to reduce the number of parameters I have to pass |
398 | emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList); | 398 | emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList); |
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | void ExternalAppHandler::loadConfig() | 402 | void ExternalAppHandler::loadConfig() |
403 | { | 403 | { |
404 | 404 | ||
405 | mDefaultItems.clear(); | 405 | mDefaultItems.clear(); |
406 | mEmailAppAvailable = UNDEFINED; | 406 | mEmailAppAvailable = UNDEFINED; |
407 | mPhoneAppAvailable = UNDEFINED; | 407 | mPhoneAppAvailable = UNDEFINED; |
408 | mFaxAppAvailable = UNDEFINED; | 408 | mFaxAppAvailable = UNDEFINED; |
409 | mSMSAppAvailable = UNDEFINED; | 409 | mSMSAppAvailable = UNDEFINED; |
410 | mPagerAppAvailable = UNDEFINED; | 410 | mPagerAppAvailable = UNDEFINED; |
411 | mSIPAppAvailable = UNDEFINED; | 411 | mSIPAppAvailable = UNDEFINED; |
412 | 412 | ||
413 | QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); | 413 | QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); |
414 | QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); | 414 | QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); |
415 | QString qtpath = QString::fromLatin1( getenv("QTDIR") ); | ||
415 | 416 | ||
417 | //if qtopiapath is not set, fallback to qt | ||
418 | if (qtopiapath.isEmpty()) | ||
419 | qtopiapath = qtpath; | ||
420 | |||
421 | //if opiepath is not set, fallback to qtopia | ||
416 | if (opiepath.isEmpty()) | 422 | if (opiepath.isEmpty()) |
417 | opiepath = qtopiapath; | 423 | opiepath = qtopiapath; |
418 | 424 | ||
425 | |||
426 | |||
419 | //mailclients | 427 | //mailclients |
420 | QString mailmsg1 = "writeMail(QString,QString)"; | 428 | QString mailmsg1 = "writeMail(QString,QString)"; |
421 | QString mailmsg2 = "writeMail(QMap(QString,QString))"; | 429 | QString mailmsg2 = "writeMail(QMap(QString,QString))"; |
422 | 430 | ||
423 | QString undefined = ""; | 431 | QString undefined = ""; |
424 | 432 | ||
425 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); | 433 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); |
426 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); | 434 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); |
427 | 435 | ||
428 | if (( QFile::exists( qtopiapath + "/bin/ompi" )) || | 436 | if (( QFile::exists( qtopiapath + "/bin/ompi" )) || |
429 | ( QFile::exists( opiepath + "/bin/ompi" ))) | 437 | ( QFile::exists( opiepath + "/bin/ompi" )) || |
438 | ( QFile::exists( qtpath + "/bin/ompi" ))) | ||
430 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); | 439 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); |
431 | 440 | ||
432 | if ( QFile::exists( qtopiapath + "/bin/qtmail" )) | 441 | if (( QFile::exists( qtopiapath + "/bin/qtmail" )) || |
442 | ( QFile::exists( qtpath + "/bin/qtmail" ))) | ||
433 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); | 443 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); |
434 | 444 | ||
435 | if ( QFile::exists( opiepath + "/bin/opiemail" )) | 445 | if ( QFile::exists( opiepath + "/bin/opiemail" )) |
436 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); | 446 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); |
437 | 447 | ||
448 | if ( QFile::exists( opiepath + "/bin/mailit" )) | ||
449 | addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_MAILIT_EMC, "Opie mailit email client", "QPE/Application/mailit", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); | ||
450 | |||
438 | 451 | ||
439 | 452 | ||
440 | //phoneclients | 453 | //phoneclients |
441 | 454 | ||
442 | addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); | 455 | addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); |
443 | addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined); | 456 | addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined); |
444 | if (( QFile::exists( qtopiapath + "/bin/kppi" )) || | 457 | if (( QFile::exists( qtopiapath + "/bin/kppi" )) || |
445 | ( QFile::exists( opiepath + "/bin/kppi" ))) | 458 | ( QFile::exists( opiepath + "/bin/kppi" ))) |
446 | addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); | 459 | addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); |
447 | 460 | ||
448 | //faxclients | 461 | //faxclients |
449 | addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); | 462 | addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); |
450 | addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); | 463 | addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); |
451 | 464 | ||
452 | //smsclients | 465 | //smsclients |
453 | addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined); | 466 | addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined); |
454 | addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined); | 467 | addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined); |
455 | 468 | ||
456 | //pagerclients | 469 | //pagerclients |
457 | addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined); | 470 | addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined); |
458 | addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined); | 471 | addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined); |
459 | 472 | ||
460 | //sipclients | 473 | //sipclients |
461 | addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC, "No SIP client installed", undefined, undefined, undefined, undefined, undefined); | 474 | addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC, "No SIP client installed", undefined, undefined, undefined, undefined, undefined); |
462 | addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::OTHER_SIC, "Other SIP client", undefined, undefined, undefined, undefined, undefined); | 475 | addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::OTHER_SIC, "Other SIP client", undefined, undefined, undefined, undefined, undefined); |
463 | if (( QFile::exists( qtopiapath + "/bin/kppi" )) || | 476 | if (( QFile::exists( qtopiapath + "/bin/kppi" )) || |
464 | ( QFile::exists( opiepath + "/bin/kppi" ))) | 477 | ( QFile::exists( opiepath + "/bin/kppi" ))) |
465 | addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::KPPI_SIC, "KP/Pi SIP client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); | 478 | addDefaultAppItem(ExternalAppHandler::SIP, KPimGlobalPrefs::KPPI_SIC, "KP/Pi SIP client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); |
466 | 479 | ||
467 | } | 480 | } |
468 | 481 | ||
469 | ExternalAppHandler *ExternalAppHandler::instance() | 482 | ExternalAppHandler *ExternalAppHandler::instance() |
470 | { | 483 | { |
471 | if ( !sInstance ) { | 484 | if ( !sInstance ) { |
472 | sInstance = staticDeleter.setObject( new ExternalAppHandler() ); | 485 | sInstance = staticDeleter.setObject( new ExternalAppHandler() ); |
473 | sInstance->loadConfig(); | 486 | sInstance->loadConfig(); |
474 | } | 487 | } |
475 | 488 | ||
476 | return sInstance; | 489 | return sInstance; |
477 | } | 490 | } |
478 | 491 | ||
479 | void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) | 492 | void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) |
480 | { | 493 | { |
481 | DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); | 494 | DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); |
482 | // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() ); | 495 | // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() ); |
483 | mDefaultItems.append(dai); | 496 | mDefaultItems.append(dai); |
484 | } | 497 | } |
485 | 498 | ||
486 | 499 | ||
487 | QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) | 500 | QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) |
488 | { | 501 | { |
489 | QList<DefaultAppItem> list; | 502 | QList<DefaultAppItem> list; |
490 | 503 | ||
491 | DefaultAppItem* dai; | 504 | DefaultAppItem* dai; |
492 | 505 | ||
493 | for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) | 506 | for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) |
494 | { | 507 | { |
495 | if (dai->_type == type) | 508 | if (dai->_type == type) |
496 | list.append(dai); | 509 | list.append(dai); |
497 | } | 510 | } |
498 | 511 | ||
499 | return list; | 512 | return list; |
500 | } | 513 | } |
501 | 514 | ||
502 | DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid) | 515 | DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid) |
503 | { | 516 | { |
504 | DefaultAppItem* dai; | 517 | DefaultAppItem* dai; |
505 | 518 | ||
506 | for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) | 519 | for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) |
507 | { | 520 | { |
508 | if (dai->_type == type && dai->_id == clientid) | 521 | if (dai->_type == type && dai->_id == clientid) |
509 | return dai; | 522 | return dai; |
510 | } | 523 | } |
511 | 524 | ||
512 | return 0; | 525 | return 0; |
513 | } | 526 | } |
514 | 527 | ||
515 | bool ExternalAppHandler::isEmailAppAvailable() | 528 | bool ExternalAppHandler::isEmailAppAvailable() |
516 | { | 529 | { |
517 | #ifndef DESKTOP_VERSION | 530 | #ifndef DESKTOP_VERSION |
518 | if (mEmailAppAvailable == UNDEFINED) | 531 | if (mEmailAppAvailable == UNDEFINED) |
519 | { | 532 | { |
520 | int client = KPimGlobalPrefs::instance()->mEmailClient; | 533 | int client = KPimGlobalPrefs::instance()->mEmailClient; |
521 | if (client == KPimGlobalPrefs::NONE_EMC) | 534 | if (client == KPimGlobalPrefs::NONE_EMC) |
522 | mEmailAppAvailable = UNAVAILABLE; | 535 | mEmailAppAvailable = UNAVAILABLE; |
523 | else | 536 | else |
524 | mEmailAppAvailable = AVAILABLE; | 537 | mEmailAppAvailable = AVAILABLE; |
525 | } | 538 | } |
526 | return (mEmailAppAvailable == AVAILABLE); | 539 | return (mEmailAppAvailable == AVAILABLE); |
527 | 540 | ||
528 | #else //DESKTOP_VERSION | 541 | #else //DESKTOP_VERSION |
529 | return false; | 542 | return false; |
530 | #endif //DESKTOP_VERSION | 543 | #endif //DESKTOP_VERSION |
531 | } | 544 | } |
532 | 545 | ||
533 | bool ExternalAppHandler::isSMSAppAvailable() | 546 | bool ExternalAppHandler::isSMSAppAvailable() |
534 | { | 547 | { |
535 | #ifndef DESKTOP_VERSION | 548 | #ifndef DESKTOP_VERSION |
536 | if (mSMSAppAvailable == UNDEFINED) | 549 | if (mSMSAppAvailable == UNDEFINED) |
537 | { | 550 | { |
538 | int client = KPimGlobalPrefs::instance()->mSMSClient; | 551 | int client = KPimGlobalPrefs::instance()->mSMSClient; |
539 | if (client == KPimGlobalPrefs::NONE_SMC) | 552 | if (client == KPimGlobalPrefs::NONE_SMC) |
540 | mSMSAppAvailable = UNAVAILABLE; | 553 | mSMSAppAvailable = UNAVAILABLE; |
541 | else | 554 | else |
542 | mSMSAppAvailable = AVAILABLE; | 555 | mSMSAppAvailable = AVAILABLE; |
543 | } | 556 | } |
544 | 557 | ||
545 | return (mSMSAppAvailable == AVAILABLE); | 558 | return (mSMSAppAvailable == AVAILABLE); |
546 | #else //DESKTOP_VERSION | 559 | #else //DESKTOP_VERSION |
547 | return false; | 560 | return false; |
548 | #endif //DESKTOP_VERSION | 561 | #endif //DESKTOP_VERSION |
549 | } | 562 | } |
550 | 563 | ||
551 | bool ExternalAppHandler::isPhoneAppAvailable() | 564 | bool ExternalAppHandler::isPhoneAppAvailable() |
552 | { | 565 | { |
553 | #ifndef DESKTOP_VERSION | 566 | #ifndef DESKTOP_VERSION |
554 | if (mPhoneAppAvailable == UNDEFINED) | 567 | if (mPhoneAppAvailable == UNDEFINED) |
555 | { | 568 | { |
556 | int client = KPimGlobalPrefs::instance()->mPhoneClient; | 569 | int client = KPimGlobalPrefs::instance()->mPhoneClient; |
557 | if (client == KPimGlobalPrefs::NONE_PHC) | 570 | if (client == KPimGlobalPrefs::NONE_PHC) |
558 | mPhoneAppAvailable = UNAVAILABLE; | 571 | mPhoneAppAvailable = UNAVAILABLE; |
559 | else | 572 | else |
560 | mPhoneAppAvailable = AVAILABLE; | 573 | mPhoneAppAvailable = AVAILABLE; |
561 | } | 574 | } |
562 | 575 | ||
563 | return (mPhoneAppAvailable == AVAILABLE); | 576 | return (mPhoneAppAvailable == AVAILABLE); |
564 | #else //DESKTOP_VERSION | 577 | #else //DESKTOP_VERSION |
565 | return false; | 578 | return false; |
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index 11c534a..5e27e85 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h | |||
@@ -1,142 +1,143 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkdepim. | 2 | This file is part of libkdepim. |
3 | Copyright (c) 2004 Ulf Schenk | 3 | Copyright (c) 2004 Ulf Schenk |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef KPIMGLOBALPREFS_H | 31 | #ifndef KPIMGLOBALPREFS_H |
32 | #define KPIMGLOBALPREFS_H | 32 | #define KPIMGLOBALPREFS_H |
33 | 33 | ||
34 | #include "kprefs.h" | 34 | #include "kprefs.h" |
35 | #include <qdict.h> | 35 | #include <qdict.h> |
36 | 36 | ||
37 | class KPimGlobalPrefs : public KPrefs | 37 | class KPimGlobalPrefs : public KPrefs |
38 | { | 38 | { |
39 | public: | 39 | public: |
40 | 40 | ||
41 | void setGlobalConfig(); | 41 | void setGlobalConfig(); |
42 | static KPimGlobalPrefs *instance(); | 42 | static KPimGlobalPrefs *instance(); |
43 | 43 | ||
44 | 44 | ||
45 | virtual ~KPimGlobalPrefs(); | 45 | virtual ~KPimGlobalPrefs(); |
46 | 46 | ||
47 | 47 | ||
48 | enum EMailClients { | 48 | enum EMailClients { |
49 | NONE_EMC = 0, | 49 | NONE_EMC = 0, |
50 | OTHER_EMC = 1, | 50 | OTHER_EMC = 1, |
51 | OMPI_EMC = 2, | 51 | OMPI_EMC = 2, |
52 | QTOPIA_EMC = 3, | 52 | QTOPIA_EMC = 3, |
53 | OPIE_EMC = 4 | 53 | OPIE_EMC = 4, |
54 | OPIE_MAILIT_EMC = 5 | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | enum PhoneClients { | 57 | enum PhoneClients { |
57 | NONE_PHC = 0, | 58 | NONE_PHC = 0, |
58 | OTHER_PHC = 1, | 59 | OTHER_PHC = 1, |
59 | KPPI_PHC = 2 | 60 | KPPI_PHC = 2 |
60 | }; | 61 | }; |
61 | 62 | ||
62 | enum FaxClients { | 63 | enum FaxClients { |
63 | NONE_FAC = 0, | 64 | NONE_FAC = 0, |
64 | OTHER_FAC = 1 | 65 | OTHER_FAC = 1 |
65 | }; | 66 | }; |
66 | 67 | ||
67 | enum SMSClients { | 68 | enum SMSClients { |
68 | NONE_SMC = 0, | 69 | NONE_SMC = 0, |
69 | OTHER_SMC = 1 | 70 | OTHER_SMC = 1 |
70 | }; | 71 | }; |
71 | 72 | ||
72 | enum PagerClients { | 73 | enum PagerClients { |
73 | NONE_PAC = 0, | 74 | NONE_PAC = 0, |
74 | OTHER_PAC = 1 | 75 | OTHER_PAC = 1 |
75 | }; | 76 | }; |
76 | 77 | ||
77 | enum SIPClients { | 78 | enum SIPClients { |
78 | NONE_SIC = 0, | 79 | NONE_SIC = 0, |
79 | OTHER_SIC = 1, | 80 | OTHER_SIC = 1, |
80 | KPPI_SIC = 2 | 81 | KPPI_SIC = 2 |
81 | }; | 82 | }; |
82 | 83 | ||
83 | private: | 84 | private: |
84 | KPimGlobalPrefs( const QString &name = QString::null ); | 85 | KPimGlobalPrefs( const QString &name = QString::null ); |
85 | 86 | ||
86 | static KPimGlobalPrefs *sInstance; | 87 | static KPimGlobalPrefs *sInstance; |
87 | QDict<QString> *mLocaleDict; | 88 | QDict<QString> *mLocaleDict; |
88 | 89 | ||
89 | 90 | ||
90 | public: | 91 | public: |
91 | //US I copied the following "locale" settings from KOPrefs | 92 | //US I copied the following "locale" settings from KOPrefs |
92 | int mPreferredDate; | 93 | int mPreferredDate; |
93 | QString mUserDateFormatLong; | 94 | QString mUserDateFormatLong; |
94 | QString mUserDateFormatShort; | 95 | QString mUserDateFormatShort; |
95 | int mPreferredLanguage; | 96 | int mPreferredLanguage; |
96 | int mPreferredTime; | 97 | int mPreferredTime; |
97 | bool mWeekStartsOnSunday; | 98 | bool mWeekStartsOnSunday; |
98 | QString mTimeZoneId; | 99 | QString mTimeZoneId; |
99 | bool mUseDaylightsaving; | 100 | bool mUseDaylightsaving; |
100 | int mDaylightsavingStart; | 101 | int mDaylightsavingStart; |
101 | int mDaylightsavingEnd; | 102 | int mDaylightsavingEnd; |
102 | bool mTimeZoneAdd30min; | 103 | bool mTimeZoneAdd30min; |
103 | 104 | ||
104 | int mEmailClient; | 105 | int mEmailClient; |
105 | QString mEmailOtherChannel; | 106 | QString mEmailOtherChannel; |
106 | QString mEmailOtherMessage; | 107 | QString mEmailOtherMessage; |
107 | QString mEmailOtherMessageParameters; | 108 | QString mEmailOtherMessageParameters; |
108 | QString mEmailOtherMessage2; | 109 | QString mEmailOtherMessage2; |
109 | QString mEmailOtherMessageParameters2; | 110 | QString mEmailOtherMessageParameters2; |
110 | 111 | ||
111 | int mPhoneClient; | 112 | int mPhoneClient; |
112 | QString mPhoneOtherChannel; | 113 | QString mPhoneOtherChannel; |
113 | QString mPhoneOtherMessage; | 114 | QString mPhoneOtherMessage; |
114 | QString mPhoneOtherMessageParameters; | 115 | QString mPhoneOtherMessageParameters; |
115 | 116 | ||
116 | int mFaxClient; | 117 | int mFaxClient; |
117 | QString mFaxOtherChannel; | 118 | QString mFaxOtherChannel; |
118 | QString mFaxOtherMessage; | 119 | QString mFaxOtherMessage; |
119 | QString mFaxOtherMessageParameters; | 120 | QString mFaxOtherMessageParameters; |
120 | 121 | ||
121 | int mSMSClient; | 122 | int mSMSClient; |
122 | QString mSMSOtherChannel; | 123 | QString mSMSOtherChannel; |
123 | QString mSMSOtherMessage; | 124 | QString mSMSOtherMessage; |
124 | QString mSMSOtherMessageParameters; | 125 | QString mSMSOtherMessageParameters; |
125 | 126 | ||
126 | int mPagerClient; | 127 | int mPagerClient; |
127 | QString mPagerOtherChannel; | 128 | QString mPagerOtherChannel; |
128 | QString mPagerOtherMessage; | 129 | QString mPagerOtherMessage; |
129 | QString mPagerOtherMessageParameters; | 130 | QString mPagerOtherMessageParameters; |
130 | 131 | ||
131 | int mSipClient; | 132 | int mSipClient; |
132 | QString mSipOtherChannel; | 133 | QString mSipOtherChannel; |
133 | QString mSipOtherMessage; | 134 | QString mSipOtherMessage; |
134 | QString mSipOtherMessageParameters; | 135 | QString mSipOtherMessageParameters; |
135 | 136 | ||
136 | QString mEx2PhoneDevice; | 137 | QString mEx2PhoneDevice; |
137 | QString mEx2PhoneConnection; | 138 | QString mEx2PhoneConnection; |
138 | QString mEx2PhoneModel; | 139 | QString mEx2PhoneModel; |
139 | 140 | ||
140 | }; | 141 | }; |
141 | 142 | ||
142 | #endif | 143 | #endif |