diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 4be631e4cd3c7bfccef393bcda5f3cb90e5245ec..a38bdaa792b21e5d5f08b0b64e6d7dd5eaf192de 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1384,18 +1384,24 @@ void sflphone_fill_history (void) current_entry = (gchar *)*entries; - DEBUG("============================================ entry: %s", current_entry); + DEBUG("entry: %s", current_entry); + // Parsed a conference if(g_str_has_prefix(current_entry, "9999")) { // create a conference entry create_conference_history_entry_from_serialized(current_entry, &history_conf); + // verify if this conference have been already created yet conf = conferencelist_get(history, history_conf->_confID); if(conf == NULL) { + // if this conference haven't been created yet, add it to the conference list conferencelist_add(history, history_conf); } else { + // if this conference is already created since one of the participant have already + // been unserialized, update the recordfile value conf->_recordfile = g_strdup(history_conf->_recordfile); + DEBUG("----------------- add record file: %s", conf->_recordfile); } } else { diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 1ef277a1cadf87035fec33e510a8fbe6abec52e8..8186d00e9bc1df4faa3e618dff28fc21f244f9a1 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -79,9 +79,7 @@ static GtkWidget * voicemailToolbar; static GtkWidget * imToolbar; static GtkAction * imAction; static GtkWidget * playRecordWidget; -static GtkAction * playRecordAction; static GtkWidget * stopRecordWidget; -static GtkAction * stopRecordAction; static GtkWidget * editable_num; static GtkDialog * edit_dialog; @@ -101,7 +99,7 @@ update_actions() { DEBUG ("UIManager: Update action"); - + gtk_action_set_sensitive (GTK_ACTION (newCallAction), TRUE); gtk_action_set_sensitive (GTK_ACTION (pickUpAction), FALSE); gtk_action_set_sensitive (GTK_ACTION (hangUpAction), FALSE); @@ -157,6 +155,7 @@ update_actions() gtk_action_set_sensitive (GTK_ACTION (recordAction), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (recordWidget), FALSE); gtk_action_set_sensitive (GTK_ACTION (copyAction), FALSE); + if(abookfactory_is_addressbook_loaded()) { gtk_widget_set_sensitive (GTK_WIDGET (contactButton), FALSE); } @@ -269,10 +268,6 @@ update_actions() if (active_calltree == current_calls) gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - if (active_calltree == history) { - gtk_action_set_sensitive (GTK_ACTION(playRecordAction), TRUE); - gtk_action_set_sensitive (GTK_ACTION(stopRecordAction), TRUE); - } g_object_ref (newCallWidget); gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); @@ -282,10 +277,12 @@ update_actions() gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); else if(active_calltree == history) { if(selectedCall->_recordfile && (g_strcmp0(selectedCall->_recordfile, "") != 0)) { - if(selectedCall->_record_is_playing) + if(selectedCall->_record_is_playing) { gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(stopRecordWidget), 3); - else + } + else { gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(playRecordWidget), 3); + } } } break; @@ -744,11 +741,18 @@ start_playback_record_cb(void) return; } + if(selectedCall && selectedConf) { + ERROR("UIManager: Error: Two selected object in playback record callback"); + return; + } + if(selectedCall) { + DEBUG("UIManager: Start selected call file playback %s", selectedCall->_recordfile); result = dbus_start_recorded_file_playback(selectedCall->_recordfile); selectedCall->_record_is_playing = result; } else if(selectedConf) { + DEBUG("UIMAnager: Start selected conf file playback %s", selectedConf->_recordfile); result = dbus_start_recorded_file_playback(selectedConf->_recordfile); selectedConf->_record_is_playing = result; } @@ -775,11 +779,21 @@ stop_playback_record_cb(void) } if(selectedCall) { + if(selectedCall->_recordfile == NULL) { + ERROR("UIManager: Error: Record file is NULL"); + return; + } dbus_stop_recorded_file_playback(selectedCall->_recordfile); + DEBUG("UIManager: Stop selected call file playback %s", selectedCall->_recordfile); selectedCall->_record_is_playing = FALSE; } else if(selectedConf) { + if(selectedConf->_recordfile == NULL) { + ERROR("UIManager: Error: Record file is NULL"); + return; + } dbus_stop_recorded_file_playback(selectedConf->_recordfile); + DEBUG("UIMAnager: Start selected call file playback: %s", selectedConf->_recordfile); selectedConf->_record_is_playing = FALSE; } @@ -1808,12 +1822,8 @@ create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget) "/ToolbarActions/HistoryToolbar"); playRecordWidget = gtk_ui_manager_get_widget(ui_manager, "/ToolbarActions/StartPlaybackRecordToolbar"); - playRecordAction = gtk_ui_manager_get_action(ui_manager, - "/ToolbarActions/StartPlaybackRecord"); stopRecordWidget = gtk_ui_manager_get_widget(ui_manager, "/ToolbarActions/StopPlaybackRecordToolbar"); - stopRecordAction = gtk_ui_manager_get_action(ui_manager, - "/ToolbarActions/StopPlaybackRecord"); if(abookfactory_is_addressbook_loaded()) { contactButton = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/AddressbookToolbar"); }