From: Guillaume Desmottes Date: Wed, 25 Nov 2009 16:33:35 +0000 (+0000) Subject: display the number of other tabs X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=8b5eb07207e7aa74a0e9081a73502f71d1be58c1 display the number of other tabs --- diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index ca509a8d..e33092af 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -359,7 +359,25 @@ chat_window_contact_menu_update (EmpathyChatWindowPriv *priv, static gchar * get_window_title_name (EmpathyChatWindowPriv *priv) { - return g_strdup (empathy_chat_get_name (priv->current_chat)); + const gchar *active_name; + guint nb_chats; + + nb_chats = g_list_length (priv->chats); + g_assert (nb_chats > 0); + + active_name = empathy_chat_get_name (priv->current_chat); + + if (nb_chats == 1) { + /* only one tab */ + return g_strdup (active_name); + } else { + guint nb_others = nb_chats - 1; + + return g_strdup_printf (ngettext ( + "%s (and %u other)", + "%s (and %u others)", nb_others), + active_name, nb_others); + } } static void