From 586e053b9e3c862c8e0561c2679cd4e146d76f84 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 4 Mar 2010 00:54:02 -0600 Subject: Checking the default name on application items --- src/app-menu-item.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/app-menu-item.c') diff --git a/src/app-menu-item.c b/src/app-menu-item.c index a37daf4..f792128 100644 --- a/src/app-menu-item.c +++ b/src/app-menu-item.c @@ -30,6 +30,7 @@ with this program. If not, see . #include #include "app-menu-item.h" #include "dbus-data.h" +#include "default-applications.h" enum { COUNT_CHANGED, @@ -233,15 +234,20 @@ static void update_label (AppMenuItem * self) { AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self); + const gchar * name = get_default_name(priv->desktop); + + if (name == NULL) { + name = app_menu_item_get_name(self); + } if (priv->unreadcount > 0) { /* 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)"), app_menu_item_get_name(self), priv->unreadcount); + gchar * label = g_strdup_printf(_("%s (%d)"), _(name), priv->unreadcount); dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, label); g_free(label); } else { - dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, app_menu_item_get_name(self)); + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, _(name)); } return; -- cgit v1.2.3 From ace1ea5b32a539c2afe0feacd47033c3a7d1098b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 4 Mar 2010 14:41:48 -0600 Subject: Using the default icon in the application indicator as well. --- src/app-menu-item.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/app-menu-item.c') diff --git a/src/app-menu-item.c b/src/app-menu-item.c index f792128..7db72bf 100644 --- a/src/app-menu-item.c +++ b/src/app-menu-item.c @@ -314,10 +314,15 @@ desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar update_label(self); - GIcon * icon = g_app_info_get_icon(priv->appinfo); - gchar * iconstr = g_icon_to_string(icon); - dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); - g_free(iconstr); + const gchar * def_icon = get_default_icon(priv->desktop); + if (def_icon == NULL) { + GIcon * icon = g_app_info_get_icon(priv->appinfo); + gchar * iconstr = g_icon_to_string(icon); + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, iconstr); + g_free(iconstr); + } else { + dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_ICON_NAME, def_icon); + } g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE); -- cgit v1.2.3