diff options
Diffstat (limited to 'src/status-service.c')
-rw-r--r-- | src/status-service.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/status-service.c b/src/status-service.c index 14d8a34..b210dcd 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -30,6 +30,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-bindings.h> +#include <libdbusmenu-glib/client.h> #include <libdbusmenu-glib/server.h> #include <libdbusmenu-glib/menuitem.h> @@ -88,7 +89,7 @@ status_update (void) { if (global_status != oldglobal) { g_debug("Global status changed to: %s", _(status_strings[global_status])); - dbusmenu_menuitem_property_set(status_menuitem, "label", _(status_strings[global_status])); + dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status])); status_service_dbus_set_status(dbus_interface, status_icons[global_status]); } @@ -165,10 +166,12 @@ build_user_item (DbusmenuMenuitem * root) while (*walker != '\0' && *walker != ',') { walker++; } *walker = '\0'; - DbusmenuMenuitem * useritem = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(useritem, "label", name); - dbusmenu_menuitem_property_set(useritem, "sensitive", "false"); - dbusmenu_menuitem_child_append(root, useritem); + if (name[0] != '\0') { + DbusmenuMenuitem * useritem = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_LABEL, name); + dbusmenu_menuitem_property_set(useritem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + dbusmenu_menuitem_child_append(root, useritem); + } g_free(name); } else { @@ -187,15 +190,16 @@ build_menu (gpointer data) build_user_item(root); status_menuitem = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(status_menuitem, "label", _(status_strings[global_status])); + dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status])); dbusmenu_menuitem_child_append(root, status_menuitem); StatusProviderStatus i; for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { DbusmenuMenuitem * mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _(status_strings[i])); - dbusmenu_menuitem_property_set(mi, "icon", status_icons[i]); + dbusmenu_menuitem_property_set(mi, "type", DBUSMENU_CLIENT_TYPES_IMAGE); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i])); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i)); dbusmenu_menuitem_child_append(status_menuitem, mi); @@ -204,7 +208,7 @@ build_menu (gpointer data) } DbusmenuMenuitem * mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _("Lock Screen")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), GINT_TO_POINTER(i)); dbusmenu_menuitem_child_append(root, mi); |