From 854fd19b0e6f154bb7d53605f0a438217d42bff4 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandresavard@alexandresavard-desktop.(none)> Date: Tue, 1 Dec 2009 16:29:19 -0500 Subject: [PATCH] [#2474] Basic call info display function --- sflphone-client-gnome/src/contacts/calltree.c | 46 +++++++++++++++++++ sflphone-client-gnome/src/contacts/calltree.h | 14 +++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index 89a48d47d0..06fe04a158 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -253,6 +253,7 @@ row_activated(GtkTreeView *tree_view UNUSED, } + /* Catch cursor-activated signal. That is, when the entry is single clicked */ void row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) @@ -336,6 +337,51 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUS return FALSE; } + +gchar* +calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type) +{ + + gchar * description; + + if(c->_state_code == 0) { + + if(g_strcmp0("", c->_peer_name) == 0) { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + c->_peer_name, + c->_peer_number); + } + else { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + c->_peer_name, + c->_peer_number); + } + + } + else { + if(g_strcmp0("", c->_peer_name) == 0) { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>", + c->_peer_number, + c->_peer_name, + c->_state_code_description, + c->_state_code); + } + else { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>", + c->_peer_name, + c->_peer_number, + c->_state_code_description, + c->_state_code); + } + } + + + return description; + +} + + + /** * Reset call tree */ diff --git a/sflphone-client-gnome/src/contacts/calltree.h b/sflphone-client-gnome/src/contacts/calltree.h index a01565bc4b..ea5337948c 100644 --- a/sflphone-client-gnome/src/contacts/calltree.h +++ b/sflphone-client-gnome/src/contacts/calltree.h @@ -34,12 +34,22 @@ * @brief The GtkTreeView that list calls in the main window. */ -enum -{ +enum { A_CALL, A_CONFERENCE }; + +/** + * Tags used to identify display type in calltree + */ +typedef enum { + DISPLAY_TYPE_CALL_TRANSFER, + DISPLAY_TYPE_CALL, + DISPLAY_TYPE_SAS, + DISPLAY_TYPE_STATE_CODE +} CallDisplayType; + /** * Create a new widget calltree * @return GtkWidget* A new widget -- GitLab