diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-04-28 13:28:35 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-05-05 15:27:17 +0800 |
commit | 3e22736f0211a0bb668218243bc4764435f62a58 (patch) | |
tree | ecd42950e917fb3171ca618d3f9e0db43cd01916 /src/empathy-chat-window.c | |
parent | 4f37d474725cd006eb627e10349e0361ce9a7b29 (diff) | |
download | gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.tar gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.tar.gz gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.tar.bz2 gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.tar.lz gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.tar.xz gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.tar.zst gsoc2013-empathy-3e22736f0211a0bb668218243bc4764435f62a58.zip |
[chat-window] add a spinner to the window tab for when messages are being sent
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r-- | src/empathy-chat-window.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index ac97601ce..1012e4e90 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -314,6 +314,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); @@ -652,6 +661,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) { @@ -700,6 +711,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); @@ -719,6 +740,15 @@ chat_window_update_chat_tab_full (EmpathyChat *chat, id, tp_account_get_display_name (account)); + if (nb_sending > 0) { + append_markup_printf (tooltip, "\n"); + append_markup_printf (tooltip, + ngettext ("Sending %d message", + "Sending %d messages", + nb_sending), + nb_sending); + } + if (!EMP_STR_EMPTY (status)) { append_markup_printf (tooltip, "\n<i>%s</i>", status); } @@ -2251,6 +2281,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); |