71
73
static PopupData *popup_data = NULL;
73
// Messages used in menu item
74
static const gchar * const SFL_CREATE_CONFERENCE = "Create conference";
75
static const gchar * const SFL_TRANSFER_CALL = "Transfer call to";
75
#define SFL_CREATE_CONFERENCE _("Create conference")
76
#define SFL_TRANSFER_CALL _("Transfer call to")
77
78
static GtkWidget *calltree_popupmenu = NULL;
78
79
static GtkWidget *calltree_menu_items = NULL;
272
273
selectedCall->_zrtp_confirmed = TRUE;
274
275
dbus_confirm_sas(selectedCall);
275
calltree_update_call(current_calls_tab, selectedCall, client, TRUE);
276
calltree_update_call(current_calls_tab, selectedCall, client);
277
278
case SRTP_STATE_ZRTP_SAS_CONFIRMED:
278
279
selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED;
279
280
dbus_reset_sas(selectedCall);
280
calltree_update_call(current_calls_tab, selectedCall, client, TRUE);
281
calltree_update_call(current_calls_tab, selectedCall, client);
283
284
g_debug("Single click but no action");
327
calltree_display_call_info(callable_obj_t * call, CallDisplayType display_type,
328
const gchar *const audio_codec,
329
const gchar *const video_codec)
328
calltree_display_call_info(callable_obj_t * call, CallDisplayType display_type)
331
330
gchar display_number[strlen(call->_peer_number) + 1];
332
331
strcpy(display_number, call->_peer_number);
356
355
gchar *desc = g_markup_printf_escaped("<b>%s</b> <i>%s</i> ", name, details);
357
356
gchar *suffix = NULL;
360
358
switch (display_type) {
361
359
case DISPLAY_TYPE_CALL:
362
360
if (call->_state_code)
363
361
suffix = g_markup_printf_escaped("\n<i>%s (%d)</i>", call->_state_code_description, call->_state_code);
365
case DISPLAY_TYPE_STATE_CODE :
366
if (video_codec && *video_codec)
367
codec = g_strconcat(audio_codec, " ", video_codec, NULL);
369
codec = g_strdup(audio_codec);
371
364
if (call->_state_code)
372
suffix = g_markup_printf_escaped("\n<i>%s (%d)</i> <i>%s</i>",
373
call->_state_code_description, call->_state_code,
376
suffix = g_markup_printf_escaped("\n<i>%s</i>", codec);
365
suffix = g_markup_printf_escaped("\n<i>%s (%d)</i>",
366
call->_state_code_description, call->_state_code);
380
368
case DISPLAY_TYPE_CALL_TRANSFER:
381
suffix = g_markup_printf_escaped("\n<i>Transfer to:%s</i> ", call->_trsft_to);
369
suffix = g_markup_printf_escaped(_("\n<i>Transfer to:%s</i> "), call->_trsft_to);
383
371
case DISPLAY_TYPE_SAS:
384
suffix = g_markup_printf_escaped("\n<i>Confirm SAS <b>%s</b> ?</i>", call->_sas);
372
suffix = g_markup_printf_escaped(_("\n<i>Confirm SAS <b>%s</b> ?</i>"), call->_sas);
386
374
case DISPLAY_TYPE_HISTORY :
679
666
/* Update text */
680
667
gchar *description = NULL;
685
/* Don't get codec names if call does not exist */
686
if (ctx->update_codecs) {
687
audio_codec = call_get_audio_codec(call);
689
video_codec = call_get_video_codec(call);
691
video_codec = g_strdup("");
694
audio_codec = g_strdup("");
695
video_codec = g_strdup("");
698
669
if (call->_state == CALL_STATE_TRANSFER)
699
description = calltree_display_call_info(call, DISPLAY_TYPE_CALL_TRANSFER, "", "");
670
description = calltree_display_call_info(call, DISPLAY_TYPE_CALL_TRANSFER);
701
672
if (call->_sas && display_sas && call->_srtp_state == SRTP_STATE_ZRTP_SAS_UNCONFIRMED && !call->_zrtp_confirmed)
702
description = calltree_display_call_info(call, DISPLAY_TYPE_SAS, "", "");
673
description = calltree_display_call_info(call, DISPLAY_TYPE_SAS);
704
description = calltree_display_call_info(call, DISPLAY_TYPE_STATE_CODE, audio_codec, video_codec);
675
description = calltree_display_call_info(call, DISPLAY_TYPE_STATE_CODE);
709
677
/* Update icons */
710
678
if (calltab_has_name(tab, CURRENT_CALLS)) {
769
737
pixbuf = history_state_to_pixbuf(call);
771
739
g_free(description);
772
description = calltree_display_call_info(call, DISPLAY_TYPE_HISTORY, "", "");
740
description = calltree_display_call_info(call, DISPLAY_TYPE_HISTORY);
773
741
gchar *date = get_formatted_start_timestamp(call->_time_start);
774
742
gchar *duration = get_call_duration(call);
775
743
gchar *full_duration = g_strconcat(date , duration , NULL);
803
calltree_update_call(calltab_t* tab, callable_obj_t * call, SFLPhoneClient *client, gboolean update_codecs)
771
calltree_update_call(calltab_t* tab, callable_obj_t * call, SFLPhoneClient *client)
806
774
g_warning("Call is NULL, ignoring");
809
CallUpdateCtx ctx = {tab, call, update_codecs};
777
CallUpdateCtx ctx = {tab, call};
810
778
GtkTreeStore *store = tab->store;
811
779
GtkTreeModel *model = GTK_TREE_MODEL(store);
812
780
gtk_tree_model_foreach(model, update_call, (gpointer) &ctx);
829
797
// New call in the list
831
gchar *description = calltree_display_call_info(call, DISPLAY_TYPE_CALL, "", "");
799
gchar *description = calltree_display_call_info(call, DISPLAY_TYPE_CALL);
833
801
gtk_tree_store_prepend(tab->store, &iter, parent);
915
883
void calltree_add_history_entry(callable_obj_t *call)
917
885
// New call in the list
918
gchar * description = calltree_display_call_info(call, DISPLAY_TYPE_HISTORY, "", "");
886
gchar * description = calltree_display_call_info(call, DISPLAY_TYPE_HISTORY);
920
888
GtkTreeIter iter;
921
889
gtk_tree_store_prepend(history_tab->store, &iter, NULL);
1223
1189
case CALL_STATE_BUSY:
1226
duration = difftime(time(NULL), call->_time_start);
1231
g_snprintf(timestr, sizeof(timestr), "%.2ld:%.2ld", duration / 60, duration % 60);
1192
format_duration(call, time(NULL), timestr, sizeof(timestr));
1236
1198
statusbar_update_clock(msg);