aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/gossip-chat-window.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-05-08 03:48:22 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-08 03:48:22 +0800
commitc7010d43264dafca66ff65540c5d6666f1c66e2a (patch)
treeb9913e0042b112a9e97eeb7b00521459a568b58c /libempathy-gtk/gossip-chat-window.c
parent6e542b100fd2efcfb7b8a3b58bf173fed1e3e494 (diff)
downloadgsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.tar
gsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.tar.gz
gsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.tar.bz2
gsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.tar.lz
gsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.tar.xz
gsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.tar.zst
gsoc2013-empathy-c7010d43264dafca66ff65540c5d6666f1c66e2a.zip
[darcs-to-svn @ Use icon-name API instead of stock icons and update tango icons]
svn path=/trunk/; revision=32
Diffstat (limited to 'libempathy-gtk/gossip-chat-window.c')
-rw-r--r--libempathy-gtk/gossip-chat-window.c68
1 files changed, 22 insertions, 46 deletions
diff --git a/libempathy-gtk/gossip-chat-window.c b/libempathy-gtk/gossip-chat-window.c
index 9f6f1a363..feeda5e00 100644
--- a/libempathy-gtk/gossip-chat-window.c
+++ b/libempathy-gtk/gossip-chat-window.c
@@ -40,6 +40,7 @@
#include <libempathy/gossip-conf.h>
#include "gossip-chat-window.h"
+#include "empathy-images.h"
//#include "gossip-add-contact-dialog.h"
//#include "gossip-chat-invite.h"
//#include "gossip-contact-info-dialog.h"
@@ -48,7 +49,6 @@
#include "gossip-preferences.h"
#include "gossip-private-chat.h"
//#include "gossip-sound.h"
-#include "gossip-stock.h"
#include "gossip-ui-utils.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOSSIP_TYPE_CHAT_WINDOW, GossipChatWindowPriv))
@@ -106,8 +106,6 @@ struct _GossipChatWindowPriv {
static void gossip_chat_window_class_init (GossipChatWindowClass *klass);
static void gossip_chat_window_init (GossipChatWindow *window);
static void gossip_chat_window_finalize (GObject *object);
-static GdkPixbuf *chat_window_get_status_pixbuf (GossipChatWindow *window,
- GossipChat *chat);
static void chat_window_accel_cb (GtkAccelGroup *accelgroup,
GObject *object,
guint key,
@@ -354,9 +352,9 @@ gossip_chat_window_init (GossipChatWindow *window)
* stock image
*/
image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (priv->menu_conv_info));
- gtk_image_set_from_stock (GTK_IMAGE (image),
- GOSSIP_STOCK_CONTACT_INFORMATION,
- GTK_ICON_SIZE_MENU);
+ gtk_image_set_from_icon_name (GTK_IMAGE (image),
+ EMPATHY_IMAGE_CONTACT_INFORMATION,
+ GTK_ICON_SIZE_MENU);
/* Set up smiley menu */
menu = gossip_chat_view_get_smiley_menu (
@@ -502,30 +500,6 @@ gossip_chat_window_finalize (GObject *object)
G_OBJECT_CLASS (gossip_chat_window_parent_class)->finalize (object);
}
-static GdkPixbuf *
-chat_window_get_status_pixbuf (GossipChatWindow *window,
- GossipChat *chat)
-{
- GossipChatWindowPriv *priv;
- GdkPixbuf *pixbuf;
-
- priv = GET_PRIV (window);
-
- if (g_list_find (priv->chats_new_msg, chat)) {
- pixbuf = gossip_stock_render (GOSSIP_STOCK_MESSAGE,
- GTK_ICON_SIZE_MENU);
- }
- else if (g_list_find (priv->chats_composing, chat)) {
- pixbuf = gossip_stock_render (GOSSIP_STOCK_TYPING,
- GTK_ICON_SIZE_MENU);
- }
- else {
- pixbuf = gossip_chat_get_status_pixbuf (chat);
- }
-
- return pixbuf;
-}
-
static void
chat_window_accel_cb (GtkAccelGroup *accelgroup,
GObject *object,
@@ -668,15 +642,24 @@ static void
chat_window_update_status (GossipChatWindow *window,
GossipChat *chat)
{
- GtkImage *image;
- GdkPixbuf *pixbuf;
+ GossipChatWindowPriv *priv;
+ GtkImage *image;
+ const gchar *icon_name = NULL;
+
+ priv = GET_PRIV (window);
- pixbuf = chat_window_get_status_pixbuf (window, chat);
+ if (g_list_find (priv->chats_new_msg, chat)) {
+ icon_name = EMPATHY_IMAGE_MESSAGE;
+ }
+ else if (g_list_find (priv->chats_composing, chat)) {
+ icon_name = EMPATHY_IMAGE_TYPING;
+ }
+ else {
+ icon_name = gossip_chat_get_status_icon_name (chat);
+ }
image = g_object_get_data (G_OBJECT (chat), "chat-window-tab-image");
- gtk_image_set_from_pixbuf (image, pixbuf);
+ gtk_image_set_from_icon_name (image, icon_name, GTK_ICON_SIZE_MENU);
- g_object_unref (pixbuf);
-
chat_window_update_title (window, chat);
chat_window_update_tooltip (window, chat);
}
@@ -686,7 +669,6 @@ chat_window_update_title (GossipChatWindow *window,
GossipChat *chat)
{
GossipChatWindowPriv *priv;
- GdkPixbuf *pixbuf = NULL;
const gchar *str;
gchar *title;
gint n_chats;
@@ -742,16 +724,10 @@ chat_window_update_title (GossipChatWindow *window,
g_free (title);
if (priv->chats_new_msg) {
- pixbuf = gossip_stock_render (GOSSIP_STOCK_MESSAGE,
- GTK_ICON_SIZE_MENU);
+ gtk_window_set_icon_name (GTK_WINDOW (priv->dialog),
+ EMPATHY_IMAGE_MESSAGE);
} else {
- pixbuf = NULL;
- }
-
- gtk_window_set_icon (GTK_WINDOW (priv->dialog), pixbuf);
-
- if (pixbuf) {
- g_object_unref (pixbuf);
+ gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
}
}