From 59951e2d851cd9208a21131a6d043d75d2acf28d Mon Sep 17 00:00:00 2001
From: Emmanuel Lepage <emmanuel.lepage@savoirfairelinux.com>
Date: Thu, 22 Sep 2011 09:32:13 -0400
Subject: [PATCH] Add support for some more advanced config options and add
 missing config dialog icons

---
 kde/src/conf/ConfigurationDialog.cpp |  8 ++++----
 kde/src/conf/dlgaccounts.cpp         | 19 +++++++++++++------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/kde/src/conf/ConfigurationDialog.cpp b/kde/src/conf/ConfigurationDialog.cpp
index 870a6a8198..a39a0d2be9 100755
--- a/kde/src/conf/ConfigurationDialog.cpp
+++ b/kde/src/conf/ConfigurationDialog.cpp
@@ -43,12 +43,12 @@ ConfigurationDialog::ConfigurationDialog(SFLPhoneView *parent)
    dlgAddressBook = new DlgAddressBook(this);
    dlgHooks       = new DlgHooks(this);
    
-   addPage( dlgGeneral      , i18n("General")      , "sflphone-client-kde" ); 
+   addPage( dlgGeneral      , i18n("General")      , "sflphone-client-kde"   ); 
    addPage( dlgDisplay      , i18n("Display")      , "applications-graphics" ); 
-   addPage( dlgAccounts     , i18n("Accounts")     , "personal" ); 
-   addPage( dlgAudio        , i18n("Audio")        , "voicecall" ); 
+   addPage( dlgAccounts     , i18n("Accounts")     , "user-identity"         );
+   addPage( dlgAudio        , i18n("Audio")        , "audio-headset"         ); 
    addPage( dlgAddressBook  , i18n("Address Book") , "x-office-address-book" );
-   addPage( dlgHooks        , i18n("Hooks")        , "insert-link" );
+   addPage( dlgHooks        , i18n("Hooks")        , "insert-link"           );
    
    connect(this, SIGNAL(applyClicked()), this,     SLOT(applyCustomSettings()));
    connect(this, SIGNAL(okClicked()),    this,     SLOT(applyCustomSettings()));
diff --git a/kde/src/conf/dlgaccounts.cpp b/kde/src/conf/dlgaccounts.cpp
index beb2949831..2b27108675 100755
--- a/kde/src/conf/dlgaccounts.cpp
+++ b/kde/src/conf/dlgaccounts.cpp
@@ -41,7 +41,7 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent)
    button_accountRemove->setIcon(KIcon("list-remove"));
    accountList = new ConfigAccountList(false);
    loadAccountList();
-        loadCodecList();
+   loadCodecList();
    accountListHasChanged = false;
    //toolButton_accountsApply->setEnabled(false);
    
@@ -59,6 +59,8 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent)
            this,                           SLOT(changedAccountList()));
    connect(spinbox_regExpire,              SIGNAL(editingFinished()),
            this,                           SLOT(changedAccountList()));
+   connect(comboBox_ni_local_address,      SIGNAL(currentIndexChanged (int)),
+           this,                           SLOT(changedAccountList()));
    connect(checkBox_conformRFC,            SIGNAL(clicked(bool)),
            this,                           SLOT(changedAccountList()));
    connect(button_accountUp,               SIGNAL(clicked()),
@@ -246,7 +248,7 @@ void DlgAccounts::saveAccount(QListWidgetItem * item)
    account->setAccountDetail(ACCOUNT_SIP_STUN_SERVER, line_stun->text());
    
    account->setAccountDetail(PUBLISHED_SAMEAS_LOCAL, radioButton_pa_same_as_local->isChecked()?"true":"false");
-   //account->setAccountDetail(PUBLISHED_PORT, spinBox_pa_published_port->value()); //TODO fix
+   account->setAccountDetail(PUBLISHED_PORT, QString::number(spinBox_pa_published_port->value()));
    account->setAccountDetail(PUBLISHED_ADDRESS, lineEdit_pa_published_address ->text());
    
    account->setAccountDetail(LOCAL_PORT,QString::number(spinBox_pa_published_port->value()));
@@ -370,15 +372,20 @@ void DlgAccounts::loadAccount(QListWidgetItem * item)
    
    radioButton_pa_same_as_local->setChecked((account->getAccountDetail(PUBLISHED_SAMEAS_LOCAL)  == "true")?1:0);
    radioButton_pa_custom->setChecked((account->getAccountDetail(PUBLISHED_SAMEAS_LOCAL)  == "true")?1:0);
-   //spinBox_pa_published_port->setValue(account->getAccountDetail(PUBLISHED_PORT)); //TODO fix
+   spinBox_pa_published_port->setValue(account->getAccountDetail(PUBLISHED_PORT).toUInt()); //TODO fix
    lineEdit_pa_published_address->setText(account->getAccountDetail(PUBLISHED_ADDRESS));
    
+   ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
+
+   comboBox_ni_local_address->clear();
+   QStringList interfaceList = configurationManager.getAllIpInterfaceByName();
+   comboBox_ni_local_address->addItems(interfaceList);
+   
    spinBox_pa_published_port->setValue(account->getAccountDetail(LOCAL_PORT).toInt());
-   //comboBox_ni_local_address->setCurentText(account->getAccountDetail(LOCAL_INTERFACE)); //TODO need to load the list first
+   comboBox_ni_local_address->setCurrentIndex(comboBox_ni_local_address->findText(account->getAccountDetail(LOCAL_INTERFACE))); //TODO need to load the list first
 
-   keditlistbox_codec->clear();
-   ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
    QStringList activeCodecList = configurationManager.getActiveAudioCodecList(account->getAccountDetail(ACCOUNT_ID));
+   keditlistbox_codec->clear();
    qDebug() << "Active codecs" << activeCodecList;
    foreach (QString aCodec, activeCodecList) {
       foreach (StringHash _aCodec, codecList) {
-- 
GitLab