From f5d7b28c7e708862dc1284c2a400f7f6f2ee7291 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandre.savard@savoirfairelinux.net> Date: Tue, 6 Oct 2009 16:31:55 -0400 Subject: [PATCH] [#2006] Update codec display on call selection --- sflphone-client-gnome/src/actions.c | 10 +++++++++- sflphone-client-gnome/src/contacts/calltree.c | 6 ++++++ sflphone-common/src/managerimpl.cpp | 13 +++++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 3efb14af20..d8dad00353 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -913,12 +913,20 @@ sflphone_display_selected_codec (const gchar* codecName) msg = g_markup_printf_escaped (_("IP call - %s"), codecName); } else { - msg = g_markup_printf_escaped("%s %s (%s) - %s %s" , + + if (strcmp(codecName, "") != 0) { + msg = g_markup_printf_escaped("%s %s (%s) - %s %s" , _("Using account"), (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE), _("Codec"), codecName); + } else { + msg = g_markup_printf_escaped("%s %s (%s)" , + _("Using account"), + (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_ALIAS), + (gchar*)g_hash_table_lookup( acc->properties , ACCOUNT_TYPE)); + } } statusbar_push_message( msg , __MSG_ACCOUNT_DEFAULT); g_free(msg); diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index b5f24b2694..9f802389ec 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -279,6 +279,12 @@ row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) */ if( active_calltree == current_calls ) { + + // sflphone_selected_call_codec(selectedCall); + + // DEBUG("single click action: %s", dbus_get_current_codec_name(selectedCall)); + sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); + switch(selectedCall->_srtp_state) { case SRTP_STATE_SAS_UNCONFIRMED: diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index abed5c1acf..17c1a2accb 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -2502,10 +2502,15 @@ ManagerImpl::getCodecDetails (const int32_t& payload) std::string ManagerImpl::getCurrentCodecName (const CallID& id) { - // _debug("ManagerImpl::getCurrentCodecName method called \n"); - AccountID accountid = getAccountFromCall (id); - // _debug("ManagerImpl::getCurrentCodecName : %s \n",getAccountLink(accountid)->getCurrentCodecName().c_str()); - return getAccountLink (accountid)->getCurrentCodecName(); + + AccountID accountid = getAccountFromCall(id); + VoIPLink* link = getAccountLink (accountid); + Call* call = link->getCall(id); + + if(call->getState() != Call::Active) + return ""; + else + return link->getCurrentCodecName(); } /** -- GitLab