Skip to content
Snippets Groups Projects
Commit dd28d9c6 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3224] Regroup similar "if" statement in account config dialog

parent 45bc2499
Branches
Tags
No related merge requests found
......@@ -1285,10 +1285,12 @@ void show_account_window (account_t * a) {
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), codecs_tab, gtk_label_new(_("Codecs")));
gtk_notebook_page_num (GTK_NOTEBOOK (notebook), codecs_tab);
// Get protocol
gchar *proto = "SIP";
proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox));
// Do not need these one for the IP2IP account
// Do not need advanced or security one for the IP2IP account
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
// Do not need advanced or Security tab for IAX either
......@@ -1316,12 +1318,18 @@ void show_account_window (account_t * a) {
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook) , 0);
// Run the dialog
/**************/
/* Run dialog */
/**************/
response = gtk_dialog_run (GTK_DIALOG (dialog));
// If accept button is pressed
if(response == GTK_RESPONSE_ACCEPT)
{
// If cancel button is pressed
if(response != GTK_RESPONSE_ACCEPT) {
gtk_widget_destroy (GTK_WIDGET(dialog));
return;
}
// If accept button is
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties,
......@@ -1339,12 +1347,6 @@ void show_account_window (account_t * a) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_USERNAME),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername))));
if(strcmp(proto, "SIP") == 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ROUTE),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet))));
}
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_PASSWORD),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryPassword))));
......@@ -1361,6 +1363,10 @@ void show_account_window (account_t * a) {
if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) {
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_ROUTE),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryRouteSet))));
g_hash_table_replace(currentAccount->properties,
g_strdup(ACCOUNT_USERAGENT),
g_strdup(gtk_entry_get_text (GTK_ENTRY(entryUseragent))));
......@@ -1468,12 +1474,7 @@ void show_account_window (account_t * a) {
// Perpetuate changes to the deamon
codec_list_update_to_daemon (currentAccount);
}
else {
DEBUG("IP to IP call\n");
// Direct IP calls config
// dbus_set_ip2ip_details (directIpCallsProperties);
}
gtk_widget_destroy (GTK_WIDGET(dialog));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment