James Westby has proposed merging lp:~james-w/indicator-applet/messages-icons 
into lp:~indicator-applet-developers/indicator-applet/messages.

Requested reviews:
    Indicator Applet Developers (indicator-applet-developers)

Hi,

This change adds images to the servers in indicator-messages
based on the icon from the desktop file if available.

They are not in the drawing at https://wiki.ubuntu.com/MessagingMenu
but we have the information, and I think it looks good and helps
quickly identify the app you are looking for, and ties in the
servers to the main menu entries, tasklist entries and title bar
icon.

Thanks,

James

-- 
https://code.launchpad.net/~james-w/indicator-applet/messages-icons/+merge/5229
Your team Indicator Applet Developers is subscribed to branch 
lp:~indicator-applet-developers/indicator-applet/messages.
=== modified file 'autogen.sh'
--- autogen.sh	2008-12-05 00:34:45 +0000
+++ autogen.sh	2009-04-05 11:03:12 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-PKG_NAME="indicator-applet"
+PKG_NAME="indicator-messages"
 
 which gnome-autogen.sh || {
 	echo "You need gnome-common from GNOME SVN"

=== modified file 'src/app-menu-item.c'
--- src/app-menu-item.c	2009-03-18 19:22:08 +0000
+++ src/app-menu-item.c	2009-04-05 11:32:26 +0000
@@ -68,7 +68,7 @@
 
 
 
-G_DEFINE_TYPE (AppMenuItem, app_menu_item, GTK_TYPE_MENU_ITEM);
+G_DEFINE_TYPE (AppMenuItem, app_menu_item, GTK_TYPE_IMAGE_MENU_ITEM);
 
 static void
 app_menu_item_class_init (AppMenuItemClass *klass)
@@ -188,15 +188,24 @@
 update_label (AppMenuItem * self)
 {
 	AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
+	GIcon *icon;
 
 	if (priv->count_on_label && !priv->unreadcount < 1) {
 		/* TRANSLATORS: This is the name of the program and the number of indicators.  So it
 		                would read something like "Mail Client (5)" */
-		gchar * label = g_strdup_printf(_("%s (%d)"), g_app_info_get_name(priv->appinfo), priv->unreadcount);
+		gchar * label = g_strdup_printf(_("%s (%d)"), app_menu_item_get_name(self), priv->unreadcount);
 		gtk_label_set_text(GTK_LABEL(priv->name), label);
 		g_free(label);
 	} else {
-		gtk_label_set_text(GTK_LABEL(priv->name), g_app_info_get_name(priv->appinfo));
+		gtk_label_set_text(GTK_LABEL(priv->name), app_menu_item_get_name(self));
+	}
+
+	icon = app_menu_item_get_icon(self);
+	if (icon) {
+		g_object_set(self, "image", gtk_image_new_from_gicon(icon, GTK_ICON_SIZE_MENU), NULL);
+		g_object_unref(icon);
+	} else {
+		g_object_set(self, "image", NULL, NULL);
 	}
 
 	return;
@@ -220,7 +229,7 @@
 	g_return_if_fail(priv->appinfo != NULL);
 
 	update_label(self);
-	g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, g_app_info_get_name(priv->appinfo), TRUE);
+	g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE);
 
 	return;
 }
@@ -300,3 +309,15 @@
 		return g_app_info_get_name(priv->appinfo);
 	}
 }
+
+GIcon *
+app_menu_item_get_icon (AppMenuItem * appitem)
+{
+	AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
+
+	if (priv->appinfo == NULL) {
+		return NULL;
+	} else {
+		return g_app_info_get_icon(priv->appinfo);
+	}
+}

=== modified file 'src/app-menu-item.h'
--- src/app-menu-item.h	2009-03-15 17:19:02 +0000
+++ src/app-menu-item.h	2009-04-05 11:32:26 +0000
@@ -43,14 +43,14 @@
 typedef struct _AppMenuItemClass AppMenuItemClass;
 
 struct _AppMenuItemClass {
-	GtkMenuItemClass parent_class;
+	GtkImageMenuItemClass parent_class;
 
 	void (* count_changed) (guint count);
 	void (* name_changed) (gchar * name);
 };
 
 struct _AppMenuItem {
-	GtkMenuItem parent;
+	GtkImageMenuItem parent;
 };
 
 GType app_menu_item_get_type (void);
@@ -58,6 +58,7 @@
 guint app_menu_item_get_count (AppMenuItem * appitem);
 IndicateListenerServer * app_menu_item_get_server (AppMenuItem * appitem);
 const gchar * app_menu_item_get_name (AppMenuItem * appitem);
+GIcon * app_menu_item_get_icon (AppMenuItem * appitem);
 
 G_END_DECLS
 

_______________________________________________
Mailing list: https://launchpad.net/~dx-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dx-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to