diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-session.c | 2 | ||||
-rw-r--r-- | src/session-service.c | 24 | ||||
-rw-r--r-- | src/status-service.c | 22 | ||||
-rw-r--r-- | src/users-service.c | 4 |
4 files changed, 28 insertions, 24 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c index 43c568f..8a4e298 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -367,7 +367,7 @@ build_users_menu (gpointer userdata) } if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_USERS_DBUS_NAME, 0, &returnval, &error)) { - g_error("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" ); + g_error("Unable to send message to DBus to start service"); g_error_free(error); return FALSE; } diff --git a/src/session-service.c b/src/session-service.c index 0e89fed..9e5cbb2 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -84,7 +84,7 @@ suspend_prop_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) g_debug("Got Suspend: %s", g_value_get_boolean(&candoit) ? "true" : "false"); if (suspend_mi != NULL) { - dbusmenu_menuitem_property_set(suspend_mi, "visible", g_value_get_boolean(&candoit) ? "true" : "false"); + dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, g_value_get_boolean(&candoit) ? "true" : "false"); } return; @@ -107,7 +107,7 @@ hibernate_prop_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer userdata) g_debug("Got Hibernate: %s", g_value_get_boolean(&candoit) ? "true" : "false"); if (suspend_mi != NULL) { - dbusmenu_menuitem_property_set(hibernate_mi, "visible", g_value_get_boolean(&candoit) ? "true" : "false"); + dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, g_value_get_boolean(&candoit) ? "true" : "false"); } return; @@ -226,39 +226,39 @@ create_items (DbusmenuMenuitem * root) { mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(mi, "label", _("Log Out")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); } else { - dbusmenu_menuitem_property_set(mi, "label", _("Log Out ...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out ...")); } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); suspend_mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(suspend_mi, "visible", "false"); - dbusmenu_menuitem_property_set(suspend_mi, "label", _("Suspend")); + dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); + dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Suspend")); dbusmenu_menuitem_child_append(root, suspend_mi); g_signal_connect(G_OBJECT(suspend_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Suspend"); hibernate_mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(hibernate_mi, "visible", "false"); - dbusmenu_menuitem_property_set(hibernate_mi, "label", _("Hibernate")); + dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); + dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Hibernate")); dbusmenu_menuitem_child_append(root, hibernate_mi); g_signal_connect(G_OBJECT(hibernate_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Hibernate"); mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(mi, "label", _("Restart")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart")); } else { - dbusmenu_menuitem_property_set(mi, "label", _("Restart ...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart ...")); } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart"); mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(mi, "label", _("Shutdown")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); } else { - dbusmenu_menuitem_property_set(mi, "label", _("Shutdown ...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ...")); } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); 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); diff --git a/src/users-service.c b/src/users-service.c index 9ada91f..5db832b 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -113,14 +113,14 @@ create_items (DbusmenuMenuitem * root) { if (check_guest_session()) { mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _("Guest Session")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session")); dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_guest_session), NULL); } if (check_new_session()) { mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _("New Session...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("New Session...")); dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_new_session), NULL); } |