aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-05-05 16:22:31 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-05-05 16:22:31 +0800
commitc698741b1825e306de447fa09624f4a93f067374 (patch)
treeab44edd2ab39a6a5923653aaeae1f9d6b3d7e574 /src/empathy-chat-window.c
parent981d17576bb3451bd4ac79cbd2de079fb64d260b (diff)
parent0d44943efc4f3f727861387ba89f57238aa92577 (diff)
downloadgsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.tar
gsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.tar.gz
gsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.tar.bz2
gsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.tar.lz
gsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.tar.xz
gsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.tar.zst
gsoc2013-empathy-c698741b1825e306de447fa09624f4a93f067374.zip
Merge branch 'delivery-reports-rebase'
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 2aef5d932..be83f4a29 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -311,6 +311,15 @@ chat_window_create_label (EmpathyChatWindow *window,
if (is_tab_label) {
GtkWidget *close_button;
+ GtkWidget *sending_spinner;
+
+ sending_spinner = gtk_spinner_new ();
+
+ gtk_box_pack_start (GTK_BOX (hbox), sending_spinner,
+ FALSE, FALSE, 0);
+ g_object_set_data (G_OBJECT (chat),
+ "chat-window-tab-sending-spinner",
+ sending_spinner);
close_button = gedit_close_button_new ();
g_object_set_data (G_OBJECT (chat), "chat-window-tab-close-button", close_button);
@@ -649,6 +658,8 @@ chat_window_update_chat_tab_full (EmpathyChat *chat,
const gchar *icon_name;
GtkWidget *tab_image;
GtkWidget *menu_image;
+ GtkWidget *sending_spinner;
+ guint nb_sending;
window = chat_window_find_chat (chat);
if (!window) {
@@ -697,6 +708,16 @@ chat_window_update_chat_tab_full (EmpathyChat *chat,
gtk_widget_hide (menu_image);
}
+ /* Update the sending spinner */
+ nb_sending = empathy_chat_get_n_messages_sending (chat);
+ sending_spinner = g_object_get_data (G_OBJECT (chat),
+ "chat-window-tab-sending-spinner");
+
+ g_object_set (sending_spinner,
+ "active", nb_sending > 0,
+ "visible", nb_sending > 0,
+ NULL);
+
/* Update tab tooltip */
tooltip = g_string_new (NULL);
@@ -716,6 +737,20 @@ chat_window_update_chat_tab_full (EmpathyChat *chat,
id,
tp_account_get_display_name (account));
+ if (nb_sending > 0) {
+ char *tmp = g_strdup_printf (
+ ngettext ("Sending %d message",
+ "Sending %d messages",
+ nb_sending),
+ nb_sending);
+
+ g_string_append (tooltip, "\n");
+ g_string_append (tooltip, tmp);
+
+ gtk_widget_set_tooltip_text (sending_spinner, tmp);
+ g_free (tmp);
+ }
+
if (!EMP_STR_EMPTY (status)) {
append_markup_printf (tooltip, "\n<i>%s</i>", status);
}
@@ -2243,6 +2278,9 @@ empathy_chat_window_add_chat (EmpathyChatWindow *window,
g_signal_connect (chat, "notify::sms-channel",
G_CALLBACK (chat_window_chat_notify_cb),
NULL);
+ g_signal_connect (chat, "notify::n-messages-sending",
+ G_CALLBACK (chat_window_chat_notify_cb),
+ NULL);
chat_window_chat_notify_cb (chat);
gtk_notebook_append_page_menu (GTK_NOTEBOOK (priv->notebook), child, label, popup_label);