pidgin: a18b8f63: Use stock id in the ticker.

sadrul at pidgin.im sadrul at pidgin.im
Tue Apr 28 23:31:18 EDT 2009


-----------------------------------------------------------------
Revision: a18b8f63efe643713d40b3c0b2ef93c6775d79be
Ancestor: 0f15c5a7278f404af37e6e4ba706a2e7cfc1d9e3
Author: sadrul at pidgin.im
Date: 2009-04-29T03:28:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a18b8f63efe643713d40b3c0b2ef93c6775d79be

Modified files:
        pidgin/plugins/ticker/ticker.c

ChangeLog: 

Use stock id in the ticker.

-------------- next part --------------
============================================================
--- pidgin/plugins/ticker/ticker.c	7b5481ad644abf7fa1f813e13fecf0f21eff414b
+++ pidgin/plugins/ticker/ticker.c	73aedca768bbb561cf65eef99e28404c9cc32e55
@@ -37,6 +37,7 @@
 #include "gtkblist.h"
 #include "gtkplugin.h"
 #include "gtkutils.h"
+#include "pidginstock.h"
 
 #include "gtkticker.h"
 
@@ -108,20 +109,27 @@ static TickerData *buddy_ticker_find_con
 	return NULL;
 }
 
-static void buddy_ticker_set_pixmap(PurpleContact *c) {
+static void buddy_ticker_set_pixmap(PurpleContact *c)
+{
 	TickerData *td = buddy_ticker_find_contact(c);
-	GdkPixbuf *pixbuf;
+	PurpleBuddy *buddy;
+	PurplePresence *presence;
+	const char *stock;
 
 	if(!td)
 		return;
 
-	if(!td->icon)
+	buddy = purple_contact_get_priority_buddy(c);
+	presence = purple_buddy_get_presence(buddy);
+	stock = pidgin_stock_id_from_presence(presence);
+	if(!td->icon) {
 		td->icon = gtk_image_new();
-
-	pixbuf = pidgin_blist_get_status_icon((PurpleBlistNode*)c,
-			PIDGIN_STATUS_ICON_SMALL);
-	gtk_image_set_from_pixbuf(GTK_IMAGE(td->icon), pixbuf);
-	g_object_unref(G_OBJECT(pixbuf));
+		g_object_set(G_OBJECT(td->icon), "stock", stock,
+				"icon-size", gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC),
+				NULL);
+	} else {
+		g_object_set(G_OBJECT(td->icon), "stock", stock, NULL);
+	}
 }
 
 static gboolean buddy_ticker_set_pixmap_cb(gpointer data) {


More information about the Commits mailing list