pidgin: 59016466: Set the icon of media corresponding to t...

malu at pidgin.im malu at pidgin.im
Fri Aug 28 16:46:56 EDT 2009


-----------------------------------------------------------------
Revision: 59016466b173fa50996ca16d6324a76c63143b12
Ancestor: c58fff1566201c5a87e453410400d1336bd4a735
Author: malu at pidgin.im
Date: 2009-08-28T20:43:38
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/59016466b173fa50996ca16d6324a76c63143b12

Modified files:
        ChangeLog pidgin/gtkmedia.c

ChangeLog: 

Set the icon of media corresponding to the media type

-------------- next part --------------
============================================================
--- ChangeLog	80e4cf8fa8c64bb03ae4fde84800bbc4ab1e9a4c
+++ ChangeLog	d16f0351f46f5a877712ef82af938725bc0531ca
@@ -20,6 +20,8 @@ version 2.6.2 (??/??/2009):
 
 	Pidgin:
 	* Fix the auto-personize functionality in the Buddy List.
+	* Set the window icon for the media window to an icon corresponding to
+	  the type of call (headphone or webcam).
 
 version 2.6.1 (08/18/2009):
 	* Fix a crash when some users send you a link in a Yahoo IM
============================================================
--- pidgin/gtkmedia.c	e245177507947370d9a41702ddaa09bc9fa48915
+++ pidgin/gtkmedia.c	0a9c75382f49e9b4dca566679779199d4979950e
@@ -34,6 +34,7 @@
 
 #include "gtkmedia.h"
 #include "gtkutils.h"
+#include "pidginstock.h"
 
 #ifdef USE_VV
 #include "media-gst.h"
@@ -610,6 +611,7 @@ pidgin_media_ready_cb(PurpleMedia *media
 	GtkWidget *send_widget = NULL, *recv_widget = NULL, *button_widget = NULL;
 	PurpleMediaSessionType type =
 			purple_media_get_session_type(media, sid);
+	GdkPixbuf *icon = NULL;
 
 	if (gtkmedia->priv->recv_widget == NULL
 			&& type & (PURPLE_MEDIA_RECV_VIDEO |
@@ -743,6 +745,20 @@ pidgin_media_ready_cb(PurpleMedia *media
 				gtkmedia);
 	}
 
+	/* set the window icon according to the type */
+	if (type & PURPLE_MEDIA_VIDEO) {
+		icon = gtk_widget_render_icon(gtkmedia, PIDGIN_STOCK_TOOLBAR_VIDEO_CALL,
+			gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE), NULL);
+	} else if (type & PURPLE_MEDIA_AUDIO) {
+		icon = gtk_widget_render_icon(gtkmedia, PIDGIN_STOCK_TOOLBAR_AUDIO_CALL,
+			gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE), NULL);
+	}
+
+	if (icon) {
+		gtk_window_set_icon(GTK_WINDOW(gtkmedia), icon);
+		g_object_unref(icon);
+	}
+	
 	gtk_widget_show(gtkmedia->priv->display);
 }
 


More information about the Commits mailing list