author | ulf69 <ulf69> | 2004-09-16 17:23:08 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-16 17:23:08 (UTC) |
commit | c32d7e58ca69196426eee3217140227aca634f52 (patch) (side-by-side diff) | |
tree | 3cc420da278d1035bb45c23d7c70562369f96b7b /libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |
parent | 02e7ae4983679a787834277176a031286a8310c2 (diff) | |
download | kdepimpi-c32d7e58ca69196426eee3217140227aca634f52.zip kdepimpi-c32d7e58ca69196426eee3217140227aca634f52.tar.gz kdepimpi-c32d7e58ca69196426eee3217140227aca634f52.tar.bz2 |
added sip support to external apps
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 44 |
1 files changed, 42 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 @@ -79,16 +79,17 @@ $Id$ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 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() ); QTabWidget *tabWidget = new QTabWidget( this ); topLayout->addWidget( tabWidget ); @@ -194,16 +195,19 @@ void KDEPIMConfigWidget::externalapp_changed( int newApp ) mCurrentClient = mSMSClient; break; case(ExternalAppHandler::FAX): mCurrentClient = mFaxClient; break; case(ExternalAppHandler::PAGER): mCurrentClient = mPagerClient; break; + case(ExternalAppHandler::SIP): + mCurrentClient = mSipClient; + break; default: return; } // and at last update the widgets updateClientWidgets(); } @@ -242,16 +246,19 @@ void KDEPIMConfigWidget::saveEditFieldSettings() mSMSClient = mClient->currentItem(); break; case(ExternalAppHandler::FAX): mFaxClient = mClient->currentItem(); break; case(ExternalAppHandler::PAGER): mPagerClient = mClient->currentItem(); break; + case(ExternalAppHandler::SIP): + mSipClient = mClient->currentItem(); + break; default: return; } //store the current data back to the apropriate membervariables if we had set it to "other" if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) { mEmailOtherChannel = mChannel->text(); @@ -279,16 +286,22 @@ void KDEPIMConfigWidget::saveEditFieldSettings() mFaxOtherMessageParameters = mParameters->text(); } else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) { 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(); + } } void KDEPIMConfigWidget::updateClientWidgets() { bool blocked = signalsBlocked(); blockSignals( true ); @@ -348,40 +361,48 @@ void KDEPIMConfigWidget::updateClientWidgets() mParameters->setText(mFaxOtherMessageParameters); } else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) { 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); + } } } bool readonly; bool enabled; 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 { readonly = true; } 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 { enabled = true; } @@ -453,16 +474,21 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs) mSMSOtherMessage = prefs->mSMSOtherMessage; mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; mPagerClient = prefs->mPagerClient; 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(); blockSignals( blocked ); emit changed( false ); @@ -495,16 +521,22 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) prefs->mSMSOtherMessage = mSMSOtherMessage; prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; prefs->mPagerClient = mPagerClient; 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(); emit changed( false ); } @@ -545,16 +577,24 @@ void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs) dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC); mPagerClient = dai->_id; mPagerOtherChannel = dai->_channel; 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() { emit changed( true ); } |