aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-03-05 00:26:41 +0100
committerSebastien Bacher <seb128@ubuntu.com>2010-03-05 00:26:41 +0100
commit9e9f4726e6414d22611c8b9e6111973ff4a3c0a5 (patch)
tree23e6f69f8b4d270c679db1e32c7e514d071a25cb /src/app-menu-item.c
parent70d3f9f95831e459b3ff6d3aefaeb27bee392e88 (diff)
parent36edac8cb9ed2ef0639b38104d6b4455e19cb78c (diff)
downloadayatana-indicator-messages-9e9f4726e6414d22611c8b9e6111973ff4a3c0a5.tar.gz
ayatana-indicator-messages-9e9f4726e6414d22611c8b9e6111973ff4a3c0a5.tar.bz2
ayatana-indicator-messages-9e9f4726e6414d22611c8b9e6111973ff4a3c0a5.zip
releasing version 0.3.3-0ubuntu1
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index a37daf4..7db72bf 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -30,6 +30,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libdbusmenu-glib/menuitem-proxy.h>
#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;
@@ -308,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);