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

[#2383] Fix stun set active or not when opening config

parent cda5ca9f
No related branches found
No related tags found
No related merge requests found
...@@ -163,6 +163,10 @@ static GtkWidget * create_basic_tab(account_t **a) ...@@ -163,6 +163,10 @@ static GtkWidget * create_basic_tab(account_t **a)
curMailbox = g_hash_table_lookup(currentAccount->properties, ACCOUNT_MAILBOX); curMailbox = g_hash_table_lookup(currentAccount->properties, ACCOUNT_MAILBOX);
} }
DEBUG("-------- Basic parameters from config");
DEBUG("curAccountID %s, curAccountType %s, curAccountEnabled %s, curAlias %s, curHostname %s, curPassword %s, curUsername %s, curMailbox %s\n", curAccountID, curAccountType, curAccountEnabled, curAlias, curHostname, curPassword, curUsername, curMailbox);
gnome_main_section_new (_("Account Parameters"), &frame); gnome_main_section_new (_("Account Parameters"), &frame);
gtk_widget_show(frame); gtk_widget_show(frame);
...@@ -677,6 +681,8 @@ GtkWidget * create_advanced_tab(account_t **a) ...@@ -677,6 +681,8 @@ GtkWidget * create_advanced_tab(account_t **a)
published_port = g_hash_table_lookup(currentAccount->properties, PUBLISHED_PORT); published_port = g_hash_table_lookup(currentAccount->properties, PUBLISHED_PORT);
stun_enable = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_ENABLED); stun_enable = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_ENABLED);
stun_server = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_SERVER); stun_server = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_SERVER);
DEBUG("-------- Advanced parameters from config");
DEBUG("resolve_once %s, account_expire %s, use_tls %s, published_address %s, published_port %s, local_address %s, local_port %s, stun_enable %s, stun_server %s\n", resolve_once, account_expire, use_tls, published_address, published_port, local_address, local_port, stun_enable, stun_server);
} }
gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3); gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3);
...@@ -761,6 +767,9 @@ GtkWidget * create_advanced_tab(account_t **a) ...@@ -761,6 +767,9 @@ GtkWidget * create_advanced_tab(account_t **a)
gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2); gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2);
/**
* Published address field
*/
gnome_main_section_new_with_table (_("Published address"), &frame, &table, 2, 3); gnome_main_section_new_with_table (_("Published address"), &frame, &table, 2, 3);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER(table), 10); gtk_container_set_border_width (GTK_CONTAINER(table), 10);
...@@ -769,6 +778,8 @@ GtkWidget * create_advanced_tab(account_t **a) ...@@ -769,6 +778,8 @@ GtkWidget * create_advanced_tab(account_t **a)
useStunCheckBox = gtk_check_button_new_with_mnemonic(_("Using STUN")); useStunCheckBox = gtk_check_button_new_with_mnemonic(_("Using STUN"));
gtk_table_attach_defaults(GTK_TABLE(table), useStunCheckBox, 0, 1, 0, 1); gtk_table_attach_defaults(GTK_TABLE(table), useStunCheckBox, 0, 1, 0, 1);
gtk_toggle_button_set_active (GTK_WIDGET(useStunCheckBox),
g_strcasecmp(stun_enable, "true") == 0 ? TRUE: FALSE);
gtk_widget_set_sensitive (GTK_WIDGET(useStunCheckBox), gtk_widget_set_sensitive (GTK_WIDGET(useStunCheckBox),
g_strcasecmp(use_tls,"true") == 0 ? FALSE: TRUE); g_strcasecmp(use_tls,"true") == 0 ? FALSE: TRUE);
...@@ -1006,9 +1017,35 @@ show_account_window (account_t * a) ...@@ -1006,9 +1017,35 @@ show_account_window (account_t * a)
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(PUBLISHED_ADDRESS), g_strdup(PUBLISHED_ADDRESS),
g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedAddressEntry)))); g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedAddressEntry))));
DEBUG("-------- Basic parameters to ne written in config");
DEBUG("curAccountID %s, curAccountType %s, curAlias %s, curHostname %s, curPassword %s, curUsername %s, curMailbox %s\n",
(gchar *)currentAccount->accountID,
(gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryHostname)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryPassword)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox))
);
DEBUG("-------- Advanced parameters to be written");
DEBUG("resolve_once %s, account_expire %s, use_tls %s, published_address %s, published_port %s, local_address %s, local_port %s, stun_enable %s, stun_server %s\n",
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true",
(gchar *)gtk_entry_get_text(GTK_ENTRY(expireSpinBox)),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox)) ? "true":"false",
(gchar *)gtk_entry_get_text(GTK_ENTRY(publishedPortSpinBox)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(publishedAddressEntry)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)),
(gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox)) ? "true":"false",
gtk_entry_get_text(GTK_ENTRY(stunServerEntry))
);
} }
/* Set new credentials if any */ /* Set new credentials if any */
DEBUG("Setting credentials"); DEBUG("Setting credentials");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment