[empathy] display the number of other tabs



commit 8b5eb07207e7aa74a0e9081a73502f71d1be58c1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Nov 25 16:33:35 2009 +0000

    display the number of other tabs

 src/empathy-chat-window.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index ca509a8..e33092a 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]