diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index cebc3835cb1d63302dd4701f5bcebae2a09fef5f..772ed014d165e8a1cefd345e52e15df4d45c8c30 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1101,12 +1101,12 @@ void sflphone_fill_codec_list () { void sflphone_fill_codec_list_per_account (account_t **account) { - gchar **order; + gchar **order; gchar** details; gchar** pl; - gchar *accountID; - GQueue *codeclist; - gboolean active = FALSE; + gchar *accountID; + GQueue *codeclist; + gboolean active = FALSE; order = (gchar**) dbus_get_active_codec_list ((*account)->accountID); codeclist = (*account)->codecs; @@ -1118,7 +1118,7 @@ void sflphone_fill_codec_list_per_account (account_t **account) { { codec_t * cpy; // 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) { cpy->is_active = TRUE; codec_list_add (cpy, &codeclist); @@ -1136,7 +1136,7 @@ void sflphone_fill_codec_list_per_account (account_t **account) { codec_t * current_cap = capabilities_get_nth (i); // 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_create_new_from_caps (current_cap, &cpy); current_cap->is_active = active; diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c index 63f9d9d141326298fc8eef3d5c96207b829a40b3..6dcaf3bad47f8a0d6871446f241921010c37208f 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountconfigdialog.c @@ -116,12 +116,16 @@ void change_protocol_cb (account_t *currentAccount UNUSED) { gchar *protocol = gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); - if (g_strcasecmp (protocol, "IAX") == 0) { - gtk_widget_hide (security_tab); - gtk_widget_hide (advanced_tab); - } else { - gtk_widget_show (security_tab); - gtk_widget_show (advanced_tab); + // Only if tabs are not NULL + if(security_tab && advanced_tab) { + + if (g_strcasecmp (protocol, "IAX") == 0) { + gtk_widget_hide (GTK_WIDGET(security_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) static void use_sip_tls_cb(GtkWidget *widget, gpointer data) { + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { DEBUG("Using sips"); gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); @@ -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) { - DEBUG("set_published_addr_manually_cb"); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { DEBUG("Showing manual options"); @@ -645,7 +649,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) gtk_widget_show (stunServerEntry); gtk_widget_set_sensitive (sameAsLocalRadioButton, FALSE); gtk_widget_set_sensitive (publishedAddrRadioButton, FALSE); - DEBUG("Problem occurs here"); + gtk_widget_hide (publishedAddressLabel); gtk_widget_hide (publishedPortLabel); gtk_widget_hide (publishedAddressEntry); @@ -658,7 +662,7 @@ static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) gtk_widget_set_sensitive (sameAsLocalRadioButton, 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 (publishedPortLabel); gtk_widget_show (publishedAddressEntry); @@ -678,6 +682,7 @@ static use_stun_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))) { DEBUG("Same as local"); gchar * local_interface; @@ -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)); 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) { 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 (publishedAddrRadioButton), FALSE); } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), TRUE); } @@ -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(publishedAddrRadioButton, "toggled", G_CALLBACK(set_published_addr_manually_cb), publishedAddrRadioButton); + set_published_addr_manually_cb(publishedAddrRadioButton, NULL); + return frame; } @@ -1137,6 +1147,7 @@ GtkWidget* create_advanced_tab (account_t **a) { gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); gtk_widget_show_all (ret); + return ret; } @@ -1231,9 +1242,10 @@ void show_account_window (account_t * a) { /* General Settings */ tab = create_basic_tab(¤tAccount); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic"))); 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) { codec_list_update_to_daemon (currentAccount); } else { - g_print ("IP to IP call\n"); + DEBUG("IP to IP call\n"); // Direct IP calls config // dbus_set_ip2ip_details (directIpCallsProperties); } diff --git a/sflphone-client-gnome/src/contacts/addressbook.c b/sflphone-client-gnome/src/contacts/addressbook.c index d9b987c6340af544880f01ef9e74ded840bfd2b4..dfa4df26b42c0cb271846b9c07b1400df58b7352 100644 --- a/sflphone-client-gnome/src/contacts/addressbook.c +++ b/sflphone-client-gnome/src/contacts/addressbook.c @@ -32,7 +32,7 @@ void 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) { AddressBook_Config *addressbook_config; diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index 48f047c0929ac7515dd142a25e9f6ad61e95026d..f764878d68107399a95bca3333af8270e5c5254d 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -2605,7 +2605,7 @@ void dbus_enable_status_icon (const gchar *value) { gchar* dbus_is_status_icon_enabled (void) { GError *error = NULL; - gchar* value = TRUE; + gchar *value = NULL; org_sflphone_SFLphone_ConfigurationManager_is_status_icon_enabled (configurationManagerProxy, &value, &error); diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index 6fe9cc025c0ea7e4bfd1e604762bf5982a26e5cb..597076303dabc17b65fd6bfccd5f736f9ac710f1 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -105,15 +105,10 @@ main_window_ask_quit () response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); - if (response == GTK_RESPONSE_YES) - { - return TRUE; - } - else if (response == GTK_RESPONSE_NO) - { - return FALSE; - } - return TRUE; + + return (response == GTK_RESPONSE_NO)? FALSE : TRUE ; + + } static gboolean diff --git a/sflphone-client-gnome/src/statusicon.c b/sflphone-client-gnome/src/statusicon.c index 7f74f6f066ed8c9d77a52b948658c1d44dae01ae..0808f1a2be5b40815a0d03fcf9593dd231560621 100644 --- a/sflphone-client-gnome/src/statusicon.c +++ b/sflphone-client-gnome/src/statusicon.c @@ -182,13 +182,17 @@ statusicon_set_tooltip() int count; gchar *tip; - // Add a tooltip to the system tray icon - count = account_list_get_registered_accounts(); - tip = g_markup_printf_escaped("%s - %s", _("SFLphone"), - g_markup_printf_escaped( - n_("%i active account", "%i active accounts", count), count)); - gtk_status_icon_set_tooltip(status, tip); - g_free(tip); + if(status) { + + // Add a tooltip to the system tray icon + count = account_list_get_registered_accounts(); + tip = g_markup_printf_escaped("%s - %s", _("SFLphone"), + g_markup_printf_escaped(n_("%i active account", "%i active accounts", count), count)); + gtk_status_icon_set_tooltip(status, tip); + g_free(tip); + + } + } void diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 26b35661b5ae22367fe6d355df1360cbd3d79cf4..a866c3c1a969295836c2188b4082fd01d378efe1 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -362,11 +362,10 @@ help_contents_cb(GtkAction *action) GError *error = NULL; gnome_help_display("sflphone.xml", NULL, &error); - if (error != NULL) - { + if (error != NULL) { g_warning("%s", error->message); g_error_free(error); - } + } } static void diff --git a/tools/pysflphone/pysflphone_testdbus.py b/tools/pysflphone/pysflphone_testdbus.py index d05da47a9999167af290ac3f4a65c00158da612c..dc17f2bbc9e615a674cedc7584f1e639ca3ed2fe 100644 --- a/tools/pysflphone/pysflphone_testdbus.py +++ b/tools/pysflphone/pysflphone_testdbus.py @@ -135,10 +135,13 @@ class SflPhoneTests(): # Start Glib mainloop self.sflphone.start() + + # SCENARIO 1 Test 4 def test_ip2ip_recv_peer_hungup(self): """Wait for calls, answer, peer hangup""" + # Add callback for this test self.sflphone.onIncomingCall_cb = acceptOnIncomingCall diff --git a/tools/pysflphone/sflphonectrlsimple.py b/tools/pysflphone/sflphonectrlsimple.py index 8de24706aafc65065d397722d9b54dfd570c6075..cba2cf72da9907ce39fefe5a5c4fa6662efd9a11 100755 --- a/tools/pysflphone/sflphonectrlsimple.py +++ b/tools/pysflphone/sflphonectrlsimple.py @@ -71,9 +71,13 @@ class SflPhoneCtrlSimple(Thread): self.loop = MainLoop() + self.isStop = False + self.test = test self.onIncomingCall_cb = None self.event = Event() + + gobject.threads_init() @@ -83,6 +87,12 @@ class SflPhoneCtrlSimple(Thread): self.loop.quit() + def stopThread(self): + print "Stop PySFLphone" + self.isStop = True + + + def register(self): if self.registered: return @@ -614,9 +624,11 @@ class SflPhoneCtrlSimple(Thread): def run(self): """Processing method for this thread""" - gobject.threads_init() - # self.loop.run() + context = self.loop.get_context() - while 1: + while True: context.iteration(True) + + if self.isStop: + return