changeset 28119:092659955afb

Set the icon of media corresponding to the media type
author Marcus Lundblad <ml@update.uu.se>
date Fri, 28 Aug 2009 20:43:38 +0000
parents cbc06e756ead
children 708fd8138784
files ChangeLog pidgin/gtkmedia.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 28 17:27:02 2009 +0000
+++ b/ChangeLog	Fri Aug 28 20:43:38 2009 +0000
@@ -20,6 +20,8 @@
 
 	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
--- a/pidgin/gtkmedia.c	Fri Aug 28 17:27:02 2009 +0000
+++ b/pidgin/gtkmedia.c	Fri Aug 28 20:43:38 2009 +0000
@@ -34,6 +34,7 @@
 
 #include "gtkmedia.h"
 #include "gtkutils.h"
+#include "pidginstock.h"
 
 #ifdef USE_VV
 #include "media-gst.h"
@@ -610,6 +611,7 @@
 	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 @@
 				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);
 }