diff --git a/daemon/src/dbus/callmanager-introspec.xml b/daemon/src/dbus/callmanager-introspec.xml index a742426b77507d01a447521eca94b2237ad136f1..9aa97ca930901f35d6e17d5041cf05b0f0b82208 100644 --- a/daemon/src/dbus/callmanager-introspec.xml +++ b/daemon/src/dbus/callmanager-introspec.xml @@ -375,6 +375,7 @@ <li>DISPLAY_NAME</li> <li>CALL_STATE</li> <li>CALL_TYPE</li> + <li>CONF_ID</li> </ul> </tp:docstring> </arg> diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index 490840e1aa0fb0d7e29bdc9ba1cde19f72198a6a..165f8e33d279f92b81d4da6f236771ec08b17a4f 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -2785,6 +2785,7 @@ std::map<std::string, std::string> ManagerImpl::getCallDetails(const std::string call_details["DISPLAY_NAME"] = call->getDisplayName(); call_details["CALL_STATE"] = call->getStateStr(); call_details["CALL_TYPE"] = type.str(); + call_details["CONF_ID"] = call->getConfId(); } else { ERROR("Call is NULL"); call_details["ACCOUNTID"] = ""; diff --git a/gnome/src/actions.c b/gnome/src/actions.c index 7511f3a36fabcf5c1a86f371533250ed19da5887..b6a629de317eebaf5ec6d631dc93683cd40095e8 100644 --- a/gnome/src/actions.c +++ b/gnome/src/actions.c @@ -178,7 +178,7 @@ sflphone_ringing(callable_obj_t * c) void sflphone_hung_up(callable_obj_t * c) { - DEBUG("SFLphone: Hung up"); + DEBUG("%s", __PRETTY_FUNCTION__); calllist_remove_call(current_calls_tab, c->_callID); calltree_remove_call(current_calls_tab, c); @@ -277,9 +277,6 @@ gboolean sflphone_init(GError **error) // Fetch the ip2ip profile sflphone_fill_ip2ip_profile(); - // Fetch the conference list - sflphone_fill_conference_list(); - return TRUE; } @@ -299,7 +296,7 @@ sflphone_hang_up() callable_obj_t * selectedCall = calltab_get_selected_call(current_calls_tab); conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree_tab); - DEBUG("SFLphone: Hang up"); + DEBUG("%s", __PRETTY_FUNCTION__); if (selectedConf) { im_widget_update_state(IM_WIDGET(selectedConf->_im_widget), FALSE); @@ -436,7 +433,7 @@ sflphone_on_hold() void sflphone_off_hold() { - DEBUG("sflphone_off_hold"); + DEBUG("%s", __PRETTY_FUNCTION__); callable_obj_t * selectedCall = calltab_get_selected_call(current_calls_tab); conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree_tab); @@ -749,29 +746,29 @@ sflphone_place_call(callable_obj_t * c) { account_t * account = NULL; - if(c == NULL) { - ERROR("Actions: Callable object is NULL while making new call"); + if (c == NULL) { + ERROR("Callable object is NULL while making new call"); return -1; } - DEBUG("Actions: Placing call from %s to %s using account %s", c->_display_name, c->_peer_number, c->_accountID); + DEBUG("Placing call from %s to %s using account %s", c->_display_name, c->_peer_number, c->_accountID); if (c->_state != CALL_STATE_DIALING) { - ERROR("Actions: Call not in state dialing, cannot place call"); + ERROR("Call not in state dialing, cannot place call"); return -1; } if (!c->_peer_number || strlen(c->_peer_number) == 0) { - ERROR("Actions: No peer number set for this call"); + ERROR("No peer number set for this call"); return -1; } // Get the account for this call if (strlen(c->_accountID) != 0) { - DEBUG("Actions: Account %s already set for this call", c->_accountID); + DEBUG("Account %s already set for this call", c->_accountID); account = account_list_get_by_id(c->_accountID); } else { - DEBUG("Actions: No account set for this call, use first of the list"); + DEBUG("No account set for this call, use first of the list"); account = account_list_get_current(); } @@ -786,7 +783,7 @@ sflphone_place_call(callable_obj_t * c) // If there is no account specified or found, fallback on IP2IP call if(account == NULL) { - DEBUG("Actions: Could not find an account for this call, making ip to ip call"); + DEBUG("Could not find an account for this call, making ip to ip call"); account = account_list_get_by_id("IP2IP"); if (account == NULL) { ERROR("Actions: Could not determine any account for this call"); @@ -815,7 +812,7 @@ sflphone_detach_participant(const gchar* callID) else selectedCall = calllist_get_call(current_calls_tab, callID); - DEBUG("Action: Detach participant %s", selectedCall->_callID); + DEBUG("Detach participant %s", selectedCall->_callID); if (selectedCall->_confID) { g_free(selectedCall->_confID); @@ -831,12 +828,12 @@ sflphone_detach_participant(const gchar* callID) void sflphone_add_participant(const gchar* callID, const gchar* confID) { - DEBUG(">SFLphone: Add participant %s to conference %s", callID, confID); + DEBUG("Add participant %s to conference %s", callID, confID); callable_obj_t *call = calllist_get_call(current_calls_tab, callID); if (call == NULL) { - ERROR("SFLphone: Error: Could not find call"); + ERROR("Could not find call"); return; } @@ -846,7 +843,7 @@ sflphone_add_participant(const gchar* callID, const gchar* confID) void sflphone_add_main_participant(const conference_obj_t * c) { - DEBUG("sflphone add main participant"); + DEBUG("%s", __PRETTY_FUNCTION__); dbus_add_main_participant(c->_confID); } @@ -857,7 +854,7 @@ sflphone_rec_call() conference_obj_t * selectedConf = calltab_get_selected_conf(current_calls_tab); if (selectedCall) { - DEBUG("SFLphone: Set record for selected call"); + DEBUG("Set record for selected call"); dbus_set_record(selectedCall->_callID); switch (selectedCall->_state) { @@ -874,7 +871,7 @@ sflphone_rec_call() calltree_update_call(current_calls_tab, selectedCall); } else if (selectedConf) { - DEBUG("SFLphone: Set record for selected conf"); + DEBUG("Set record for selected conf"); dbus_set_record(selectedConf->_confID); switch (selectedConf->_state) { @@ -895,7 +892,7 @@ sflphone_rec_call() break; } - DEBUG("Actions: Remove and add conference %s", selectedConf->_confID); + DEBUG("Remove and add conference %s", selectedConf->_confID); calltree_remove_conference(current_calls_tab, selectedConf); calltree_add_conference_to_current_calls(selectedConf); } @@ -906,7 +903,7 @@ sflphone_rec_call() void sflphone_mute_call() { - DEBUG("Actions: Mute call"); + DEBUG("%s", __PRETTY_FUNCTION__); toggle_slider_mute_microphone(); } @@ -954,11 +951,13 @@ void sflphone_fill_call_list(void) for (gchar **calls = list; calls && *calls; ++calls) { gchar *callID = *calls; - callable_obj_t *c = create_new_call_from_details(*calls, dbus_get_call_details(*calls)); - g_free(callID); - c->_zrtp_confirmed = FALSE; - calllist_add_call(current_calls_tab, c); - calltree_add_call(current_calls_tab, c, NULL); + if (!calllist_get_call(current_calls_tab, callID)) { + callable_obj_t *c = create_new_call_from_details(*calls, dbus_get_call_details(*calls)); + c->_zrtp_confirmed = FALSE; + calllist_add_call(current_calls_tab, c); + if (!c->_confID || strlen(c->_confID) == 0) + calltree_add_call(current_calls_tab, c, NULL); + } } g_strfreev(list); @@ -999,10 +998,9 @@ static void fill_treeview_with_calls(void) guint n = calllist_get_size(history_tab); for (guint i = 0; i < n; ++i) { - QueueElement *element = calllist_get_nth(history_tab, i); - - if (element->type == HIST_CALL) - calltree_add_history_entry(element->elem.call); + callable_obj_t *call = calllist_get_nth(history_tab, i); + if (call) + calltree_add_history_entry(call); } } @@ -1073,7 +1071,7 @@ sflphone_request_go_clear(void) void sflphone_call_state_changed(callable_obj_t * c, const gchar * description, const guint code) { - DEBUG("SFLPhone: Call State changed %s", description); + DEBUG("Call State changed %s", description); if (c == NULL) { ERROR("SFLphone: Error: callable obj is NULL in %s at %d", __FILE__, __LINE__); diff --git a/gnome/src/callable_obj.c b/gnome/src/callable_obj.c index 545773077313fafe8aaf7e0aa6e0d4250a9846a9..e70a5ca9fe00c280cde90b345283d43da1bc8206 100644 --- a/gnome/src/callable_obj.c +++ b/gnome/src/callable_obj.c @@ -36,10 +36,10 @@ #include <glib/gi18n.h> #include "contacts/calltab.h" #include "contacts/calltree.h" +#include "logger.h" #include "dbus.h" #include <unistd.h> - gint get_state_callstruct(gconstpointer a, gconstpointer b) { callable_obj_t * c = (callable_obj_t*) a; @@ -146,6 +146,7 @@ callable_obj_t *create_new_call_from_details(const gchar *call_id, GHashTable *d const gchar * const peer_number = g_hash_table_lookup(details, "PEER_NUMBER"); const gchar * const display_name = g_hash_table_lookup(details, "DISPLAY_NAME"); const gchar * const state_str = g_hash_table_lookup(details, "CALL_STATE"); + const gchar * const conf_id = g_hash_table_lookup(details, "CONF_ID"); if (utf8_case_equal(state_str, "CURRENT")) state = CALL_STATE_CURRENT; @@ -162,6 +163,7 @@ callable_obj_t *create_new_call_from_details(const gchar *call_id, GHashTable *d gchar *number = call_get_peer_number(peer_number); callable_obj_t *c = create_new_call(CALL, state, call_id, accountID, display_name, number); + c->_confID = g_strdup(conf_id); g_free(number); return c; } @@ -307,3 +309,22 @@ gboolean call_was_outgoing(callable_obj_t * obj) { return g_strcmp0(obj->_history_state, OUTGOING_STRING) == 0; } + +void restore_call(const gchar *id) +{ + DEBUG("Restoring call %s", id); + // We fetch the details associated to the specified call + GHashTable *call_details = dbus_get_call_details(id); + if (!call_details) { + ERROR("Invalid call ID"); + return; + } + callable_obj_t *new_call = create_new_call_from_details(id, call_details); + + if (utf8_case_equal(g_hash_table_lookup(call_details, "CALL_TYPE"), INCOMING_STRING)) + new_call->_history_state = g_strdup(INCOMING_STRING); + else + new_call->_history_state = g_strdup(OUTGOING_STRING); + + calllist_add_call(current_calls_tab, new_call); +} diff --git a/gnome/src/callable_obj.h b/gnome/src/callable_obj.h index b2437962e6d4dc72df1d1bc5d1870c310ac60f61..8f9b84bb2fbf94736c6755809e13944d93d8b4bd 100644 --- a/gnome/src/callable_obj.h +++ b/gnome/src/callable_obj.h @@ -204,4 +204,6 @@ gchar* call_get_audio_codec(callable_obj_t *obj); gboolean call_was_outgoing(callable_obj_t * obj); +void restore_call(const gchar *id); + #endif diff --git a/gnome/src/codeclist.c b/gnome/src/codeclist.c index 6662cfe018464ca8e59d6f9f292b35958f0f6024..1c54577a9a2017de333dabd5a76ea0f9c829184f 100644 --- a/gnome/src/codeclist.c +++ b/gnome/src/codeclist.c @@ -176,7 +176,7 @@ void codec_set_prefered_order(guint codec_index, GQueue *q) void codec_list_move_codec_up(guint codec_index, GQueue **q) { - DEBUG("Codec list Size: %i \n", codec_list_get_size()); + DEBUG("Codec list size: %i \n", codec_list_get_size()); GQueue *tmp = *q; @@ -190,8 +190,7 @@ void codec_list_move_codec_up(guint codec_index, GQueue **q) void codec_list_move_codec_down(guint codec_index, GQueue **q) { - - DEBUG("Codec list Size: %i \n", codec_list_get_size()); + DEBUG("Codec list size: %i \n", codec_list_get_size()); GQueue *tmp = *q; diff --git a/gnome/src/conference_obj.c b/gnome/src/conference_obj.c index 2df0bb34af10eafcdee5fef8c0876bdf463ca3e7..69d022827cb0024cdc4731f6fa531d3e789a805b 100644 --- a/gnome/src/conference_obj.c +++ b/gnome/src/conference_obj.c @@ -38,23 +38,19 @@ #include "calltab.h" #include "calllist.h" -conference_obj_t *create_new_conference(conference_state_t state, const gchar* const confID) +conference_obj_t * +create_new_conference(conference_state_t state, const gchar* const confID) { if (confID == NULL) { - ERROR("Conference: Error: Conference ID is NULL while creating new conference"); + ERROR("Conference ID is NULL while creating new conference"); return NULL; } - DEBUG("Conference: Create new conference %s", confID); + DEBUG("Create new conference %s", confID); // Allocate memory conference_obj_t *new_conf = g_new0(conference_obj_t, 1); - if (!new_conf) { - ERROR("Conference: Error: Could not allocate data "); - return NULL; - } - // Set state field new_conf->_state = state; @@ -114,7 +110,7 @@ void conference_add_participant_number(const gchar *call_id, conference_obj_t *c callable_obj_t *call = calllist_get_call(current_calls_tab, call_id); if (!call) { - ERROR("Conference: Error: Could not find %s", call_id); + ERROR("Could not find %s", call_id); return; } @@ -124,7 +120,7 @@ void conference_add_participant_number(const gchar *call_id, conference_obj_t *c void conference_add_participant(const gchar* call_id, conference_obj_t* conf) { - DEBUG("Conference: Conference %s, adding participant %s", conf->_confID, call_id); + DEBUG("Conference %s, adding participant %s", conf->_confID, call_id); // store the new participant list after appending participant id conf->participant_list = g_slist_append(conf->participant_list, (gpointer) g_strdup(call_id)); @@ -142,10 +138,8 @@ void conference_remove_participant(const gchar* call_id, conference_obj_t* conf) void conference_participant_list_update(gchar** participants, conference_obj_t* conf) { - DEBUG("Conference: Participant list update"); - if (!conf) { - ERROR("Conference: Error: Conference is NULL"); + ERROR("Conference is NULL"); return; } @@ -153,7 +147,7 @@ void conference_participant_list_update(gchar** participants, conference_obj_t* const gchar *call_id = (const gchar *) (*part); callable_obj_t *call = calllist_get_call(current_calls_tab, call_id); - if (call->_confID != NULL) { + if (call) { g_free(call->_confID); call->_confID = NULL; } @@ -167,6 +161,10 @@ void conference_participant_list_update(gchar** participants, conference_obj_t* for (gchar **part = participants; part && *part; ++part) { gchar *call_id = (gchar *) (*part); callable_obj_t *call = calllist_get_call(current_calls_tab, call_id); + if (!call) { + restore_call(call_id); + call = calllist_get_call(current_calls_tab, call_id); + } call->_confID = g_strdup(conf->_confID); conference_add_participant(call_id, conf); } diff --git a/gnome/src/config/accountconfigdialog.c b/gnome/src/config/accountconfigdialog.c index 259a25b7d78cb923de0eef6c21db2c9ccf3da23c..1127993b622b0f879f31e67cd82cd6f4977ac335 100644 --- a/gnome/src/config/accountconfigdialog.c +++ b/gnome/src/config/accountconfigdialog.c @@ -257,7 +257,7 @@ static GtkWidget* create_basic_tab(const account_t *account) else if (account_is_IAX(account)) gtk_combo_box_set_active(GTK_COMBO_BOX(protocol_combo), 1); else { - DEBUG("Config: Error: Account protocol not valid"); + ERROR("Account protocol not valid"); /* Should never come here, add debug message. */ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(protocol_combo), _("Unknown")); gtk_combo_box_set_active(GTK_COMBO_BOX(protocol_combo), 2); @@ -430,7 +430,7 @@ cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gchar *text, GtkTreePath *path = gtk_tree_path_new_from_string(path_desc); gint column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(renderer), "column")); - DEBUG("path desc in cell_edited_cb: %s\n", text); + DEBUG("path desc: %s\n", text); if ((utf8_case_equal(path_desc, "0")) && !utf8_case_equal(text, gtk_entry_get_text(GTK_ENTRY(entry_username)))) @@ -448,8 +448,7 @@ static void editing_started_cb(GtkCellRenderer *cell UNUSED, GtkCellEditable * editable, const gchar * path, gpointer data UNUSED) { - DEBUG("Editing started"); - DEBUG("path desc in editing_started_cb: %s\n", path); + DEBUG("path desc: %s\n", path); // If we are dealing the first row if (utf8_case_equal(path, "0")) @@ -584,13 +583,13 @@ static void local_interface_changed_cb(GtkWidget * widget UNUSED, gpointer data static void set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Config: Showing manual publishing options"); + DEBUG("Showing manual publishing options"); gtk_widget_show(published_port_label); gtk_widget_show(published_port_spin_box); gtk_widget_show(published_address_label); gtk_widget_show(published_address_entry); } else { - DEBUG("Config: Hiding manual publishing options"); + DEBUG("Hiding manual publishing options"); gtk_widget_hide(published_port_label); gtk_widget_hide(published_port_spin_box); gtk_widget_hide(published_address_label); @@ -605,7 +604,7 @@ static void use_stun_cb(GtkWidget *widget, gpointer data UNUSED) return; if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Config: Showing stun options, hiding Local/Published info"); + DEBUG("Showing stun options, hiding Local/Published info"); gtk_widget_show(stun_server_label); gtk_widget_show(stun_server_entry); gtk_widget_set_sensitive(stun_server_entry, TRUE); @@ -617,7 +616,7 @@ static void use_stun_cb(GtkWidget *widget, gpointer data UNUSED) gtk_widget_hide(published_address_entry); gtk_widget_hide(published_port_spin_box); } else { - DEBUG("Config: disabling stun options, showing Local/Published info"); + DEBUG("disabling stun options, showing Local/Published info"); gtk_widget_set_sensitive(stun_server_entry, FALSE); gtk_widget_set_sensitive(same_as_local_radio_button, TRUE); gtk_widget_set_sensitive(published_addr_radio_button, TRUE); @@ -1010,7 +1009,7 @@ GtkWidget* create_published_address(const account_t *account) GtkWidget* create_advanced_tab(const account_t *account) { // Build the advanced tab, to appear on the account configuration panel - DEBUG("Config: Build advanced tab"); + DEBUG("Build advanced tab"); GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10); @@ -1192,10 +1191,10 @@ static void update_account_from_basic_tab(account_t *account) } if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(overrtp))) { - DEBUG("Config: Set dtmf over rtp"); + DEBUG("Set dtmf over rtp"); account_replace(account, ACCOUNT_DTMF_TYPE, OVERRTP); } else { - DEBUG("Config: Set dtmf over sip"); + DEBUG("Set dtmf over sip"); account_replace(account, ACCOUNT_DTMF_TYPE, SIPINFO); } diff --git a/gnome/src/config/accountlistconfigdialog.c b/gnome/src/config/accountlistconfigdialog.c index 6a8b47f0bff79753dde29220942560adbe7ad779..28aa48cb2af3531c493501c5f1d19884213c23ea 100644 --- a/gnome/src/config/accountlistconfigdialog.c +++ b/gnome/src/config/accountlistconfigdialog.c @@ -147,7 +147,7 @@ static void account_store_add(GtkTreeIter *iter, account_t *account) { const gchar *enabled = account_lookup(account, ACCOUNT_ENABLED); const gchar *type = account_lookup(account, ACCOUNT_TYPE); - DEBUG("Config: Adding account: Account is enabled :%s", enabled); + DEBUG("Account is enabled :%s", enabled); const gchar *state_name = account_state_name(account->state); gtk_list_store_set(account_store, iter, @@ -158,8 +158,6 @@ static void account_store_add(GtkTreeIter *iter, account_t *account) COLUMN_ACCOUNT_ID, account->accountID, -1); } - - /** * Fills the treelist with accounts, should be called whenever the account * list is modified. diff --git a/gnome/src/config/addressbook-config.c b/gnome/src/config/addressbook-config.c index 1832d38e8136395bae6d6fc2f882382aedd371ce..14476e033085df903358b0a1bfc89ac8b87a0f05 100644 --- a/gnome/src/config/addressbook-config.c +++ b/gnome/src/config/addressbook-config.c @@ -219,7 +219,7 @@ addressbook_config_book_active_toggled( treePath = gtk_tree_path_new_from_string(path); if (!(model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)))) { - DEBUG("Addressbook: No valid model (%s:%d)", __FILE__, __LINE__); + DEBUG("No valid model (%s:%d)", __FILE__, __LINE__); return; } @@ -241,7 +241,8 @@ addressbook_config_book_active_toggled( book_data = addrbook->get_book_data_by_uid(uid); if (book_data == NULL) { - ERROR("Addressbook: Error: Could not find addressbook %s", uid); + ERROR("Could not find addressbook %s", uid); + return; } book_data->active = active; @@ -299,12 +300,12 @@ addressbook_config_fill_book_list() GSList *books_data = addrbook->get_books_data(book_list); if (!books_data) { - DEBUG("Addressbook: No valid books data (%s:%d)", __FILE__, __LINE__); + DEBUG("No valid books data (%s:%d)", __FILE__, __LINE__); } // Get model of view and clear it if (!(store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(book_tree_view))))) { - DEBUG("Addressbook: Could not find model from treeview (%s:%d)", __FILE__, __LINE__); + DEBUG("Could not find model from treeview (%s:%d)", __FILE__, __LINE__); return; } diff --git a/gnome/src/config/assistant.c b/gnome/src/config/assistant.c index beeda0b8adc7efa96725e3068eb087ec99948209..d25e882bd63050b624af210d2ce7c088ff616071 100644 --- a/gnome/src/config/assistant.c +++ b/gnome/src/config/assistant.c @@ -41,26 +41,26 @@ struct _wizard *wiz; static int account_type; -static int use_sflphone_org = 1; +static gboolean use_sflphone_org = TRUE; static account_t* current; static char message[1024]; /** * Forward function */ -static gint forward_page_func(gint current_page , gpointer data); +static gint forward_page_func(gint current_page, gpointer data); /** * Page template */ static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section); -void prefill_sip(void) ; +void prefill_sip(void); -void set_account_type(GtkWidget* widget , gpointer data UNUSED) +void set_account_type(GtkWidget* widget, gpointer data UNUSED) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) account_type = _SIP; else - account_type = _IAX ; + account_type = _IAX; } static void show_password_cb(GtkWidget *widget UNUSED, gpointer data) @@ -101,13 +101,11 @@ void getMessageSummary(const gchar * alias, const gchar * server, const gchar * strcat(message, _("None")); } -void set_sflphone_org(GtkWidget* widget , gpointer data UNUSED) +void set_sflphone_org(GtkWidget* widget, gpointer data UNUSED) { - use_sflphone_org = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ?1:0) ; + use_sflphone_org = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); } - - /** * Callback when the close button of the dialog is clicked * Action : close the assistant widget and get back to sflphone main window @@ -220,10 +218,10 @@ void enable_stun(GtkWidget* widget) void build_wizard(void) { - use_sflphone_org = 1; + use_sflphone_org = TRUE; if (wiz) - return ; + return; wiz = (struct _wizard*) g_malloc(sizeof(struct _wizard)); current = create_default_account(); @@ -237,7 +235,7 @@ void build_wizard(void) gtk_window_set_title(GTK_WINDOW(wiz->assistant), _("SFLphone account creation wizard")); gtk_window_set_position(GTK_WINDOW(wiz->assistant), GTK_WIN_POS_CENTER); - gtk_window_set_default_size(GTK_WINDOW(wiz->assistant), 200 , 200); + gtk_window_set_default_size(GTK_WINDOW(wiz->assistant), 200, 200); build_intro(); build_sfl_or_account(); @@ -248,22 +246,20 @@ void build_wizard(void) build_email_configuration(); build_summary(); - g_signal_connect(G_OBJECT(wiz->assistant), "close" , G_CALLBACK(close_callback), NULL); + g_signal_connect(G_OBJECT(wiz->assistant), "close", G_CALLBACK(close_callback), NULL); - g_signal_connect(G_OBJECT(wiz->assistant), "cancel" , G_CALLBACK(cancel_callback), NULL); + g_signal_connect(G_OBJECT(wiz->assistant), "cancel", G_CALLBACK(cancel_callback), NULL); gtk_widget_show_all(wiz->assistant); - gtk_assistant_set_forward_page_func(GTK_ASSISTANT(wiz->assistant), (GtkAssistantPageFunc) forward_page_func , NULL , NULL); + gtk_assistant_set_forward_page_func(GTK_ASSISTANT(wiz->assistant), (GtkAssistantPageFunc) forward_page_func, NULL, NULL); gtk_assistant_update_buttons_state(GTK_ASSISTANT(wiz->assistant)); } GtkWidget* build_intro() { - GtkWidget *label; - - wiz->intro = create_vbox(GTK_ASSISTANT_PAGE_INTRO , "SFLphone GNOME client" , _("Welcome to the Account creation wizard of SFLphone!")); - label = gtk_label_new(_("This installation wizard will help you configure an account.")) ; + wiz->intro = create_vbox(GTK_ASSISTANT_PAGE_INTRO, "SFLphone GNOME client", _("Welcome to the Account creation wizard of SFLphone!")); + GtkWidget *label = gtk_label_new(_("This installation wizard will help you configure an account.")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_widget_set_size_request(GTK_WIDGET(label), 380, -1); @@ -275,17 +271,14 @@ GtkWidget* build_intro() GtkWidget* build_select_account() { - GtkWidget* sip; - GtkWidget* iax; - - wiz->protocols = create_vbox(GTK_ASSISTANT_PAGE_CONTENT , _("VoIP Protocols") , _("Select an account type")); + wiz->protocols = create_vbox(GTK_ASSISTANT_PAGE_CONTENT, _("VoIP Protocols"), _("Select an account type")); - sip = gtk_radio_button_new_with_label(NULL, _("SIP (Session Initiation Protocol)")); - gtk_box_pack_start(GTK_BOX(wiz->protocols) , sip , TRUE, TRUE, 0); - iax = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sip), _("IAX2 (InterAsterix Exchange)")); - gtk_box_pack_start(GTK_BOX(wiz->protocols) , iax , TRUE, TRUE, 0); + GtkWidget *sip = gtk_radio_button_new_with_label(NULL, _("SIP (Session Initiation Protocol)")); + gtk_box_pack_start(GTK_BOX(wiz->protocols), sip, TRUE, TRUE, 0); + GtkWidget *iax = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sip), _("IAX2 (InterAsterix Exchange)")); + gtk_box_pack_start(GTK_BOX(wiz->protocols), iax, TRUE, TRUE, 0); - g_signal_connect(G_OBJECT(sip) , "clicked" , G_CALLBACK(set_account_type) , NULL); + g_signal_connect(G_OBJECT(sip), "clicked", G_CALLBACK(set_account_type), NULL); gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->protocols, TRUE); return wiz->protocols; @@ -294,16 +287,13 @@ GtkWidget* build_select_account() GtkWidget* build_sfl_or_account() { - GtkWidget* sfl; - GtkWidget* cus; + wiz->sflphone_org = create_vbox(GTK_ASSISTANT_PAGE_CONTENT, _("Account"), _("Please select one of the following options")); - wiz->sflphone_org = create_vbox(GTK_ASSISTANT_PAGE_CONTENT , _("Account") , _("Please select one of the following options")); - - sfl = gtk_radio_button_new_with_label(NULL, _("Create a free SIP/IAX2 account on sflphone.org \n(For testing purpose only)")); - gtk_box_pack_start(GTK_BOX(wiz->sflphone_org) , sfl , TRUE, TRUE, 0); - cus = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sfl), _("Register an existing SIP or IAX2 account")); - gtk_box_pack_start(GTK_BOX(wiz->sflphone_org) , cus , TRUE, TRUE, 0); - g_signal_connect(G_OBJECT(sfl) , "clicked" , G_CALLBACK(set_sflphone_org) , NULL); + GtkWidget *sfl = gtk_radio_button_new_with_label(NULL, _("Create a free SIP/IAX2 account on sflphone.org \n(For testing purpose only)")); + gtk_box_pack_start(GTK_BOX(wiz->sflphone_org), sfl, TRUE, TRUE, 0); + GtkWidget *cus = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(sfl), _("Register an existing SIP or IAX2 account")); + gtk_box_pack_start(GTK_BOX(wiz->sflphone_org), cus, TRUE, TRUE, 0); + g_signal_connect(G_OBJECT(sfl), "clicked", G_CALLBACK(set_sflphone_org), NULL); return wiz->sflphone_org; } @@ -315,12 +305,12 @@ GtkWidget* build_sip_account_configuration(void) GtkWidget* label; GtkWidget * clearTextCheckbox; - wiz->sip_account = create_vbox(GTK_ASSISTANT_PAGE_CONTENT , _("SIP account settings") , _("Please fill the following information")); + wiz->sip_account = create_vbox(GTK_ASSISTANT_PAGE_CONTENT, _("SIP account settings"), _("Please fill the following information")); // table - table = gtk_table_new(7, 2 , FALSE/* homogeneous */); + table = gtk_table_new(7, 2, FALSE/* homogeneous */); gtk_table_set_row_spacings(GTK_TABLE(table), 10); gtk_table_set_col_spacings(GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(wiz->sip_account) , table , TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(wiz->sip_account), table, TRUE, TRUE, 0); // alias field label = gtk_label_new_with_mnemonic(_("_Alias")); @@ -374,7 +364,7 @@ GtkWidget* build_sip_account_configuration(void) wiz->zrtp_enable = gtk_check_button_new_with_mnemonic(_("Secure communications with _ZRTP")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable), FALSE); gtk_table_attach(GTK_TABLE(table), wiz->zrtp_enable, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive(GTK_WIDGET(wiz->zrtp_enable) , TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(wiz->zrtp_enable), TRUE); //gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), wiz->sip_account, TRUE); return wiz->sip_account; @@ -385,12 +375,12 @@ GtkWidget* build_email_configuration(void) GtkWidget* label; GtkWidget* table; - wiz->email = create_vbox(GTK_ASSISTANT_PAGE_CONTENT , _("Optional email address") , _("This email address will be used to send your voicemail messages.")); + wiz->email = create_vbox(GTK_ASSISTANT_PAGE_CONTENT, _("Optional email address"), _("This email address will be used to send your voicemail messages.")); - table = gtk_table_new(4, 2 , FALSE/* homogeneous */); + table = gtk_table_new(4, 2, FALSE/* homogeneous */); gtk_table_set_row_spacings(GTK_TABLE(table), 10); gtk_table_set_col_spacings(GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(wiz->email) , table , TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(wiz->email), table, TRUE, TRUE, 0); // email field label = gtk_label_new_with_mnemonic(_("_Email address")); @@ -404,7 +394,7 @@ GtkWidget* build_email_configuration(void) wiz->zrtp_enable = gtk_check_button_new_with_mnemonic(_("Secure communications with _ZRTP")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->zrtp_enable), FALSE); gtk_table_attach(GTK_TABLE(table), wiz->zrtp_enable, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive(GTK_WIDGET(wiz->zrtp_enable) , TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(wiz->zrtp_enable), TRUE); return wiz->email; } @@ -415,12 +405,12 @@ GtkWidget* build_iax_account_configuration(void) GtkWidget* table; GtkWidget * clearTextCheckbox; - wiz->iax_account = create_vbox(GTK_ASSISTANT_PAGE_CONFIRM , _("IAX2 account settings") , _("Please fill the following information")); + wiz->iax_account = create_vbox(GTK_ASSISTANT_PAGE_CONFIRM, _("IAX2 account settings"), _("Please fill the following information")); - table = gtk_table_new(6, 2 , FALSE/* homogeneous */); + table = gtk_table_new(6, 2, FALSE/* homogeneous */); gtk_table_set_row_spacings(GTK_TABLE(table), 10); gtk_table_set_col_spacings(GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(wiz->iax_account) , table , TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(wiz->iax_account), table, TRUE, TRUE, 0); // alias field label = gtk_label_new_with_mnemonic(_("_Alias")); @@ -471,7 +461,7 @@ GtkWidget* build_iax_account_configuration(void) current -> state = ACCOUNT_STATE_UNREGISTERED; - g_signal_connect(G_OBJECT(wiz->assistant) , "apply" , G_CALLBACK(iax_apply_callback), NULL); + g_signal_connect(G_OBJECT(wiz->assistant), "apply", G_CALLBACK(iax_apply_callback), NULL); return wiz->iax_account; } @@ -481,20 +471,20 @@ GtkWidget* build_nat_settings(void) GtkWidget* label; GtkWidget* table; - wiz->nat = create_vbox(GTK_ASSISTANT_PAGE_CONFIRM , _("Network Address Translation (NAT)") , _("You should probably enable this if you are behind a firewall.")); + wiz->nat = create_vbox(GTK_ASSISTANT_PAGE_CONFIRM, _("Network Address Translation (NAT)"), _("You should probably enable this if you are behind a firewall.")); // table - table = gtk_table_new(2, 2 , FALSE/* homogeneous */); + table = gtk_table_new(2, 2, FALSE/* homogeneous */); gtk_table_set_row_spacings(GTK_TABLE(table), 10); gtk_table_set_col_spacings(GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(wiz->nat), table , TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(wiz->nat), table, TRUE, TRUE, 0); // enable wiz->enable = gtk_check_button_new_with_mnemonic(_("E_nable STUN")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wiz->enable), FALSE); gtk_table_attach(GTK_TABLE(table), wiz->enable, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_set_sensitive(GTK_WIDGET(wiz->enable) , TRUE); - g_signal_connect(G_OBJECT(GTK_TOGGLE_BUTTON(wiz->enable)) , "toggled" , G_CALLBACK(enable_stun), NULL); + gtk_widget_set_sensitive(GTK_WIDGET(wiz->enable), TRUE); + g_signal_connect(G_OBJECT(GTK_TOGGLE_BUTTON(wiz->enable)), "toggled", G_CALLBACK(enable_stun), NULL); // server address label = gtk_label_new_with_mnemonic(_("_STUN server")); @@ -505,21 +495,20 @@ GtkWidget* build_nat_settings(void) gtk_table_attach(GTK_TABLE(table), wiz->addr, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_set_sensitive(GTK_WIDGET(wiz->addr), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wiz->enable))); - g_signal_connect(G_OBJECT(wiz->assistant) , "apply" , G_CALLBACK(sip_apply_callback), NULL); + g_signal_connect(G_OBJECT(wiz->assistant), "apply", G_CALLBACK(sip_apply_callback), NULL); return wiz->nat; } GtkWidget* build_summary() { - wiz->summary = create_vbox(GTK_ASSISTANT_PAGE_SUMMARY , _("Account Registration") , _("Congratulations!")); + wiz->summary = create_vbox(GTK_ASSISTANT_PAGE_SUMMARY, _("Account Registration"), _("Congratulations!")); strcpy(message,""); - wiz->label_summary = gtk_label_new(message) ; + wiz->label_summary = gtk_label_new(message); gtk_label_set_selectable(GTK_LABEL(wiz->label_summary), TRUE); gtk_misc_set_alignment(GTK_MISC(wiz->label_summary), 0, 0); gtk_label_set_line_wrap(GTK_LABEL(wiz->label_summary), TRUE); - //gtk_widget_set_size_request(GTK_WIDGET(wiz->label_summary), 380, -1); gtk_box_pack_start(GTK_BOX(wiz->summary), wiz->label_summary, FALSE, TRUE, 0); return wiz->summary; @@ -528,9 +517,9 @@ GtkWidget* build_summary() GtkWidget* build_registration_error() { GtkWidget *label; - wiz->reg_failed = create_vbox(GTK_ASSISTANT_PAGE_SUMMARY , "Account Registration" , "Registration error"); + wiz->reg_failed = create_vbox(GTK_ASSISTANT_PAGE_SUMMARY, "Account Registration", "Registration error"); - label = gtk_label_new(" Please correct the information.") ; + label = gtk_label_new(" Please correct the information."); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_widget_set_size_request(GTK_WIDGET(label), 380, -1); @@ -549,7 +538,7 @@ void set_sip_infos_sentivite(gboolean b) void prefill_sip(void) { - if (use_sflphone_org == 1) { + if (use_sflphone_org) { char alias[300]; char *email; email = (char *) gtk_entry_get_text(GTK_ENTRY(wiz->mailbox)); @@ -579,7 +568,7 @@ typedef enum { PAGE_SUMMARY } assistant_state; -static gint forward_page_func(gint current_page , gpointer data UNUSED) +static gint forward_page_func(gint current_page, gpointer data UNUSED) { gint next_page = 0; @@ -589,9 +578,9 @@ static gint forward_page_func(gint current_page , gpointer data UNUSED) break; case PAGE_SFL: - if (use_sflphone_org) { + if (use_sflphone_org) next_page = PAGE_EMAIL; - } else + else next_page = PAGE_TYPE; break; @@ -600,8 +589,9 @@ static gint forward_page_func(gint current_page , gpointer data UNUSED) if (account_type == _SIP) { set_sip_infos_sentivite(TRUE); next_page = PAGE_SIP; - } else + } else { next_page = PAGE_IAX; + } break; case PAGE_SIP: @@ -629,18 +619,13 @@ static gint forward_page_func(gint current_page , gpointer data UNUSED) static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, const gchar *section) { - GtkWidget *vbox; - GtkWidget *label; - gchar *str; - - vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); + GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_container_set_border_width(GTK_CONTAINER(vbox), 24); gtk_assistant_append_page(GTK_ASSISTANT(wiz->assistant), vbox); gtk_assistant_set_page_type(GTK_ASSISTANT(wiz->assistant), vbox, type); - str = g_strdup_printf(" %s", title); + gchar *str = g_strdup_printf(" %s", title); gtk_assistant_set_page_title(GTK_ASSISTANT(wiz->assistant), vbox, str); - g_free(str); gtk_assistant_set_page_complete(GTK_ASSISTANT(wiz->assistant), vbox, TRUE); @@ -654,7 +639,7 @@ static GtkWidget* create_vbox(GtkAssistantPageType type, const gchar *title, con #endif if (section) { - label = gtk_label_new(NULL); + GtkWidget *label = gtk_label_new(NULL); str = g_strdup_printf("<b>%s</b>\n", section); gtk_label_set_markup(GTK_LABEL(label), str); g_free(str); diff --git a/gnome/src/config/audioconf.c b/gnome/src/config/audioconf.c index 63d4e32b3ce2eaa2b6d819a83e7407da579f9425..c47effe19e0f3f7aae9e03c30ee6f70f0e447d63 100644 --- a/gnome/src/config/audioconf.c +++ b/gnome/src/config/audioconf.c @@ -93,7 +93,7 @@ preferences_dialog_fill_codec_list(const account_t *account) gtk_list_store_set(codecStore, &iter, COLUMN_CODEC_ACTIVE, c->is_active, COLUMN_CODEC_NAME, c->name, - COLUMN_CODEC_FREQUENCY, g_strdup_printf("%d kHz", (gint)(c->sample_rate * 0.001)), + COLUMN_CODEC_FREQUENCY, g_strdup_printf("%d kHz", (gint)(c->sample_rate * 0.001)), COLUMN_CODEC_BITRATE, g_strdup_printf("%.1f kbps", c->_bitrate), -1); } @@ -184,7 +184,7 @@ select_active_output_audio_device() } while (gtk_tree_model_iter_next(model, &iter)); // No index was found, select first one - WARN("Warning : No active output device found"); + WARN("No active output device found"); gtk_combo_box_set_active(GTK_COMBO_BOX(output), 0); } @@ -530,10 +530,10 @@ GtkWidget* audiocodecs_box(const account_t *account) gtk_box_pack_start(GTK_BOX(audiocodecs_hbox), scrolledWindow, TRUE, TRUE, 0); GtkListStore *codecStore = gtk_list_store_new(CODEC_COLUMN_COUNT, G_TYPE_BOOLEAN, /* Active */ - G_TYPE_STRING, /* Name */ - G_TYPE_STRING, /* Frequency */ - G_TYPE_STRING, /* Bit rate */ - G_TYPE_STRING /* Bandwith */ + G_TYPE_STRING, /* Name */ + G_TYPE_STRING, /* Frequency */ + G_TYPE_STRING, /* Bit rate */ + G_TYPE_STRING /* Bandwidth */ ); // Create codec tree view with list store @@ -607,7 +607,7 @@ select_audio_manager(void) dbus_set_audio_manager(PULSEAUDIO_API_STR); gtk_container_remove(GTK_CONTAINER(alsa_conf) , alsabox); gtk_widget_hide(alsa_conf); - + if (gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(volumeToggle_))) { main_window_volume_controls(FALSE); eel_gconf_set_integer(SHOW_VOLUME_CONTROLS, FALSE); @@ -677,7 +677,7 @@ GtkWidget* alsa_box() GtkWidget *info_bar = gnome_info_bar(message, GTK_MESSAGE_INFO); gtk_table_attach(GTK_TABLE(table), info_bar, 1, 3, 1, 2, GTK_FILL, GTK_SHRINK, 10, 10); - DEBUG("Audio: Configuration plugin"); + DEBUG("Configuration plugin"); GtkWidget *label = gtk_label_new(_("ALSA plugin")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -699,7 +699,7 @@ GtkWidget* alsa_box() // Device : Output device // Create title label - DEBUG("Audio: Configuration output"); + DEBUG("Configuration output"); label = gtk_label_new(_("Output")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -721,7 +721,7 @@ GtkWidget* alsa_box() // Device : Input device // Create title label - DEBUG("Audio: Configuration input"); + DEBUG("Configuration input"); label = gtk_label_new(_("Input")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -742,7 +742,7 @@ GtkWidget* alsa_box() gtk_table_attach(GTK_TABLE(table), input, 2, 3, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); gtk_widget_show(input); - DEBUG("Audio: Configuration rintgtone"); + DEBUG("Configuration rintgtone"); label = gtk_label_new(_("Ringtone")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_table_attach(GTK_TABLE(table), label, 1, 2, 5, 6, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); @@ -827,7 +827,7 @@ GtkWidget* create_audio_configuration() GtkWidget *folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); /* Get the path where to save audio files */ gchar *recordingPath = dbus_get_record_path(); - DEBUG("AudioConf: Load recording path %s", recordingPath); + DEBUG("Load recording path %s", recordingPath); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(folderChooser), recordingPath); g_free(recordingPath); diff --git a/gnome/src/contacts/calllist.c b/gnome/src/contacts/calllist.c index 3c00fa83bdbdff3d05b035a1ae3694718c5f9aee..2ac7db7bdfe6a75c1a94815bb624e10e9defc67c 100644 --- a/gnome/src/contacts/calllist.c +++ b/gnome/src/contacts/calllist.c @@ -37,15 +37,19 @@ #include "logger.h" #include "eel-gconf-extensions.h" -static -gint is_callID_callstruct(gconstpointer a, gconstpointer b) +// Must return 0 when a match is found +static gint +is_callID_callstruct(gconstpointer a, gconstpointer b) { - const QueueElement *c = a; + const callable_obj_t *c = a; - if (c == NULL || c->type != HIST_CALL) + // if it's null or not a call it's not the call we're looking for + if (c == NULL) { + ERROR("NULL element in list"); return 1; + } - return utf8_case_cmp(c->elem.call->_callID, (const gchar *) b); + return g_strcmp0(c->_callID, (const gchar *) b); } // TODO : try to do this more generically @@ -86,17 +90,13 @@ void calllist_add_contact(gchar *contact_name, gchar *contact_phone, contact_typ } /* - * Function passed to calllist_clean to free every QueueElement. + * Function passed to calllist_clean to free every callable_obj_t. */ static void calllist_free_element(gpointer data, gpointer user_data UNUSED) { - QueueElement *element = data; - - g_assert(element->type == HIST_CALL); - free_callable_obj_t(element->elem.call); - - g_free(element); + callable_obj_t *call = data; + free_callable_obj_t(call); } void @@ -104,6 +104,7 @@ calllist_clean(calltab_t* tab) { g_queue_foreach(tab->callQueue, calllist_free_element, NULL); g_queue_free(tab->callQueue); + tab->callQueue = 0; } void @@ -116,19 +117,15 @@ calllist_reset(calltab_t* tab) void calllist_add_call(calltab_t* tab, callable_obj_t * c) { - QueueElement *element = g_new0(QueueElement, 1); - element->type = HIST_CALL; - element->elem.call = c; - g_queue_push_tail(tab->callQueue, (gpointer) element); + DEBUG("Adding call with callID %s to tab %s", c->_callID, tab->_name); + g_queue_push_tail(tab->callQueue, c); + DEBUG("Tab %s has %d calls", tab->_name, calllist_get_size(tab)); } void calllist_add_call_to_front(calltab_t* tab, callable_obj_t * c) { - QueueElement *element = g_new0(QueueElement, 1); - element->type = HIST_CALL; - element->elem.call = c; - g_queue_push_head(tab->callQueue, (gpointer) element); + g_queue_push_head(tab->callQueue, c); } void @@ -137,10 +134,9 @@ calllist_clean_history(void) guint size = calllist_get_size(history_tab); for (guint i = 0; i < size; i++) { - QueueElement* c = calllist_get_nth(history_tab, i); - - if (c->type == HIST_CALL) - calltree_remove_call(history_tab, c->elem.call); + callable_obj_t * c = calllist_get_nth(history_tab, i); + if (c) + calltree_remove_call(history_tab, c); } calllist_reset(history_tab); @@ -161,23 +157,18 @@ calllist_remove_call(calltab_t* tab, const gchar * callID) if (c == NULL) return; - QueueElement *element = (QueueElement *) c->data; + callable_obj_t *call = c->data; - if (element->type != HIST_CALL) { - ERROR("CallList: Error: Element %s is not a call", callID); - return; - } - - g_queue_remove(tab->callQueue, element); + DEBUG("Removing call %s from tab %s", callID, tab->_name); + g_queue_remove(tab->callQueue, call); /* Don't save empty (i.e. started dialing, then deleted) calls */ - if (element->elem.call->_peer_number && strlen(element->elem.call->_peer_number) > 0) { - calllist_add_call(history_tab, element->elem.call); - calltree_add_history_entry(element->elem.call); + if (call->_peer_number && strlen(call->_peer_number) > 0) { + calllist_add_call(history_tab, call); + calltree_add_history_entry(call); } } - callable_obj_t * calllist_get_by_state(calltab_t* tab, call_state_t state) { @@ -191,7 +182,7 @@ calllist_get_size(const calltab_t* tab) return g_queue_get_length(tab->callQueue); } -QueueElement * +callable_obj_t* calllist_get_nth(calltab_t* tab, guint n) { return g_queue_peek_nth(tab->callQueue, n); @@ -203,16 +194,9 @@ calllist_get_call(calltab_t* tab, const gchar * callID) GList * c = g_queue_find_custom(tab->callQueue, callID, is_callID_callstruct); if (c == NULL) { - ERROR("CallList: Error: Could not find call %s", callID); - return NULL; - } - - QueueElement *element = c->data; - - if (element->type != HIST_CALL) { - ERROR("CallList: Error: Element %s is not a call", callID); + ERROR("Could not find call %s in tab %s", callID, tab->_name); return NULL; } - return element->elem.call; + return c->data; } diff --git a/gnome/src/contacts/calllist.h b/gnome/src/contacts/calllist.h index b69814b5e14d4549878e6747d6a72e8358fc8a0e..1cb3c5d268b0f484340c5860e0ae38dc33564187 100644 --- a/gnome/src/contacts/calllist.h +++ b/gnome/src/contacts/calllist.h @@ -39,18 +39,6 @@ * @brief A list to hold calls. */ -typedef enum { HIST_CALL } ElementType; - -typedef union { - callable_obj_t *call; - conference_obj_t *conf; -} callableElement; - -typedef struct { - ElementType type; - callableElement elem; -} QueueElement; - typedef struct { GtkTreeStore* store; GtkWidget* view; @@ -118,7 +106,7 @@ calllist_get_size(const calltab_t* tab); /** Return the call at the nth position in the list * @param n The position of the call you want * @return A call or NULL */ -QueueElement * +callable_obj_t* calllist_get_nth(calltab_t* tab, guint n); /** Return the call corresponding to the callID diff --git a/gnome/src/contacts/calltree.c b/gnome/src/contacts/calltree.c index dcb17c6a2de525849effcdc2b21c53dc134752e9..405ff1cc5cc27936c78b23dc6bc0f20730a53599 100644 --- a/gnome/src/contacts/calltree.c +++ b/gnome/src/contacts/calltree.c @@ -51,6 +51,10 @@ #include "imwindow.h" #include "searchbar.h" +#if !GLIB_CHECK_VERSION(2, 30, 0) +#define G_VALUE_INIT { 0, { { 0 } } } +#endif + // Messages used in menu item static const gchar * const SFL_CREATE_CONFERENCE = "Create conference"; static const gchar * const SFL_TRANSFER_CALL = "Transfer call to"; @@ -129,7 +133,7 @@ is_conference(GtkTreeModel *model, GtkTreeIter *iter) static void call_selected_cb(GtkTreeSelection *sel, void* data UNUSED) { - DEBUG("CallTree: Selection callback"); + DEBUG("Selection callback"); GtkTreeModel *model = gtk_tree_view_get_model(gtk_tree_selection_get_tree_view(sel)); GtkTreeIter iter; @@ -139,12 +143,10 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED) return; } - if (active_calltree_tab == history_tab) { - DEBUG("CallTree: Current call tree is history"); - } - else if (active_calltree_tab == current_calls_tab) { - DEBUG("CallTree: Current call tree is current calls"); - } + if (active_calltree_tab == history_tab) + DEBUG("Current call tree is history"); + else if (active_calltree_tab == current_calls_tab) + DEBUG("Current call tree is current calls"); // store info for dragndrop GtkTreePath *path = gtk_tree_model_get_path(model, &iter); @@ -157,7 +159,7 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED) gtk_tree_model_get_value(model, &iter, COLUMN_ACCOUNT_PTR, &val); if (is_conference(model, &iter)) { - DEBUG("CallTree: Selected a conference"); + DEBUG("Selected a conference"); calltree_source_type = A_CONFERENCE; calltree_source_conf = (conference_obj_t*) g_value_get_pointer(&val); @@ -174,11 +176,11 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED) if (calltree_source_conf->_im_widget) im_window_show_tab(calltree_source_conf->_im_widget); - DEBUG("CallTree: source_path %s, source_conf_id %s, source_path_depth %d", + DEBUG("source_path %s, source_conf_id %s, source_path_depth %d", calltree_source_path, calltree_source_call_id, calltree_source_path_depth); } } else { - DEBUG("CallTree: Selected a call"); + DEBUG("Selected a call"); calltree_source_type = A_CALL; calltree_source_call = g_value_get_pointer(&val); @@ -195,7 +197,7 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED) if (calltree_source_call->_im_widget) im_window_show_tab(calltree_source_call->_im_widget); - DEBUG("CallTree: source_path %s, source_call_id %s, source_path_depth %d", + DEBUG("source_path %s, source_call_id %s, source_path_depth %d", calltree_source_path, calltree_source_call_id, calltree_source_path_depth); } } @@ -211,10 +213,10 @@ row_activated(GtkTreeView *tree_view UNUSED, GtkTreeViewColumn *column UNUSED, void * data UNUSED) { - DEBUG("CallTree: Double click action"); + DEBUG("Double click action"); if (calltab_get_selected_type(active_calltree_tab) == A_CALL) { - DEBUG("CallTree: Selected a call"); + DEBUG("Selected a call"); callable_obj_t *selectedCall = calltab_get_selected_call(active_calltree_tab); if (selectedCall) { @@ -251,7 +253,7 @@ row_activated(GtkTreeView *tree_view UNUSED, } } } else if (calltab_get_selected_type(active_calltree_tab) == A_CONFERENCE) { - DEBUG("CallTree: Selected a conference"); + DEBUG("Selected a conference"); if (active_calltree_tab == current_calls_tab) { conference_obj_t * selectedConf = calltab_get_selected_conf(current_calls_tab); @@ -274,7 +276,7 @@ row_activated(GtkTreeView *tree_view UNUSED, } } } else - WARN("CallTree: Selected a conference in history, should not be possible"); + WARN("Selected a conference in history, should not be possible"); } } @@ -284,18 +286,18 @@ row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) { gchar * displaySasOnce = NULL; - DEBUG("CallTree: Single click action"); + DEBUG("Single click action"); callable_obj_t *selectedCall = calltab_get_selected_call(active_calltree_tab); conference_obj_t *selectedConf = calltab_get_selected_conf(active_calltree_tab); if (active_calltree_tab == current_calls_tab) - DEBUG("CallTree: Active calltree is current_calls"); + DEBUG("Active calltree is current_calls"); else if (active_calltree_tab == history_tab) - DEBUG("CallTree: Active calltree is history"); + DEBUG("Active calltree is history"); if (calltab_get_selected_type(active_calltree_tab) == A_CALL) { - DEBUG("CallTree: Selected a call"); + DEBUG("Selected a call"); if (selectedCall) { account_t *account_details = account_list_get_by_id(selectedCall->_accountID); @@ -339,11 +341,11 @@ row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) } } } else if (calltab_get_selected_type(active_calltree_tab) == A_CONFERENCE) { - DEBUG("CallTree: Selected a conference"); + DEBUG("Selected a conference"); if (selectedConf) - DEBUG("CallTree: There is actually a selected conf"); + DEBUG("There is actually a selected conf"); } else - WARN("CallTree: Warning: Unknown selection type"); + WARN("Unknown selection type"); } static gboolean @@ -370,6 +372,10 @@ static gchar *clean_display_number(gchar *name) name += (sizeof(SIP_PREFIX) - 1); else if (g_str_has_prefix(name, SIPS_PREFIX)) name += (sizeof(SIPS_PREFIX) - 1); + + gchar * pos = g_strrstr(name, ">"); + if (pos) + *pos = '\0'; return name; } @@ -389,7 +395,8 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, con } // Different display depending on type - gchar *name, *details = NULL; + gchar *name = NULL; + gchar *details = NULL; if (*c->_display_name) { name = c->_display_name; @@ -569,7 +576,7 @@ calltree_remove_call_recursive(calltab_t* tab, gconstpointer callable, GtkTreeIt GtkTreeModel *model = GTK_TREE_MODEL(store); if (!callable) - ERROR("CallTree: Error: Not a valid call"); + ERROR("Not a valid call"); int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); @@ -604,7 +611,8 @@ calltree_remove_call_recursive(calltab_t* tab, gconstpointer callable, GtkTreeIt void calltree_remove_call(calltab_t* tab, callable_obj_t * c) { - calltree_remove_call_recursive(tab, c, NULL); + if (c) + calltree_remove_call_recursive(tab, c, NULL); } GdkPixbuf *history_state_to_pixbuf(const gchar *history_state) @@ -844,7 +852,7 @@ void calltree_add_call(calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) } else if (tab == contacts_tab) pixbuf = c->_contact_thumbnail; else - WARN("CallTree: This widget doesn't exist - This is a bug in the application."); + WARN("This widget doesn't exist - This is a bug in the application."); //Resize it if (pixbuf && (gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32)) { @@ -933,14 +941,14 @@ void calltree_add_conference_to_current_calls(conference_obj_t* conf) account_t *account_details = NULL; if (!conf) { - ERROR("Calltree: Error: Conference is null"); + ERROR("Conference is null"); return; } else if (!conf->_confID) { - ERROR("Calltree: Error: Conference ID is null"); + ERROR("Conference ID is null"); return; } - DEBUG("Calltree: Add conference %s", conf->_confID); + DEBUG("Add conference %s", conf->_confID); GtkTreeIter iter; gtk_tree_store_append(current_calls_tab->store, &iter, NULL); @@ -987,33 +995,33 @@ void calltree_add_conference_to_current_calls(conference_obj_t* conf) conf->_conference_secured = TRUE; if (conf->participant_list) { - DEBUG("Calltree: Determine if at least one participant uses SRTP"); + DEBUG("Determine if at least one participant uses SRTP"); for (GSList *part = conf->participant_list; part; part = g_slist_next(part)) { const gchar * const call_id = (const gchar *) part->data; callable_obj_t *call = calllist_get_call(current_calls_tab, call_id); if (call == NULL) - ERROR("Calltree: Error: Could not find call %s in call list", call_id); + ERROR("Could not find call %s in call list", call_id); else { account_details = account_list_get_by_id(call->_accountID); gchar *srtp_enabled = ""; if (!account_details) - ERROR("Calltree: Error: Could not find account %s in account list", call->_accountID); + ERROR("Could not find account %s in account list", call->_accountID); else srtp_enabled = g_hash_table_lookup(account_details->properties, ACCOUNT_SRTP_ENABLED); if (utf8_case_equal(srtp_enabled, "true")) { - DEBUG("Calltree: SRTP enabled for participant %s", call_id); + DEBUG("SRTP enabled for participant %s", call_id); conf->_conf_srtp_enabled = TRUE; break; } else - DEBUG("Calltree: SRTP is not enabled for participant %s", call_id); + DEBUG("SRTP is not enabled for participant %s", call_id); } } - DEBUG("Calltree: Determine if all conference participants are secured"); + DEBUG("Determine if all conference participants are secured"); if (conf->_conf_srtp_enabled) { for (GSList *part = conf->participant_list; part; part = g_slist_next(part)) { @@ -1022,11 +1030,11 @@ void calltree_add_conference_to_current_calls(conference_obj_t* conf) if (call) { if (call->_srtp_state == SRTP_STATE_UNLOCKED) { - DEBUG("Calltree: Participant %s is not secured", call_id); + DEBUG("Participant %s is not secured", call_id); conf->_conference_secured = FALSE; break; } else - DEBUG("Calltree: Participant %s is secured", call_id); + DEBUG("Participant %s is secured", call_id); } } } @@ -1034,15 +1042,15 @@ void calltree_add_conference_to_current_calls(conference_obj_t* conf) if (conf->_conf_srtp_enabled) { if (conf->_conference_secured) { - DEBUG("Calltree: Conference is secured"); + DEBUG("Conference is secured"); pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL); } else { - DEBUG("Calltree: Conference is not secured"); + DEBUG("Conference is not secured"); pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_off.svg", NULL); } } - DEBUG("Calltree: Add conference to tree store"); + DEBUG("Add conference to tree store"); gchar *description = g_markup_printf_escaped("<b>%s</b>", ""); gtk_tree_store_set(current_calls_tab->store, &iter, @@ -1102,7 +1110,7 @@ void calltree_remove_conference_recursive(calltab_t* tab, const conference_obj_t /* if this is the conference we want to remove */ if (tempconf == conf) { int nbParticipants = gtk_tree_model_iter_n_children(model, &iter_parent); - DEBUG("CallTree: nbParticipants: %d", nbParticipants); + DEBUG("nbParticipants: %d", nbParticipants); for (int j = 0; j < nbParticipants; j++) { GtkTreeIter iter_child; @@ -1120,7 +1128,7 @@ void calltree_remove_conference_recursive(calltab_t* tab, const conference_obj_t } } - DEBUG("CallTree: Remove conference %s", conf->_confID); + DEBUG("Remove conference %s", conf->_confID); gtk_tree_store_remove(tab->store, &iter_parent); } } @@ -1134,9 +1142,9 @@ void calltree_remove_conference_recursive(calltab_t* tab, const conference_obj_t void calltree_remove_conference(calltab_t* tab, const conference_obj_t* conf) { - DEBUG("CallTree: Remove conference %s", conf->_confID); + DEBUG("Remove conference %s", conf->_confID); calltree_remove_conference_recursive(tab, conf, NULL); - DEBUG("CallTree: Finished Removing conference"); + DEBUG("Finished Removing conference"); } void calltree_display(calltab_t *tab) @@ -1162,14 +1170,14 @@ void calltree_display(calltab_t *tab) gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(contactButton_), TRUE); set_focus_on_addressbook_searchbar(); } else - ERROR("CallTree: Error: Not a valid call tab (%d, %s)", __LINE__, __FILE__); + ERROR("Not a valid call tab (%d, %s)", __LINE__, __FILE__); gtk_widget_hide(active_calltree_tab->tree); active_calltree_tab = tab; gtk_widget_show(active_calltree_tab->tree); GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(active_calltree_tab->view)); - DEBUG("CallTree: Emit signal changed from calltree_display"); + DEBUG("Emit signal changed from calltree_display"); g_signal_emit_by_name(sel, "changed"); update_actions(); } @@ -1290,20 +1298,20 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context UNUSED, gpo // Make sure drag n drop does not imply a dialing call for either source and dest call if (calltree_source_call && (calltree_source_type == A_CALL)) { - DEBUG("CallTree: Selected a call"); + DEBUG("Selected a call"); if (non_draggable_call(calltree_source_call)) { - DEBUG("CallTree: Selected an invalid call"); + DEBUG("Selected an invalid call"); undo_drag_call_action(calltree_source_call_for_drag, NULL); return; } if (calltree_dest_call && (calltree_dest_type == A_CALL)) { - DEBUG("CallTree: Dragged on a call"); + DEBUG("Dragged on a call"); if (non_draggable_call(calltree_dest_call)) { - DEBUG("CallTree: Dragged on an invalid call"); + DEBUG("Dragged on an invalid call"); undo_drag_call_action(calltree_source_call_for_drag, spath); return; } @@ -1554,17 +1562,20 @@ void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context UNUSED, gi static void menuitem_response(gchar * string) { - if (g_strcmp0(string, SFL_CREATE_CONFERENCE) == 0) + if (g_strcmp0(string, SFL_CREATE_CONFERENCE) == 0) { dbus_join_participant(calltree_source_call_for_drag->_callID, calltree_dest_call->_callID); + calltree_remove_call(current_calls_tab, calltree_source_call); + calltree_remove_call(current_calls_tab, calltree_dest_call); + } else if (g_strcmp0(string, SFL_TRANSFER_CALL) == 0) { - DEBUG("Calltree: Transferring call %s, to %s", + DEBUG("Transferring call %s, to %s", calltree_source_call->_peer_number, calltree_dest_call->_peer_number); dbus_attended_transfer(calltree_source_call, calltree_dest_call); calltree_remove_call(current_calls_tab, calltree_source_call); } else - DEBUG("CallTree: Error unknown option in menu %s", string); + ERROR("Unknown option in menu %s", string); // Make sure the create conference option will appear next time the menu pops // The create conference option will hide if tow call from the same conference are draged on each other diff --git a/gnome/src/dbus/callmanager-introspec.xml b/gnome/src/dbus/callmanager-introspec.xml index 0682fb319c33f663548c74b9ef0db686ed3b94f1..9aa97ca930901f35d6e17d5041cf05b0f0b82208 100644 --- a/gnome/src/dbus/callmanager-introspec.xml +++ b/gnome/src/dbus/callmanager-introspec.xml @@ -375,6 +375,7 @@ <li>DISPLAY_NAME</li> <li>CALL_STATE</li> <li>CALL_TYPE</li> + <li>CONF_ID</li> </ul> </tp:docstring> </arg> @@ -671,7 +672,7 @@ </arg> </signal> - <signal name="transferSucceded" tp:name-for-bindings="transferSucceded"> + <signal name="transferSucceeded" tp:name-for-bindings="transferSucceeded"> <tp:docstring> <p>Transfer has been successfully processed. Client should remove transfered @@ -682,7 +683,7 @@ <signal name="transferFailed" tp:name-for-bindings="transferFailed"> <tp:docstring> - <p>Transfer operation failed. Corespondin + <p>Transfer operation failed. Corresponding call is no longer accessible in SFLphone-daemon.</p> </tp:docstring> diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index 73975e6e18928b39880b1159dfc13c28e1a90680..b4a97752421463f22329466ffa8996bb9512798a 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -215,7 +215,7 @@ process_existing_call_state_change(callable_obj_t *c, const gchar *state) /** * This function process call state changes in case the call have not been created yet. - * This mainly occurs when anotehr SFLphone client takes actions. + * This mainly occurs when another SFLphone client takes actions. */ static void process_nonexisting_call_state_change(const gchar *callID, const gchar *state) @@ -229,7 +229,7 @@ process_nonexisting_call_state_change(const gchar *callID, const gchar *state) } else if (g_strcmp0(state, "HUNGUP") == 0) return; // Could occur if a user picked up the phone and hung up without making a call - // The callID is unknow, threat it like a new call + // The callID is unknown, treat it like a new call // If it were an incoming call, we won't be here // It means that a new call has been initiated with an other client (cli for instance) if (g_strcmp0(state, "RINGING") == 0 || @@ -238,17 +238,10 @@ process_nonexisting_call_state_change(const gchar *callID, const gchar *state) DEBUG("DBUS: New ringing call! accountID: %s", callID); - // We fetch the details associated to the specified call - GHashTable *call_details = dbus_get_call_details(callID); - callable_obj_t *new_call = create_new_call_from_details(callID, call_details); - - if (utf8_case_equal(g_hash_table_lookup(call_details, "CALL_TYPE"), INCOMING_STRING)) - new_call->_history_state = g_strdup(INCOMING_STRING); - else - new_call->_history_state = g_strdup(OUTGOING_STRING); - - calllist_add_call(current_calls_tab, new_call); - calltree_add_call(current_calls_tab, new_call, NULL); + restore_call(callID); + callable_obj_t *new_call = calllist_get_call(current_calls_tab, callID); + if (new_call) + calltree_add_call(current_calls_tab, new_call, NULL); update_actions(); calltree_display(current_calls_tab); } @@ -412,15 +405,14 @@ record_playback_stopped_cb(DBusGProxy *proxy UNUSED, const gchar *filepath) const gint calllist_size = calllist_get_size(history_tab); for (gint i = 0; i < calllist_size; i++) { - QueueElement *element = calllist_get_nth(history_tab, i); + callable_obj_t *call = calllist_get_nth(history_tab, i); - if (element == NULL) { + if (call == NULL) { ERROR("DBUS: ERROR: Could not find %dth call", i); break; - } else if (element->type == HIST_CALL) { - if (g_strcmp0(element->elem.call->_recordfile, filepath) == 0) - element->elem.call->_record_is_playing = FALSE; } + if (g_strcmp0(call->_recordfile, filepath) == 0) + call->_record_is_playing = FALSE; } update_actions(); @@ -1476,7 +1468,7 @@ dbus_is_iax2_enabled() void dbus_join_participant(const gchar *sel_callID, const gchar *drag_callID) { - DEBUG("DBUS: Join participant %s and %s\n", sel_callID, drag_callID); + DEBUG("Join participant %s and %s\n", sel_callID, drag_callID); GError *error = NULL; org_sflphone_SFLphone_CallManager_join_participant(call_proxy, sel_callID, drag_callID, &error); check_error(error); diff --git a/gnome/src/main.c b/gnome/src/main.c index e8a52457e724eeea02470007e9a25983c963b24f..7c5da73a9639c3530c9c79977b22fb5d0c952dd2 100644 --- a/gnome/src/main.c +++ b/gnome/src/main.c @@ -115,8 +115,8 @@ main(int argc, char *argv[]) status_bar_display_account(); sflphone_fill_history(); - sflphone_fill_call_list(); sflphone_fill_conference_list(); + sflphone_fill_call_list(); history_search_init(); // Update the GUI diff --git a/gnome/src/mainwindow.c b/gnome/src/mainwindow.c index c57a325fc22573a65a128a813ca9d123fb69aca5..26c3118fa74f9cf75e9ebd89f75b2ad176920d95 100644 --- a/gnome/src/mainwindow.c +++ b/gnome/src/mainwindow.c @@ -130,6 +130,7 @@ main_window_ask_quit() question = _("There is one call in progress."); else question = _("There are calls in progress."); + DEBUG("Currently %d calls in progress", calllist_get_size(current_calls_tab)); GtkWidget *dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s\n%s",