-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 44 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.h | 5 |
2 files changed, 47 insertions, 2 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 4f4cc6a..703aeb1 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -83,8 +83,9 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); + mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); @@ -198,8 +199,11 @@ void KDEPIMConfigWidget::externalapp_changed( int newApp ) break; case(ExternalAppHandler::PAGER): mCurrentClient = mPagerClient; break; + case(ExternalAppHandler::SIP): + mCurrentClient = mSipClient; + break; default: return; } @@ -246,8 +250,11 @@ void KDEPIMConfigWidget::saveEditFieldSettings() break; case(ExternalAppHandler::PAGER): mPagerClient = mClient->currentItem(); break; + case(ExternalAppHandler::SIP): + mSipClient = mClient->currentItem(); + break; default: return; } @@ -283,8 +290,14 @@ void KDEPIMConfigWidget::saveEditFieldSettings() mPagerOtherChannel = mChannel->text(); mPagerOtherMessage = mMessage->text(); mPagerOtherMessageParameters = mParameters->text(); } + else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) + { + mSipOtherChannel = mChannel->text(); + mSipOtherMessage = mMessage->text(); + mSipOtherMessageParameters = mParameters->text(); + } } @@ -352,8 +365,14 @@ void KDEPIMConfigWidget::updateClientWidgets() mChannel->setText(mPagerOtherChannel); mMessage->setText(mPagerOtherMessage); mParameters->setText(mPagerOtherMessageParameters); } + else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) + { + mChannel->setText(mSipOtherChannel); + mMessage->setText(mSipOtherMessage); + mParameters->setText(mSipOtherMessageParameters); + } } } @@ -362,9 +381,10 @@ void KDEPIMConfigWidget::updateClientWidgets() if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) - ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))) + ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) + ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) { readonly = false; } else @@ -375,9 +395,10 @@ void KDEPIMConfigWidget::updateClientWidgets() if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) - ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))) + ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) + ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) { enabled = false; } else @@ -457,8 +478,13 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs) mPagerOtherChannel = prefs->mPagerOtherChannel; mPagerOtherMessage = prefs->mPagerOtherMessage; mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; + mSipClient = prefs->mPagerClient; + mSipOtherChannel = prefs->mSipOtherChannel; + mSipOtherMessage = prefs->mSipOtherMessage; + mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; + mCurrentApp = ExternalAppHandler::EMAIL; mCurrentClient = mEmailClient; updateClientWidgets(); @@ -499,8 +525,14 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) prefs->mPagerOtherChannel = mPagerOtherChannel; prefs->mPagerOtherMessage = mPagerOtherMessage; prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; + + prefs->mSipClient = mSipClient; + prefs->mSipOtherChannel = mSipOtherChannel; + prefs->mSipOtherMessage = mSipOtherMessage; + prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; + prefs->writeConfig(); //release the cache that other views can access the changed values instantanious ExternalAppHandler::instance()->loadConfig(); @@ -549,8 +581,16 @@ void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs) mPagerOtherMessage = dai->_message; mPagerOtherMessageParameters = dai->_parameters; + dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC); + + mSipClient = dai->_id; + mSipOtherChannel = dai->_channel; + mSipOtherMessage = dai->_message; + mSipOtherMessageParameters = dai->_parameters; + + emit changed( true ); } void KDEPIMConfigWidget::modified() diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h index 6e02544..e3cfd81 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.h +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h @@ -129,8 +129,13 @@ class KDEPIMConfigWidget : public QWidget QString mPagerOtherChannel; QString mPagerOtherMessage; QString mPagerOtherMessageParameters; + int mSipClient; + QString mSipOtherChannel; + QString mSipOtherMessage; + QString mSipOtherMessageParameters; + QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; |