]> git.0d.be Git - empathy.git/commitdiff
display the number of other tabs
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 25 Nov 2009 16:33:35 +0000 (16:33 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 27 Nov 2009 15:24:59 +0000 (15:24 +0000)
src/empathy-chat-window.c

index ca509a8d68507a26494af250eecf7544ee4da79c..e33092af726b8ed644eb55dd591ad3961c3c4571 100644 (file)
@@ -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