Commit 55ee263e authored by Emmanuel Lepage's avatar Emmanuel Lepage

Fix "same as local" account setting, fix IP2IP LED color

parent 59951e2d
......@@ -32,7 +32,7 @@ void AccountView::initItemWidget()
if(isNew() || !enabled)
itemWidget->setState(AccountItemWidget::Unregistered);
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED || getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_READY)
itemWidget->setState(AccountItemWidget::Registered);
else
itemWidget->setState(AccountItemWidget::NotWorking);
......@@ -53,7 +53,7 @@ QColor AccountView::getStateColor()
{
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED)
return Qt::black;
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED || getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_READY)
return Qt::darkGreen;
return Qt::red;
}
......@@ -63,7 +63,7 @@ QString AccountView::getStateColorName()
{
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED)
return "black";
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED || getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_READY)
return "darkGreen";
return "red";
}
......@@ -105,7 +105,7 @@ void AccountView::updateState()
qDebug() << "itemWidget->setState(AccountItemWidget::Unregistered);";
itemWidget->setState(AccountItemWidget::Unregistered);
}
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) {
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED || getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_READY) {
qDebug() << "itemWidget->setState(AccountItemWidget::Registered);";
itemWidget->setState(AccountItemWidget::Registered);
}
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include "ConfigurationDialog.h"
#include "conf/ConfigurationSkeleton.h"
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#include "dlgaccounts.h"
#include <QtGui/QInputDialog>
......@@ -35,102 +35,64 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent)
setupUi(this);
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
button_accountUp->setIcon(KIcon("go-up"));
button_accountDown->setIcon(KIcon("go-down"));
button_accountAdd->setIcon(KIcon("list-add"));
button_accountRemove->setIcon(KIcon("list-remove"));
button_accountUp->setIcon (KIcon("go-up") );
button_accountDown->setIcon (KIcon("go-down") );
button_accountAdd->setIcon (KIcon("list-add") );
button_accountRemove->setIcon (KIcon("list-remove") );
accountList = new ConfigAccountList(false);
loadAccountList();
loadCodecList();
accountListHasChanged = false;
//toolButton_accountsApply->setEnabled(false);
connect(edit1_alias, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit2_protocol, SIGNAL(activated(int)),
this, SLOT(changedAccountList()));
connect(edit3_server, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit4_user, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit5_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit6_mailbox, SIGNAL(textEdited(const QString &)),
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()),
this, SLOT(changedAccountList()));
connect(button_accountDown, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountAdd, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(button_accountRemove, SIGNAL(clicked()),
this, SLOT(changedAccountList()));
connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(spinbox_tls_listener, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(file_tls_authority, SIGNAL(textChanged(const QString &)),
this, SLOT(changedAccountList()));
connect(file_tls_endpoint, SIGNAL(textChanged(const QString &)),
this, SLOT(changedAccountList()));
connect(file_tls_private_key, SIGNAL(textChanged(const QString &)),
this, SLOT(changedAccountList()));
connect(combo_tls_method, SIGNAL(currentIndexChanged(int)),
this, SLOT(changedAccountList()));
connect(edit_tls_cipher, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(edit_tls_outgoing, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(spinbox_tls_timeout_sec, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(spinbox_tls_timeout_msec, SIGNAL(editingFinished()),
this, SLOT(changedAccountList()));
connect(check_tls_incoming, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(check_tls_answer, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(check_tls_requier_cert, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(group_security_tls, SIGNAL(clicked(bool)),
this, SLOT(changedAccountList()));
connect(&configurationManager, SIGNAL(accountsChanged()),
this, SLOT(updateAccountStates()));
connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)),
this, SLOT(changedAccountList()));
connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons()));
connect(keditlistbox_codec->listView(), SIGNAL(clicked(QModelIndex)),
this, SLOT(codecClicked(QModelIndex)));
connect(keditlistbox_codec->addButton(), SIGNAL(clicked()),
this, SLOT(addCodec()));
connect(keditlistbox_codec, SIGNAL(changed()),
this, SLOT(codecChanged()));
connect(combo_security_STRP, SIGNAL(currentIndexChanged(int)),
this, SLOT(updateCombo(int)));
connect(button_add_credential, SIGNAL(clicked()),
this, SLOT(addCredential()));
connect(button_remove_credential, SIGNAL(clicked()),
this, SLOT(removeCredential()));
connect(list_credential, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this,SLOT( selectCredential(QListWidgetItem*, QListWidgetItem*)));
//SLOTS
// SENDER SIGNAL RECEIVER SLOT /
connect(edit1_alias, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(edit2_protocol, SIGNAL(activated(int)) , this , SLOT(changedAccountList() ));
connect(edit3_server, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(edit4_user, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(edit5_password, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(edit6_mailbox, SIGNAL(textEdited(const QString &)) , 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()) , this , SLOT(changedAccountList() ));
connect(button_accountDown, SIGNAL(clicked()) , this , SLOT(changedAccountList() ));
connect(button_accountAdd, SIGNAL(clicked()) , this , SLOT(changedAccountList() ));
connect(button_accountRemove, SIGNAL(clicked()) , this , SLOT(changedAccountList() ));
connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(spinbox_tls_listener, SIGNAL(editingFinished()) , this , SLOT(changedAccountList() ));
connect(file_tls_authority, SIGNAL(textChanged(const QString &)), this , SLOT(changedAccountList() ));
connect(file_tls_endpoint, SIGNAL(textChanged(const QString &)), this , SLOT(changedAccountList() ));
connect(file_tls_private_key, SIGNAL(textChanged(const QString &)), this , SLOT(changedAccountList() ));
connect(combo_tls_method, SIGNAL(currentIndexChanged(int)) , this , SLOT(changedAccountList() ));
connect(edit_tls_cipher, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(edit_tls_outgoing, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(spinbox_tls_timeout_sec, SIGNAL(editingFinished()) , this , SLOT(changedAccountList() ));
connect(spinbox_tls_timeout_msec, SIGNAL(editingFinished()) , this , SLOT(changedAccountList() ));
connect(check_tls_incoming, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() ));
connect(check_tls_answer, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() ));
connect(check_tls_requier_cert, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() ));
connect(group_security_tls, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() ));
connect(radioButton_pa_same_as_local, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() ));
connect(radioButton_pa_custom, SIGNAL(clicked(bool)) , this , SLOT(changedAccountList() ));
connect(&configurationManager, SIGNAL(accountsChanged()) , this , SLOT(updateAccountStates() ));
connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)) , this , SLOT(changedAccountList() ));
connect(this, SIGNAL(updateButtons()) , parent , SLOT(updateButtons() ));
connect(keditlistbox_codec->listView(), SIGNAL(clicked(QModelIndex)) , this , SLOT(codecClicked(QModelIndex) ));
connect(keditlistbox_codec->addButton(),SIGNAL(clicked()) , this , SLOT(addCodec() ));
connect(keditlistbox_codec, SIGNAL(changed()) , this , SLOT(codecChanged() ));
connect(combo_security_STRP, SIGNAL(currentIndexChanged(int)) , this , SLOT(updateCombo(int) ));
connect(button_add_credential, SIGNAL(clicked()) , this , SLOT(addCredential() ));
connect(button_remove_credential, SIGNAL(clicked()) , this , SLOT(removeCredential() ));
/* */
connect(list_credential, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this,SLOT( selectCredential(QListWidgetItem*, QListWidgetItem*)));
//Disable control
connect(radioButton_pa_same_as_local, SIGNAL(clicked(bool)) , this , SLOT(enablePublished()));
connect(radioButton_pa_custom, SIGNAL(clicked(bool)) , this , SLOT(enablePublished()));
}
void DlgAccounts::saveAccountList()
......@@ -210,68 +172,54 @@ void DlgAccounts::saveAccount(QListWidgetItem * item)
qDebug() << "Attempting to save details of an unexisting account : " << item->text();
return;
}
account->setAccountDetail(ACCOUNT_ALIAS, edit1_alias->text());
account->setAccountDetail(ACCOUNT_TYPE, protocolsTab[edit2_protocol->currentIndex()]);
account->setAccountDetail(ACCOUNT_HOSTNAME, edit3_server->text());
account->setAccountDetail(ACCOUNT_USERNAME, edit4_user->text());
account->setAccountDetail(ACCOUNT_PASSWORD, edit5_password->text());
account->setAccountDetail(ACCOUNT_MAILBOX, edit6_mailbox->text());
account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE);
//Security
account->setAccountDetail(TLS_PASSWORD,edit_tls_private_key_password->text());
account->setAccountDetail(TLS_LISTENER_PORT,QString::number(spinbox_tls_listener->value()));
account->setAccountDetail(TLS_CA_LIST_FILE,file_tls_authority->text());
account->setAccountDetail(TLS_CERTIFICATE_FILE,file_tls_endpoint->text());
account->setAccountDetail(TLS_PRIVATE_KEY_FILE,file_tls_private_key->text());
//qDebug() << "\n\n\n\nSET: " << combo_tls_method->currentText() << "\n\n\n";
account->setAccountDetail(TLS_METHOD,combo_tls_method->currentText());
account->setAccountDetail(TLS_CIPHERS,edit_tls_cipher->text());
account->setAccountDetail(TLS_SERVER_NAME,edit_tls_outgoing->text());
account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC,QString::number(spinbox_tls_timeout_sec->value()));
account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC,QString::number(spinbox_tls_timeout_msec->value()));
account->setAccountDetail(TLS_VERIFY_SERVER,check_tls_incoming->isChecked()?"true":"false");
account->setAccountDetail(TLS_VERIFY_CLIENT,check_tls_answer->isChecked()?"true":"false");
account->setAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE,check_tls_requier_cert->isChecked()?"true":"false");
account->setAccountDetail(TLS_ENABLE,group_security_tls->isChecked()?"true":"false");
qDebug() << "ZRTP: " << combo_security_STRP->currentIndex();
account->setAccountDetail(TLS_METHOD, QString::number(combo_security_STRP->currentIndex()));
account->setAccountDetail(ACCOUNT_DISPLAY_SAS_ONCE, checkbox_ZRTP_Ask_user->isChecked()?"true":"false");
account->setAccountDetail(ACCOUNT_SRTP_RTP_FALLBACK, checkbox_SDES_fallback_rtp->isChecked()?"true":"false");
account->setAccountDetail(ACCOUNT_ZRTP_DISPLAY_SAS, checkbox_ZRTP_display_SAS->isChecked()?"true":"false");
account->setAccountDetail(ACCOUNT_ZRTP_NOT_SUPP_WARNING, checkbox_ZRTP_warn_supported->isChecked()?"true":"false");
account->setAccountDetail(ACCOUNT_ZRTP_HELLO_HASH, checkbox_ZTRP_send_hello->isChecked()?"true":"false");
account->setAccountDetail(ACCOUNT_SIP_STUN_ENABLED, checkbox_stun->isChecked()?"true":"false");
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, 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()));
account->setAccountDetail(LOCAL_INTERFACE,comboBox_ni_local_address->currentText());
//ACCOUNT DETAILS
// FIELD WIDGET VALUE /
/**/account->setAccountDetail( ACCOUNT_ALIAS , edit1_alias->text() );
/**/account->setAccountDetail( ACCOUNT_TYPE , protocolsTab[edit2_protocol->currentIndex()] );
/**/account->setAccountDetail( ACCOUNT_HOSTNAME , edit3_server->text() );
/**/account->setAccountDetail( ACCOUNT_USERNAME , edit4_user->text() );
/**/account->setAccountDetail( ACCOUNT_PASSWORD , edit5_password->text() );
/**/account->setAccountDetail( ACCOUNT_MAILBOX , edit6_mailbox->text() );
/**/account->setAccountDetail( ACCOUNT_ENABLED , account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE );
/**/ /**/
/* Security */
/**/account->setAccountDetail( TLS_PASSWORD , edit_tls_private_key_password->text() );
/**/account->setAccountDetail( TLS_LISTENER_PORT , QString::number(spinbox_tls_listener->value()) );
/**/account->setAccountDetail( TLS_CA_LIST_FILE , file_tls_authority->text() );
/**/account->setAccountDetail( TLS_CERTIFICATE_FILE , file_tls_endpoint->text() );
/**/account->setAccountDetail( TLS_PRIVATE_KEY_FILE , file_tls_private_key->text() );
/**/account->setAccountDetail( TLS_METHOD , combo_tls_method->currentText() );
/**/account->setAccountDetail( TLS_CIPHERS , edit_tls_cipher->text() );
/**/account->setAccountDetail( TLS_SERVER_NAME , edit_tls_outgoing->text() );
/**/account->setAccountDetail( TLS_NEGOTIATION_TIMEOUT_SEC , QString::number(spinbox_tls_timeout_sec->value()) );
/**/account->setAccountDetail( TLS_NEGOTIATION_TIMEOUT_MSEC , QString::number(spinbox_tls_timeout_msec->value()) );
/**/account->setAccountDetail( TLS_METHOD , QString::number(combo_security_STRP->currentIndex()) );
/**/account->setAccountDetail( TLS_VERIFY_SERVER , check_tls_incoming->isChecked() ?"true":"false" );
/**/account->setAccountDetail( TLS_VERIFY_CLIENT , check_tls_answer->isChecked() ?"true":"false" );
/**/account->setAccountDetail( TLS_REQUIRE_CLIENT_CERTIFICATE , check_tls_requier_cert->isChecked() ?"true":"false" );
/**/account->setAccountDetail( TLS_ENABLE , group_security_tls->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_DISPLAY_SAS_ONCE , checkbox_ZRTP_Ask_user->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_SRTP_RTP_FALLBACK , checkbox_SDES_fallback_rtp->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_ZRTP_DISPLAY_SAS , checkbox_ZRTP_display_SAS->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_ZRTP_NOT_SUPP_WARNING , checkbox_ZRTP_warn_supported->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_ZRTP_HELLO_HASH , checkbox_ZTRP_send_hello->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_SIP_STUN_ENABLED , checkbox_stun->isChecked() ?"true":"false" );
/**/account->setAccountDetail( PUBLISHED_SAMEAS_LOCAL , radioButton_pa_same_as_local->isChecked() ?"true":"false" );
/**/account->setAccountDetail( ACCOUNT_SIP_STUN_SERVER , line_stun->text() );
/**/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()) );
/**/account->setAccountDetail( LOCAL_INTERFACE , comboBox_ni_local_address->currentText() );
// /
QStringList _codecList;
qDebug() << keditlistbox_codec->items() << codecList;
foreach (QString aCodec, keditlistbox_codec->items()) {
foreach (StringHash _aCodec, codecList) {
if (_aCodec["alias"] == aCodec) {
qDebug() << "Saving:" << _aCodec["id"];
_codecList << _aCodec["id"];
}
}
// }
// foreach (QString aCodec, keditlistbox_codec->items()) {
// foreach (StringHash aCodec, codecList) {
// if (aCodec["alias"] == keditlistbox_codec->currentText()) {
// label_bandwidth_value->setText(aCodec["bandwidth"]);
// label_bitrate_value->setText(aCodec["bitrate"]);
// label_frequency_value->setText(aCodec["frequency"]);
// }
// }
}
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
......@@ -339,39 +287,37 @@ void DlgAccounts::loadAccount(QListWidgetItem * item)
switch (account->getAccountDetail(TLS_METHOD ).toInt()) {
case 0: //KEY_EXCHANGE_NONE
checkbox_SDES_fallback_rtp->setVisible(false);
checkbox_ZRTP_Ask_user->setVisible(false);
checkbox_ZRTP_display_SAS->setVisible(false);
checkbox_ZRTP_warn_supported->setVisible(false);
checkbox_ZTRP_send_hello->setVisible(false);
checkbox_SDES_fallback_rtp->setVisible ( false );
checkbox_ZRTP_Ask_user->setVisible ( false );
checkbox_ZRTP_display_SAS->setVisible ( false );
checkbox_ZRTP_warn_supported->setVisible ( false );
checkbox_ZTRP_send_hello->setVisible ( false );
break;
case 1: //ZRTP
checkbox_SDES_fallback_rtp->setVisible(false);
checkbox_ZRTP_Ask_user->setVisible(true);
checkbox_ZRTP_display_SAS->setVisible(true);
checkbox_ZRTP_warn_supported->setVisible(true);
checkbox_ZTRP_send_hello->setVisible(true);
checkbox_SDES_fallback_rtp->setVisible ( false );
checkbox_ZRTP_Ask_user->setVisible ( true );
checkbox_ZRTP_display_SAS->setVisible ( true );
checkbox_ZRTP_warn_supported->setVisible ( true );
checkbox_ZTRP_send_hello->setVisible ( true );
break;
case 2: //SDES
checkbox_SDES_fallback_rtp->setVisible(true);
checkbox_ZRTP_Ask_user->setVisible(false);
checkbox_ZRTP_display_SAS->setVisible(false);
checkbox_ZRTP_warn_supported->setVisible(false);
checkbox_ZTRP_send_hello->setVisible(false);
checkbox_SDES_fallback_rtp->setVisible ( true );
checkbox_ZRTP_Ask_user->setVisible ( false );
checkbox_ZRTP_display_SAS->setVisible ( false );
checkbox_ZRTP_warn_supported->setVisible ( false );
checkbox_ZTRP_send_hello->setVisible ( false );
break;
}
checkbox_ZRTP_Ask_user->setChecked((account->getAccountDetail(ACCOUNT_DISPLAY_SAS_ONCE) == "true")?1:0);
checkbox_SDES_fallback_rtp->setChecked((account->getAccountDetail(ACCOUNT_SRTP_RTP_FALLBACK) == "true")?1:0);
checkbox_ZRTP_display_SAS->setChecked((account->getAccountDetail(ACCOUNT_ZRTP_DISPLAY_SAS) == "true")?1:0);
checkbox_ZRTP_Ask_user->setChecked((account->getAccountDetail(ACCOUNT_DISPLAY_SAS_ONCE) == "true")?1:0);
checkbox_SDES_fallback_rtp->setChecked((account->getAccountDetail(ACCOUNT_SRTP_RTP_FALLBACK) == "true")?1:0);
checkbox_ZRTP_display_SAS->setChecked((account->getAccountDetail(ACCOUNT_ZRTP_DISPLAY_SAS) == "true")?1:0);
checkbox_ZRTP_warn_supported->setChecked((account->getAccountDetail(ACCOUNT_ZRTP_NOT_SUPP_WARNING) == "true")?1:0);
checkbox_ZTRP_send_hello->setChecked((account->getAccountDetail(ACCOUNT_ZRTP_HELLO_HASH) == "true")?1:0);
checkbox_stun->setChecked((account->getAccountDetail(ACCOUNT_SIP_STUN_ENABLED) == "true")?1:0);
checkbox_ZTRP_send_hello->setChecked((account->getAccountDetail(ACCOUNT_ZRTP_HELLO_HASH) == "true")?1:0);
checkbox_stun->setChecked((account->getAccountDetail(ACCOUNT_SIP_STUN_ENABLED) == "true")?1:0);
line_stun->setText(account->getAccountDetail(ACCOUNT_SIP_STUN_SERVER));
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);
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).toUInt()); //TODO fix
lineEdit_pa_published_address->setText(account->getAccountDetail(PUBLISHED_ADDRESS));
......@@ -381,7 +327,7 @@ void DlgAccounts::loadAccount(QListWidgetItem * item)
QStringList interfaceList = configurationManager.getAllIpInterfaceByName();
comboBox_ni_local_address->addItems(interfaceList);
spinBox_pa_published_port->setValue(account->getAccountDetail(LOCAL_PORT).toInt());
spinBox_ni_local_port->setValue(account->getAccountDetail(LOCAL_PORT).toInt());
comboBox_ni_local_address->setCurrentIndex(comboBox_ni_local_address->findText(account->getAccountDetail(LOCAL_INTERFACE))); //TODO need to load the list first
QStringList activeCodecList = configurationManager.getActiveAudioCodecList(account->getAccountDetail(ACCOUNT_ID));
......@@ -569,10 +515,10 @@ void DlgAccounts::updateAccountListCommands()
buttonsEnabled[1] = false;
}
button_accountUp->setEnabled(buttonsEnabled[0]);
button_accountDown->setEnabled(buttonsEnabled[1]);
button_accountAdd->setEnabled(buttonsEnabled[2]);
button_accountRemove->setEnabled(buttonsEnabled[3]);
button_accountUp->setEnabled ( buttonsEnabled[0] );
button_accountDown->setEnabled ( buttonsEnabled[1] );
button_accountAdd->setEnabled ( buttonsEnabled[2] );
button_accountRemove->setEnabled ( buttonsEnabled[3] );
}
void DlgAccounts::updateAccountStates()
......@@ -796,3 +742,9 @@ void DlgAccounts::removeCredential() {
qDebug() << "I am here";
list_credential->takeItem(list_credential->currentRow());
}
void DlgAccounts::enablePublished()
{
lineEdit_pa_published_address->setDisabled(radioButton_pa_same_as_local->isChecked());
spinBox_pa_published_port->setDisabled(radioButton_pa_same_as_local->isChecked());
}
......@@ -150,6 +150,7 @@ private slots:
void selectCredential(QListWidgetItem* item, QListWidgetItem* previous);
void loadCredentails(QString accountId);
void saveCredential(QString accountId);
void enablePublished();
signals:
......
......@@ -177,6 +177,7 @@
/** Account States */
#define ACCOUNT_STATE_REGISTERED "REGISTERED"
#define ACCOUNT_STATE_READY "READY"
#define ACCOUNT_STATE_UNREGISTERED "UNREGISTERED"
#define ACCOUNT_STATE_TRYING "TRYING"
#define ACCOUNT_STATE_ERROR "ERROR"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment