Commit dfe439ad authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Merge branch 'm_savard'

parents 46bc39b4 b7c2863b
...@@ -1101,12 +1101,12 @@ void sflphone_fill_codec_list () { ...@@ -1101,12 +1101,12 @@ void sflphone_fill_codec_list () {
void sflphone_fill_codec_list_per_account (account_t **account) { void sflphone_fill_codec_list_per_account (account_t **account) {
gchar **order; gchar **order;
gchar** details; gchar** details;
gchar** pl; gchar** pl;
gchar *accountID; gchar *accountID;
GQueue *codeclist; GQueue *codeclist;
gboolean active = FALSE; gboolean active = FALSE;
order = (gchar**) dbus_get_active_codec_list ((*account)->accountID); order = (gchar**) dbus_get_active_codec_list ((*account)->accountID);
codeclist = (*account)->codecs; codeclist = (*account)->codecs;
...@@ -1118,7 +1118,7 @@ void sflphone_fill_codec_list_per_account (account_t **account) { ...@@ -1118,7 +1118,7 @@ void sflphone_fill_codec_list_per_account (account_t **account) {
{ {
codec_t * cpy; codec_t * cpy;
// Each account will have a copy of the system-wide capabilities // Each account will have a copy of the system-wide capabilities
codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) atoi (*order), NULL), &cpy); codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) (size_t)atoi (*order), NULL), &cpy);
if (cpy) { if (cpy) {
cpy->is_active = TRUE; cpy->is_active = TRUE;
codec_list_add (cpy, &codeclist); codec_list_add (cpy, &codeclist);
...@@ -1136,7 +1136,7 @@ void sflphone_fill_codec_list_per_account (account_t **account) { ...@@ -1136,7 +1136,7 @@ void sflphone_fill_codec_list_per_account (account_t **account) {
codec_t * current_cap = capabilities_get_nth (i); codec_t * current_cap = capabilities_get_nth (i);
// Check if this codec has already been enabled for this account // Check if this codec has already been enabled for this account
if (codec_list_get_by_payload ( (gconstpointer) current_cap->_payload, codeclist) == NULL) { if (codec_list_get_by_payload ( (gconstpointer) (size_t)(current_cap->_payload), codeclist) == NULL) {
// codec_t *cpy; // codec_t *cpy;
// codec_create_new_from_caps (current_cap, &cpy); // codec_create_new_from_caps (current_cap, &cpy);
current_cap->is_active = active; current_cap->is_active = active;
......
...@@ -116,12 +116,16 @@ void change_protocol_cb (account_t *currentAccount UNUSED) { ...@@ -116,12 +116,16 @@ void change_protocol_cb (account_t *currentAccount UNUSED) {
gchar *protocol = gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); gchar *protocol = gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox));
if (g_strcasecmp (protocol, "IAX") == 0) { // Only if tabs are not NULL
gtk_widget_hide (security_tab); if(security_tab && advanced_tab) {
gtk_widget_hide (advanced_tab);
} else { if (g_strcasecmp (protocol, "IAX") == 0) {
gtk_widget_show (security_tab); gtk_widget_hide (GTK_WIDGET(security_tab));
gtk_widget_show (advanced_tab); gtk_widget_hide (GTK_WIDGET(advanced_tab));
} else {
gtk_widget_show (GTK_WIDGET(security_tab));
gtk_widget_show (GTK_WIDGET(advanced_tab));
}
} }
} }
...@@ -548,6 +552,7 @@ static void key_exchange_changed_cb(GtkWidget *widget, gpointer data) ...@@ -548,6 +552,7 @@ static void key_exchange_changed_cb(GtkWidget *widget, gpointer data)
static void use_sip_tls_cb(GtkWidget *widget, gpointer data) static void use_sip_tls_cb(GtkWidget *widget, gpointer data)
{ {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Using sips"); DEBUG("Using sips");
gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE);
...@@ -616,7 +621,6 @@ static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) { ...@@ -616,7 +621,6 @@ static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) {
static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED) static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED)
{ {
DEBUG("set_published_addr_manually_cb");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
DEBUG("Showing manual options"); DEBUG("Showing manual options");
...@@ -645,7 +649,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) ...@@ -645,7 +649,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
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);
...@@ -658,7 +662,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) ...@@ -658,7 +662,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
gtk_widget_set_sensitive (sameAsLocalRadioButton, TRUE); gtk_widget_set_sensitive (sameAsLocalRadioButton, TRUE);
gtk_widget_set_sensitive (publishedAddrRadioButton, TRUE); gtk_widget_set_sensitive (publishedAddrRadioButton, TRUE);
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton))) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton))) {
gtk_widget_show (publishedAddressLabel); gtk_widget_show (publishedAddressLabel);
gtk_widget_show (publishedPortLabel); gtk_widget_show (publishedPortLabel);
gtk_widget_show (publishedAddressEntry); gtk_widget_show (publishedAddressEntry);
...@@ -678,6 +682,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) ...@@ -678,6 +682,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
static same_as_local_cb(GtkWidget * widget, gpointer data UNUSED) static same_as_local_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("Same as local"); DEBUG("Same as local");
gchar * local_interface; gchar * local_interface;
...@@ -692,6 +697,7 @@ static same_as_local_cb(GtkWidget * widget, gpointer data UNUSED) ...@@ -692,6 +697,7 @@ static same_as_local_cb(GtkWidget * widget, gpointer data UNUSED)
gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL));
} }
} }
...@@ -1082,7 +1088,9 @@ GtkWidget* create_published_address (account_t **a) { ...@@ -1082,7 +1088,9 @@ GtkWidget* create_published_address (account_t **a) {
if (g_strcasecmp (published_sameas_local, "true") == 0) { if (g_strcasecmp (published_sameas_local, "true") == 0) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), FALSE);
} else { } else {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), FALSE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), TRUE);
} }
...@@ -1115,6 +1123,8 @@ GtkWidget* create_published_address (account_t **a) { ...@@ -1115,6 +1123,8 @@ GtkWidget* create_published_address (account_t **a) {
g_signal_connect(sameAsLocalRadioButton, "toggled", G_CALLBACK(same_as_local_cb), sameAsLocalRadioButton); g_signal_connect(sameAsLocalRadioButton, "toggled", G_CALLBACK(same_as_local_cb), sameAsLocalRadioButton);
g_signal_connect(publishedAddrRadioButton, "toggled", G_CALLBACK(set_published_addr_manually_cb), publishedAddrRadioButton); g_signal_connect(publishedAddrRadioButton, "toggled", G_CALLBACK(set_published_addr_manually_cb), publishedAddrRadioButton);
set_published_addr_manually_cb(publishedAddrRadioButton, NULL);
return frame; return frame;
} }
...@@ -1137,6 +1147,7 @@ GtkWidget* create_advanced_tab (account_t **a) { ...@@ -1137,6 +1147,7 @@ GtkWidget* create_advanced_tab (account_t **a) {
gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0);
gtk_widget_show_all (ret); gtk_widget_show_all (ret);
return ret; return ret;
} }
...@@ -1231,9 +1242,10 @@ void show_account_window (account_t * a) { ...@@ -1231,9 +1242,10 @@ void show_account_window (account_t * a) {
/* General Settings */ /* General Settings */
tab = create_basic_tab(&currentAccount); tab = create_basic_tab(&currentAccount);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic"))); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
g_signal_emit_by_name (protocolComboBox, "changed", NULL); g_signal_emit_by_name ((gpointer)protocolComboBox, "changed", NULL);
} }
...@@ -1415,7 +1427,7 @@ void show_account_window (account_t * a) { ...@@ -1415,7 +1427,7 @@ void show_account_window (account_t * a) {
codec_list_update_to_daemon (currentAccount); codec_list_update_to_daemon (currentAccount);
} }
else { else {
g_print ("IP to IP call\n"); DEBUG("IP to IP call\n");
// Direct IP calls config // Direct IP calls config
// dbus_set_ip2ip_details (directIpCallsProperties); // dbus_set_ip2ip_details (directIpCallsProperties);
} }
......
...@@ -32,7 +32,7 @@ void ...@@ -32,7 +32,7 @@ void
addressbook_search(GtkEntry* entry) addressbook_search(GtkEntry* entry)
{ {
gchar* query = gtk_entry_get_text(GTK_ENTRY (entry)); const gchar* query = gtk_entry_get_text(GTK_ENTRY (entry));
if (strlen(query) >= 3) { if (strlen(query) >= 3) {
AddressBook_Config *addressbook_config; AddressBook_Config *addressbook_config;
......
...@@ -2605,7 +2605,7 @@ void dbus_enable_status_icon (const gchar *value) { ...@@ -2605,7 +2605,7 @@ void dbus_enable_status_icon (const gchar *value) {
gchar* dbus_is_status_icon_enabled (void) { gchar* dbus_is_status_icon_enabled (void) {
GError *error = NULL; GError *error = NULL;
gchar* value = TRUE; gchar *value = NULL;
org_sflphone_SFLphone_ConfigurationManager_is_status_icon_enabled (configurationManagerProxy, &value, &error); org_sflphone_SFLphone_ConfigurationManager_is_status_icon_enabled (configurationManagerProxy, &value, &error);
......
...@@ -105,15 +105,10 @@ main_window_ask_quit () ...@@ -105,15 +105,10 @@ main_window_ask_quit ()
response = gtk_dialog_run (GTK_DIALOG (dialog)); response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_YES)
{ return (response == GTK_RESPONSE_NO)? FALSE : TRUE ;
return TRUE;
}
else if (response == GTK_RESPONSE_NO)
{
return FALSE;
}
return TRUE;
} }
static gboolean static gboolean
......
...@@ -182,13 +182,17 @@ statusicon_set_tooltip() ...@@ -182,13 +182,17 @@ statusicon_set_tooltip()
int count; int count;
gchar *tip; gchar *tip;
// Add a tooltip to the system tray icon if(status) {
count = account_list_get_registered_accounts();
tip = g_markup_printf_escaped("%s - %s", _("SFLphone"), // Add a tooltip to the system tray icon
g_markup_printf_escaped( count = account_list_get_registered_accounts();
n_("%i active account", "%i active accounts", count), count)); tip = g_markup_printf_escaped("%s - %s", _("SFLphone"),
gtk_status_icon_set_tooltip(status, tip); g_markup_printf_escaped(n_("%i active account", "%i active accounts", count), count));
g_free(tip); gtk_status_icon_set_tooltip(status, tip);
g_free(tip);
}
} }
void void
......
...@@ -362,11 +362,10 @@ help_contents_cb(GtkAction *action) ...@@ -362,11 +362,10 @@ help_contents_cb(GtkAction *action)
GError *error = NULL; GError *error = NULL;
gnome_help_display("sflphone.xml", NULL, &error); gnome_help_display("sflphone.xml", NULL, &error);
if (error != NULL) if (error != NULL) {
{
g_warning("%s", error->message); g_warning("%s", error->message);
g_error_free(error); g_error_free(error);
} }
} }
static void static void
......
...@@ -135,10 +135,13 @@ class SflPhoneTests(): ...@@ -135,10 +135,13 @@ class SflPhoneTests():
# Start Glib mainloop # Start Glib mainloop
self.sflphone.start() self.sflphone.start()
# SCENARIO 1 Test 4 # SCENARIO 1 Test 4
def test_ip2ip_recv_peer_hungup(self): def test_ip2ip_recv_peer_hungup(self):
"""Wait for calls, answer, peer hangup""" """Wait for calls, answer, peer hangup"""
# Add callback for this test # Add callback for this test
self.sflphone.onIncomingCall_cb = acceptOnIncomingCall self.sflphone.onIncomingCall_cb = acceptOnIncomingCall
......
...@@ -71,9 +71,13 @@ class SflPhoneCtrlSimple(Thread): ...@@ -71,9 +71,13 @@ class SflPhoneCtrlSimple(Thread):
self.loop = MainLoop() self.loop = MainLoop()
self.isStop = False
self.test = test self.test = test
self.onIncomingCall_cb = None self.onIncomingCall_cb = None
self.event = Event() self.event = Event()
gobject.threads_init()
...@@ -83,6 +87,12 @@ class SflPhoneCtrlSimple(Thread): ...@@ -83,6 +87,12 @@ class SflPhoneCtrlSimple(Thread):
self.loop.quit() self.loop.quit()
def stopThread(self):
print "Stop PySFLphone"
self.isStop = True
def register(self): def register(self):
if self.registered: if self.registered:
return return
...@@ -614,9 +624,11 @@ class SflPhoneCtrlSimple(Thread): ...@@ -614,9 +624,11 @@ class SflPhoneCtrlSimple(Thread):
def run(self): def run(self):
"""Processing method for this thread""" """Processing method for this thread"""
gobject.threads_init()
# self.loop.run()
context = self.loop.get_context() context = self.loop.get_context()
while 1: while True:
context.iteration(True) context.iteration(True)
if self.isStop:
return
Supports Markdown
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