diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-10-20 21:43:56 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-10-20 21:43:56 +0800 |
commit | 6eedc10b7367d6455aede5e74788b6a1ca608ea0 (patch) | |
tree | 3e6a9276f02c57b2e2c941b20f2352f0593eed36 | |
parent | 7d2255306d8c07e760917b1e8a4351c78ee302ed (diff) | |
download | gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.tar gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.tar.gz gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.tar.bz2 gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.tar.lz gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.tar.xz gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.tar.zst gsoc2013-empathy-6eedc10b7367d6455aede5e74788b6a1ca608ea0.zip |
Don't display any icon if we have been disconnected
-rw-r--r-- | src/empathy-chat-window.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index f07d25134..139ab7580 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -420,6 +420,8 @@ chat_window_update_chat_tab (EmpathyChat *chat) GString *tooltip; gchar *markup; const gchar *icon_name; + GtkWidget *tab_image; + GtkWidget *menu_image; window = chat_window_find_chat (chat); if (!window) { @@ -439,7 +441,7 @@ chat_window_update_chat_tab (EmpathyChat *chat) /* Update tab image */ if (empathy_chat_get_tp_chat (chat) == NULL) { /* No TpChat, we are disconnected */ - icon_name = EMPATHY_IMAGE_OFFLINE; + icon_name = NULL; } else if (g_list_find (priv->chats_new_msg, chat)) { icon_name = EMPATHY_IMAGE_MESSAGE; @@ -452,10 +454,18 @@ chat_window_update_chat_tab (EmpathyChat *chat) } else { icon_name = EMPATHY_IMAGE_GROUP_MESSAGE; } - widget = g_object_get_data (G_OBJECT (chat), "chat-window-tab-image"); - gtk_image_set_from_icon_name (GTK_IMAGE (widget), icon_name, GTK_ICON_SIZE_MENU); - widget = g_object_get_data (G_OBJECT (chat), "chat-window-menu-image"); - gtk_image_set_from_icon_name (GTK_IMAGE (widget), icon_name, GTK_ICON_SIZE_MENU); + + tab_image = g_object_get_data (G_OBJECT (chat), "chat-window-tab-image"); + menu_image = g_object_get_data (G_OBJECT (chat), "chat-window-menu-image"); + if (icon_name != NULL) { + gtk_image_set_from_icon_name (GTK_IMAGE (tab_image), icon_name, GTK_ICON_SIZE_MENU); + gtk_widget_show (tab_image); + gtk_image_set_from_icon_name (GTK_IMAGE (menu_image), icon_name, GTK_ICON_SIZE_MENU); + gtk_widget_show (menu_image); + } else { + gtk_widget_hide (tab_image); + gtk_widget_hide (menu_image); + } /* Update tab tooltip */ tooltip = g_string_new (NULL); |