author | ulf69 <ulf69> | 2004-08-10 01:34:22 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-10 01:34:22 (UTC) |
commit | c9d570427f3d5bead7bee1301514a2d4b82836ea (patch) (side-by-side diff) | |
tree | 8d25f388217c591b7dac1db6c26d0777e6459352 /kaddressbook | |
parent | 4f05a9fcbb9e54184aef93883886aaf865104463 (diff) | |
download | kdepimpi-c9d570427f3d5bead7bee1301514a2d4b82836ea.zip kdepimpi-c9d570427f3d5bead7bee1301514a2d4b82836ea.tar.gz kdepimpi-c9d570427f3d5bead7bee1301514a2d4b82836ea.tar.bz2 |
enhancements to configure external apps like email and phones through a
generalized interface
-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 @@ #endif // KAB_EMBEDDED #include "kcmconfigs/kcmkabconfig.h" #include "kcmconfigs/kcmkdepimconfig.h" +#include "kpimglobalprefs.h" +#include "externalapphandler.h" #include <kresources/selectdialog.h> @@ -467,29 +469,7 @@ void KABCore::sendMail() void KABCore::sendMail( const QString& email ) { -//US original kde implementation : kapp->invokeMailer( email, "" ); - -/*US original qtopia implementation - PimContact c = abList->currentEntry(); - QString name = c.fileAs(); - QString email = c.defaultEmail(); -#ifndef QT_NO_COP - QCopEnvelope e(Service::channel("Email"), "writeMail(QString,QString)"); - e << name << email; -#else -*/ - - -#ifndef QT_NO_COP - QCString channel = KABPrefs::instance()->mEmailChannel.latin1(); - qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")"); - - QCopEnvelope e(channel, "writeMail(QString,QString)"); - //US we need no names in the To field. The emailadresses are enough - e << "" << email; -#else - KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) ); -#endif + bool result = ExternalAppHandler::instance()->mailToContacts(email); } @@ -550,6 +530,10 @@ void KABCore::mailVCard( const QStringList& uids ) urls.append( fileName ); } } + + bool result = ExternalAppHandler::instance()->mailAttachments(urls.join(", ")); + + /*US kapp->invokeMailer( QString::null, QString::null, QString::null, QString::null, // subject @@ -557,19 +541,6 @@ void KABCore::mailVCard( const QStringList& uids ) QString::null, urls ); // attachments */ -#ifndef QT_NO_COP - QCString channel = KABPrefs::instance()->mEmailChannel.latin1(); - qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")"); - - QMap<QString, QString> parameterMap; - parameterMap.insert("ATTACHMENT<n>", urls.join(", ")); - - QCopEnvelope e(channel, "writeMail(QMap(QString,QString))"); - e << parameterMap; -#else - KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) ); -#endif - } @@ -1197,11 +1168,13 @@ QString KABCore::getNameByPhone( const QString &phone ) void KABCore::openConfigDialog() { - KABPrefs* prefs = KABPrefs::instance(); - KCMultiDialog* ConfigureDialog = new KCMultiDialog( prefs, "PIM", this ,"kabconfigdialog", true ); - KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); + KABPrefs* kab_prefs = KABPrefs::instance(); + KPimGlobalPrefs* kpim_prefs = KPimGlobalPrefs::instance(); + + KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); + KCMKabConfig* kabcfg = new KCMKabConfig( kab_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); ConfigureDialog->addModule(kabcfg ); - KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Pim")) , "KCMKdeLibConfig" ); + KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( kpim_prefs, ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); ConfigureDialog->addModule(kdelibcfg ); 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 @@ extern "C" { - KCModule *create_kabconfig( QWidget *parent, const char * ) { - return new KCMKabConfig( parent, "kcmkabconfig" ); + KCModule *create_kabconfig( KABPrefs* prefs, QWidget *parent, const char * ) { + return new KCMKabConfig( prefs, parent, "kcmkabconfig" ); } } -KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) - : KCModule( parent, name ) +KCMKabConfig::KCMKabConfig( KABPrefs* prefs, QWidget *parent, const char *name ) + : KCModule( prefs, parent, name ) { //abort(); QVBoxLayout *layout = new QVBoxLayout( this ); @@ -57,19 +57,19 @@ KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); } -void KCMKabConfig::load(KPrefs* prefs) +void KCMKabConfig::load() { - mConfigWidget->restoreSettings((KABPrefs*)prefs); + mConfigWidget->restoreSettings((KABPrefs*)getPreferences()); } -void KCMKabConfig::save(KPrefs* prefs) +void KCMKabConfig::save() { - mConfigWidget->saveSettings((KABPrefs*)prefs); + mConfigWidget->saveSettings((KABPrefs*)getPreferences()); } -void KCMKabConfig::defaults(KPrefs* prefs) +void KCMKabConfig::defaults() { - mConfigWidget->defaults((KABPrefs*)prefs); + mConfigWidget->defaults((KABPrefs*)getPreferences()); } #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 @@ #include <kcmodule.h> class KABConfigWidget; -class KPrefs; +class KABPrefs; class KCMKabConfig : public KCModule { Q_OBJECT public: - KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); + KCMKabConfig( KABPrefs* prefs, QWidget *parent = 0, const char *name = 0 ); - virtual void load(KPrefs* prefs); - virtual void save(KPrefs* prefs); - virtual void defaults(KPrefs* prefs); + virtual void load(); + virtual void save(); + virtual void defaults(); private: KABConfigWidget *mConfigWidget; |