-rw-r--r-- | kaddressbook/kabcore.cpp | 53 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.cpp | 20 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 10 |
3 files changed, 28 insertions, 55 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4303cab..fe4841a 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -89,6 +89,8 @@ | |||
89 | #endif // KAB_EMBEDDED | 89 | #endif // KAB_EMBEDDED |
90 | #include "kcmconfigs/kcmkabconfig.h" | 90 | #include "kcmconfigs/kcmkabconfig.h" |
91 | #include "kcmconfigs/kcmkdepimconfig.h" | 91 | #include "kcmconfigs/kcmkdepimconfig.h" |
92 | #include "kpimglobalprefs.h" | ||
93 | #include "externalapphandler.h" | ||
92 | 94 | ||
93 | 95 | ||
94 | #include <kresources/selectdialog.h> | 96 | #include <kresources/selectdialog.h> |
@@ -467,29 +469,7 @@ void KABCore::sendMail() | |||
467 | 469 | ||
468 | void KABCore::sendMail( const QString& email ) | 470 | void KABCore::sendMail( const QString& email ) |
469 | { | 471 | { |
470 | //US original kde implementation : kapp->invokeMailer( email, "" ); | 472 | bool result = ExternalAppHandler::instance()->mailToContacts(email); |
471 | |||
472 | /*US original qtopia implementation | ||
473 | PimContact c = abList->currentEntry(); | ||
474 | QString name = c.fileAs(); | ||
475 | QString email = c.defaultEmail(); | ||
476 | #ifndef QT_NO_COP | ||
477 | QCopEnvelope e(Service::channel("Email"), "writeMail(QString,QString)"); | ||
478 | e << name << email; | ||
479 | #else | ||
480 | */ | ||
481 | |||
482 | |||
483 | #ifndef QT_NO_COP | ||
484 | QCString channel = KABPrefs::instance()->mEmailChannel.latin1(); | ||
485 | qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")"); | ||
486 | |||
487 | QCopEnvelope e(channel, "writeMail(QString,QString)"); | ||
488 | //US we need no names in the To field. The emailadresses are enough | ||
489 | e << "" << email; | ||
490 | #else | ||
491 | KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) ); | ||
492 | #endif | ||
493 | } | 473 | } |
494 | 474 | ||
495 | 475 | ||
@@ -550,6 +530,10 @@ void KABCore::mailVCard( const QStringList& uids ) | |||
550 | urls.append( fileName ); | 530 | urls.append( fileName ); |
551 | } | 531 | } |
552 | } | 532 | } |
533 | |||
534 | bool result = ExternalAppHandler::instance()->mailAttachments(urls.join(", ")); | ||
535 | |||
536 | |||
553 | /*US | 537 | /*US |
554 | kapp->invokeMailer( QString::null, QString::null, QString::null, | 538 | kapp->invokeMailer( QString::null, QString::null, QString::null, |
555 | QString::null, // subject | 539 | QString::null, // subject |
@@ -557,19 +541,6 @@ void KABCore::mailVCard( const QStringList& uids ) | |||
557 | QString::null, | 541 | QString::null, |
558 | urls ); // attachments | 542 | urls ); // attachments |
559 | */ | 543 | */ |
560 | #ifndef QT_NO_COP | ||
561 | QCString channel = KABPrefs::instance()->mEmailChannel.latin1(); | ||
562 | qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")"); | ||
563 | |||
564 | QMap<QString, QString> parameterMap; | ||
565 | parameterMap.insert("ATTACHMENT<n>", urls.join(", ")); | ||
566 | |||
567 | QCopEnvelope e(channel, "writeMail(QMap(QString,QString))"); | ||
568 | e << parameterMap; | ||
569 | #else | ||
570 | KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) ); | ||
571 | #endif | ||
572 | |||
573 | 544 | ||
574 | } | 545 | } |
575 | 546 | ||
@@ -1197,11 +1168,13 @@ QString KABCore::getNameByPhone( const QString &phone ) | |||
1197 | 1168 | ||
1198 | void KABCore::openConfigDialog() | 1169 | void KABCore::openConfigDialog() |
1199 | { | 1170 | { |
1200 | KABPrefs* prefs = KABPrefs::instance(); | 1171 | KABPrefs* kab_prefs = KABPrefs::instance(); |
1201 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( prefs, "PIM", this ,"kabconfigdialog", true ); | 1172 | KPimGlobalPrefs* kpim_prefs = KPimGlobalPrefs::instance(); |
1202 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1173 | |
1174 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | ||
1175 | KCMKabConfig* kabcfg = new KCMKabConfig( kab_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | ||
1203 | ConfigureDialog->addModule(kabcfg ); | 1176 | ConfigureDialog->addModule(kabcfg ); |
1204 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Pim")) , "KCMKdeLibConfig" ); | 1177 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( kpim_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); |
1205 | ConfigureDialog->addModule(kdelibcfg ); | 1178 | ConfigureDialog->addModule(kdelibcfg ); |
1206 | 1179 | ||
1207 | 1180 | ||
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp index 26398f8..b460a81 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp +++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp | |||
@@ -39,13 +39,13 @@ | |||
39 | 39 | ||
40 | extern "C" | 40 | extern "C" |
41 | { | 41 | { |
42 | KCModule *create_kabconfig( QWidget *parent, const char * ) { | 42 | KCModule *create_kabconfig( KABPrefs* prefs, QWidget *parent, const char * ) { |
43 | return new KCMKabConfig( parent, "kcmkabconfig" ); | 43 | return new KCMKabConfig( prefs, parent, "kcmkabconfig" ); |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) | 47 | KCMKabConfig::KCMKabConfig( KABPrefs* prefs, QWidget *parent, const char *name ) |
48 | : KCModule( parent, name ) | 48 | : KCModule( prefs, parent, name ) |
49 | { | 49 | { |
50 | //abort(); | 50 | //abort(); |
51 | QVBoxLayout *layout = new QVBoxLayout( this ); | 51 | QVBoxLayout *layout = new QVBoxLayout( this ); |
@@ -57,19 +57,19 @@ KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) | |||
57 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); | 57 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); |
58 | } | 58 | } |
59 | 59 | ||
60 | void KCMKabConfig::load(KPrefs* prefs) | 60 | void KCMKabConfig::load() |
61 | { | 61 | { |
62 | mConfigWidget->restoreSettings((KABPrefs*)prefs); | 62 | mConfigWidget->restoreSettings((KABPrefs*)getPreferences()); |
63 | } | 63 | } |
64 | 64 | ||
65 | void KCMKabConfig::save(KPrefs* prefs) | 65 | void KCMKabConfig::save() |
66 | { | 66 | { |
67 | mConfigWidget->saveSettings((KABPrefs*)prefs); | 67 | mConfigWidget->saveSettings((KABPrefs*)getPreferences()); |
68 | } | 68 | } |
69 | 69 | ||
70 | void KCMKabConfig::defaults(KPrefs* prefs) | 70 | void KCMKabConfig::defaults() |
71 | { | 71 | { |
72 | mConfigWidget->defaults((KABPrefs*)prefs); | 72 | mConfigWidget->defaults((KABPrefs*)getPreferences()); |
73 | } | 73 | } |
74 | 74 | ||
75 | #ifndef KAB_EMBEDDED | 75 | #ifndef KAB_EMBEDDED |
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index b4858c1..1cb6ad3 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h | |||
@@ -27,18 +27,18 @@ | |||
27 | #include <kcmodule.h> | 27 | #include <kcmodule.h> |
28 | 28 | ||
29 | class KABConfigWidget; | 29 | class KABConfigWidget; |
30 | class KPrefs; | 30 | class KABPrefs; |
31 | 31 | ||
32 | class KCMKabConfig : public KCModule | 32 | class KCMKabConfig : public KCModule |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | 35 | ||
36 | public: | 36 | public: |
37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); | 37 | KCMKabConfig( KABPrefs* prefs, QWidget *parent = 0, const char *name = 0 ); |
38 | 38 | ||
39 | virtual void load(KPrefs* prefs); | 39 | virtual void load(); |
40 | virtual void save(KPrefs* prefs); | 40 | virtual void save(); |
41 | virtual void defaults(KPrefs* prefs); | 41 | virtual void defaults(); |
42 | 42 | ||
43 | private: | 43 | private: |
44 | KABConfigWidget *mConfigWidget; | 44 | KABConfigWidget *mConfigWidget; |