Skip to content
Snippets Groups Projects
Commit 6683a03b authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Merge branch 'conference'

parents 47476794 eafd7b2c
Branches
Tags
No related merge requests found
...@@ -165,8 +165,8 @@ static GtkWidget * create_basic_tab(account_t **a) ...@@ -165,8 +165,8 @@ 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("-------- 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); // 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);
...@@ -486,11 +486,12 @@ static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED) ...@@ -486,11 +486,12 @@ static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED)
static use_stun_cb(GtkWidget * widget, gpointer data UNUSED) static use_stun_cb(GtkWidget * widget, gpointer data UNUSED)
{ {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Showing stun options"); DEBUG("Showing stun options, hiding Local/Published info");
gtk_widget_show(stunServerLabel); gtk_widget_show(stunServerLabel);
gtk_widget_show(stunServerEntry); gtk_widget_show(stunServerEntry);
gtk_widget_set_sensitive(sameAsLocalRadioButton, FALSE); gtk_widget_set_sensitive(sameAsLocalRadioButton, FALSE);
gtk_widget_set_sensitive(publishedAddrRadioButton, FALSE); gtk_widget_set_sensitive(publishedAddrRadioButton, FALSE);
DEBUG("Problem occurs here");
gtk_widget_hide(publishedAddressLabel); gtk_widget_hide(publishedAddressLabel);
gtk_widget_hide(publishedPortLabel); gtk_widget_hide(publishedPortLabel);
gtk_widget_hide(publishedAddressEntry); gtk_widget_hide(publishedAddressEntry);
...@@ -703,11 +704,11 @@ GtkWidget * create_security_tab(account_t **a) ...@@ -703,11 +704,11 @@ GtkWidget * create_security_tab(account_t **a)
gtk_widget_size_request(GTK_WIDGET(table), &requisitionTable); gtk_widget_size_request(GTK_WIDGET(table), &requisitionTable);
gtk_widget_set_size_request(GTK_WIDGET(scrolledWindowCredential), requisitionTable.width, 120); gtk_widget_set_size_request(GTK_WIDGET(scrolledWindowCredential), requisitionTable.width, 120);
gtk_widget_show_all(ret);
same_as_local_cb(sameAsLocalRadioButton, NULL); same_as_local_cb(sameAsLocalRadioButton, NULL);
set_published_addr_manually_cb(publishedAddrRadioButton, NULL); set_published_addr_manually_cb(publishedAddrRadioButton, NULL);
gtk_widget_show_all(ret);
return ret; return ret;
} }
...@@ -751,8 +752,8 @@ GtkWidget * create_advanced_tab(account_t **a) ...@@ -751,8 +752,8 @@ GtkWidget * create_advanced_tab(account_t **a)
stun_server = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_SERVER); stun_server = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_SERVER);
published_sameas_local = g_hash_table_lookup(currentAccount->properties, PUBLISHED_SAMEAS_LOCAL); published_sameas_local = g_hash_table_lookup(currentAccount->properties, PUBLISHED_SAMEAS_LOCAL);
DEBUG("-------- Advanced parameters from config"); // 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, published_sameas_local %s\n", resolve_once, account_expire, use_tls, published_address, published_port, local_address, local_port, stun_enable, stun_server, published_sameas_local); // 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, published_sameas_local %s\n", resolve_once, account_expire, use_tls, published_address, published_port, local_address, local_port, stun_enable, stun_server, published_sameas_local);
} }
gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3); gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3);
...@@ -805,6 +806,7 @@ GtkWidget * create_advanced_tab(account_t **a) ...@@ -805,6 +806,7 @@ GtkWidget * create_advanced_tab(account_t **a)
gtk_list_store_append(ipInterfaceListStore, &iter ); gtk_list_store_append(ipInterfaceListStore, &iter );
gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 );
current_local_address_iter = iter;
if (g_strcmp0(*iface, local_address) == 0) { if (g_strcmp0(*iface, local_address) == 0) {
DEBUG("Setting active local address combo box"); DEBUG("Setting active local address combo box");
current_local_address_iter = iter; current_local_address_iter = iter;
...@@ -875,8 +877,6 @@ GtkWidget * create_advanced_tab(account_t **a) ...@@ -875,8 +877,6 @@ GtkWidget * create_advanced_tab(account_t **a)
gtk_widget_show_all(ret); gtk_widget_show_all(ret);
use_stun_cb (GTK_WIDGET (useStunCheckBox), NULL);
publishedAddressLabel = gtk_label_new_with_mnemonic (_("Published address")); publishedAddressLabel = gtk_label_new_with_mnemonic (_("Published address"));
gtk_table_attach_defaults( GTK_TABLE(table), publishedAddressLabel, 0, 1, 5, 6); gtk_table_attach_defaults( GTK_TABLE(table), publishedAddressLabel, 0, 1, 5, 6);
gtk_misc_set_alignment(GTK_MISC (publishedAddressLabel), 0, 0.5); gtk_misc_set_alignment(GTK_MISC (publishedAddressLabel), 0, 0.5);
...@@ -1078,6 +1078,7 @@ show_account_window (account_t * a) ...@@ -1078,6 +1078,7 @@ 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("-------- Basic parameters to ne written in config");
DEBUG("curAccountID %s, curAccountType %s, curAlias %s, curHostname %s, curPassword %s, curUsername %s, curMailbox %s\n", DEBUG("curAccountID %s, curAccountType %s, curAlias %s, curHostname %s, curPassword %s, curUsername %s, curMailbox %s\n",
(gchar *)currentAccount->accountID, (gchar *)currentAccount->accountID,
...@@ -1088,8 +1089,8 @@ show_account_window (account_t * a) ...@@ -1088,8 +1089,8 @@ show_account_window (account_t * a)
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)), (gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)),
(gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)) (gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox))
); );
*/
/*
DEBUG("-------- Advanced parameters to be written"); 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", 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", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true",
...@@ -1102,7 +1103,7 @@ show_account_window (account_t * a) ...@@ -1102,7 +1103,7 @@ show_account_window (account_t * a)
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox)) ? "true":"false", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox)) ? "true":"false",
gtk_entry_get_text(GTK_ENTRY(stunServerEntry)) gtk_entry_get_text(GTK_ENTRY(stunServerEntry))
); );
*/
} }
......
...@@ -154,6 +154,12 @@ GtkWidget* create_direct_ip_calls_tab() ...@@ -154,6 +154,12 @@ GtkWidget* create_direct_ip_calls_tab()
GtkWidget * table; GtkWidget * table;
GtkWidget * label; GtkWidget * label;
GtkWidget * explanationLabel; GtkWidget * explanationLabel;
GtkWidget * localPortLabel;
GtkWidget * localPortSpinBox;
GtkWidget * localAddressLabel;
GtkWidget * localAddressCombo;
GtkWidget * keyExchangeCombo; GtkWidget * keyExchangeCombo;
GtkWidget * advancedZrtpButton; GtkWidget * advancedZrtpButton;
GtkWidget * useSipTlsCheckBox; GtkWidget * useSipTlsCheckBox;
...@@ -163,17 +169,26 @@ GtkWidget* create_direct_ip_calls_tab() ...@@ -163,17 +169,26 @@ GtkWidget* create_direct_ip_calls_tab()
gchar * curKeyExchange = "0"; gchar * curKeyExchange = "0";
gchar * description; gchar * description;
gchar * local_address;
gchar * local_port;
//directIpCallsProperties = sflphone_get_ip2ip_properties(); //directIpCallsProperties = sflphone_get_ip2ip_properties();
sflphone_get_ip2ip_properties(&directIpCallsProperties); sflphone_get_ip2ip_properties(&directIpCallsProperties);
if(directIpCallsProperties != NULL) { if(directIpCallsProperties != NULL) {
DEBUG("got a directIpCallsProperties"); DEBUG("got a directIpCallsProperties");
local_address = g_hash_table_lookup(directIpCallsProperties, LOCAL_ADDRESS);
local_port = g_hash_table_lookup(directIpCallsProperties, LOCAL_PORT);
DEBUG(" local address = %s", local_address);
DEBUG(" local port = %s", local_port);
curSRTPEnabled = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_SRTP_ENABLED); curSRTPEnabled = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_SRTP_ENABLED);
DEBUG(" curSRTPEnabled = %s", curSRTPEnabled); DEBUG(" curSRTPEnabled = %s", curSRTPEnabled);
curKeyExchange = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_KEY_EXCHANGE); curKeyExchange = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_KEY_EXCHANGE);
curTlsEnabled = g_hash_table_lookup(directIpCallsProperties, TLS_ENABLE); curTlsEnabled = g_hash_table_lookup(directIpCallsProperties, TLS_ENABLE);
} }
GtkWidget * vbox = gtk_vbox_new(FALSE, 10); GtkWidget * vbox = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
...@@ -183,6 +198,81 @@ GtkWidget* create_direct_ip_calls_tab() ...@@ -183,6 +198,81 @@ GtkWidget* create_direct_ip_calls_tab()
gtk_misc_set_alignment(GTK_MISC(explanationLabel), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(explanationLabel), 0, 0.5);
gtk_box_pack_start(GTK_BOX(vbox), explanationLabel, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), explanationLabel, FALSE, FALSE, 0);
/**
* Network Interface Section
*/
gnome_main_section_new_with_table (_("Network Interface"), &frame, &table, 2, 2);
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings (GTK_TABLE(table), 10);
gtk_table_set_col_spacings( GTK_TABLE(table), 10);
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
/**
* Retreive the list of IP interface from the
* the daemon and build the combo box.
*/
GtkListStore * ipInterfaceListStore;
GtkTreeIter iter;
ipInterfaceListStore = gtk_list_store_new( 1, G_TYPE_STRING );
localAddressLabel = gtk_label_new_with_mnemonic (_("Local address"));
gtk_table_attach ( GTK_TABLE( table ), localAddressLabel, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_misc_set_alignment(GTK_MISC (localAddressLabel), 0, 0.5);
GtkTreeIter current_local_address_iter = iter;
gchar ** iface_list = NULL;
iface_list = (gchar**) dbus_get_all_ip_interface();
gchar ** iface = NULL;
if (iface_list != NULL) {
for (iface = iface_list; *iface; iface++) {
DEBUG("Interface %s", *iface);
gtk_list_store_append(ipInterfaceListStore, &iter );
gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 );
current_local_address_iter = iter;
if (g_strcmp0(*iface, local_address) == 0) {
DEBUG("Setting active local address combo box");
current_local_address_iter = iter;
}
}
}
localAddressCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ipInterfaceListStore));
gtk_label_set_mnemonic_widget(GTK_LABEL(localAddressLabel), localAddressCombo);
gtk_table_attach ( GTK_TABLE( table ), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
g_object_unref(G_OBJECT(ipInterfaceListStore));
GtkCellRenderer * ipInterfaceCellRenderer;
ipInterfaceCellRenderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL);
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), &current_local_address_iter);
/**
* Local port
*/
/** SIP port information */
// int local_port = dbus_get_sip_port();
GtkWidget *applySipPortButton = gtk_button_new_from_stock(GTK_STOCK_APPLY);
localPortLabel = gtk_label_new_with_mnemonic (_("Local port"));
gtk_table_attach_defaults(GTK_TABLE(table), localPortLabel, 0, 1, 1, 2);
gtk_misc_set_alignment(GTK_MISC (localPortLabel), 0, 0.5);
localPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (localPortLabel), localPortSpinBox);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(localPortSpinBox), g_ascii_strtod(local_port, NULL));
g_signal_connect( G_OBJECT( applySipPortButton) , "clicked" , G_CALLBACK( update_port_cb ) , applySipPortButton);
gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2);
/**
* Security Section
*/
gnome_main_section_new_with_table (_("Security"), &frame, &table, 2, 3); gnome_main_section_new_with_table (_("Security"), &frame, &table, 2, 3);
gtk_container_set_border_width (GTK_CONTAINER(table), 10); gtk_container_set_border_width (GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings (GTK_TABLE(table), 10); gtk_table_set_row_spacings (GTK_TABLE(table), 10);
...@@ -235,7 +325,7 @@ GtkWidget* create_direct_ip_calls_tab() ...@@ -235,7 +325,7 @@ GtkWidget* create_direct_ip_calls_tab()
return vbox; return vbox;
} }
/*
GtkWidget* create_network_tab() GtkWidget* create_network_tab()
{ {
GtkWidget * frame; GtkWidget * frame;
...@@ -247,7 +337,7 @@ GtkWidget* create_network_tab() ...@@ -247,7 +337,7 @@ GtkWidget* create_network_tab()
ret = gtk_vbox_new(FALSE, 10); ret = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(ret), 10); gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
/** SIP port information */ // SIP port information
int curPort = dbus_get_sip_port(); int curPort = dbus_get_sip_port();
if(curPort <= 0 || curPort > 65535) { if(curPort <= 0 || curPort > 65535) {
curPort = 5060; curPort = 5060;
...@@ -278,6 +368,7 @@ GtkWidget* create_network_tab() ...@@ -278,6 +368,7 @@ GtkWidget* create_network_tab()
return ret; return ret;
} }
*/
GtkWidget* GtkWidget*
create_general_settings () create_general_settings ()
...@@ -430,12 +521,12 @@ show_preferences_dialog () ...@@ -430,12 +521,12 @@ show_preferences_dialog ()
tab = create_hooks_settings(); tab = create_hooks_settings();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Hooks"))); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Hooks")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
/*
// Network tab // Network tab
tab = create_network_tab(); tab = create_network_tab();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Network"))); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Network")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
*/
// Direct IP calls tab // Direct IP calls tab
tab = create_direct_ip_calls_tab(); tab = create_direct_ip_calls_tab();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Direct IP calls"))); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Direct IP calls")));
......
...@@ -77,6 +77,9 @@ ConfigurationManager::getIp2IpDetails (void) ...@@ -77,6 +77,9 @@ ConfigurationManager::getIp2IpDetails (void)
ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_NOT_SUPP_WARNING, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING))); ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_NOT_SUPP_WARNING, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING)));
ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS_ONCE, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE))); ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS_ONCE, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE)));
ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_ADDRESS, Manager::instance().getConfigString (IP2IP_PROFILE, LOCAL_ADDRESS)));
ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_PORT, Manager::instance().getConfigString (IP2IP_PROFILE, LOCAL_PORT)));
std::map<std::string, std::string> tlsSettings; std::map<std::string, std::string> tlsSettings;
tlsSettings = getTlsSettings (IP2IP_PROFILE); tlsSettings = getTlsSettings (IP2IP_PROFILE);
std::copy (tlsSettings.begin(), tlsSettings.end(), std::inserter (ip2ipAccountDetails, ip2ipAccountDetails.end())); std::copy (tlsSettings.begin(), tlsSettings.end(), std::inserter (ip2ipAccountDetails, ip2ipAccountDetails.end()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment