summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp44
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
@@ -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 );