summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs
authorulf69 <ulf69>2004-09-16 17:23:08 (UTC)
committer ulf69 <ulf69>2004-09-16 17:23:08 (UTC)
commitc32d7e58ca69196426eee3217140227aca634f52 (patch) (side-by-side diff)
tree3cc420da278d1035bb45c23d7c70562369f96b7b /libkdepim/kcmconfigs
parent02e7ae4983679a787834277176a031286a8310c2 (diff)
downloadkdepimpi-c32d7e58ca69196426eee3217140227aca634f52.zip
kdepimpi-c32d7e58ca69196426eee3217140227aca634f52.tar.gz
kdepimpi-c32d7e58ca69196426eee3217140227aca634f52.tar.bz2
added sip support to external apps
Diffstat (limited to 'libkdepim/kcmconfigs') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp44
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h5
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
@@ -81,12 +81,13 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *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 );
@@ -196,12 +197,15 @@ void KDEPIMConfigWidget::externalapp_changed( int newApp )
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();
@@ -244,12 +248,15 @@ void KDEPIMConfigWidget::saveEditFieldSettings()
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))
@@ -281,12 +288,18 @@ void KDEPIMConfigWidget::saveEditFieldSettings()
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()
{
@@ -350,36 +363,44 @@ void KDEPIMConfigWidget::updateClientWidgets()
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;
@@ -455,12 +476,17 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs)
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 );
@@ -497,12 +523,18 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs)
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 );
@@ -547,12 +579,20 @@ void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs)
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 );
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
@@ -127,12 +127,17 @@ class KDEPIMConfigWidget : public QWidget
int mPagerClient;
QString mPagerOtherChannel;
QString mPagerOtherMessage;
QString mPagerOtherMessageParameters;
+ int mSipClient;
+ QString mSipOtherChannel;
+ QString mSipOtherMessage;
+ QString mSipOtherMessageParameters;
+
QMap<ExternalAppHandler::Types, QString> mExternalAppsMap;
// AddresseeWidget *mAddresseeWidget;
};