diff options
author | Ted Gould <ted@gould.cx> | 2010-03-15 16:55:39 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-15 16:55:39 -0500 |
commit | 03a2de405664a797b723dd8bd542b26817dd44e6 (patch) | |
tree | cb765aebbb17782cc35c496d711199a4a4907559 /src | |
parent | e2ec91edf103da4240a5591b283d625f9a12d361 (diff) | |
download | ayatana-indicator-session-03a2de405664a797b723dd8bd542b26817dd44e6.tar.gz ayatana-indicator-session-03a2de405664a797b723dd8bd542b26817dd44e6.tar.bz2 ayatana-indicator-session-03a2de405664a797b723dd8bd542b26817dd44e6.zip |
Adding properties for allowing the suspend and hibernate
Diffstat (limited to 'src')
-rw-r--r-- | src/session-service.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/session-service.c b/src/session-service.c index 4820f59..a915884 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -91,6 +91,8 @@ static DbusmenuMenuitem * shutdown_mi = NULL; static gboolean can_hibernate = TRUE; static gboolean can_suspend = TRUE; +static gboolean allow_hibernate = TRUE; +static gboolean allow_suspend = TRUE; static GConfClient * gconf_client = NULL; @@ -566,14 +568,14 @@ rebuild_items (DbusmenuMenuitem *root, dbusmenu_menuitem_child_append(root, logout_mi); g_signal_connect(G_OBJECT(logout_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); - if (can_suspend) { + if (can_suspend && allow_suspend) { suspend_mi = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Sleep")); dbusmenu_menuitem_child_append(root, suspend_mi); g_signal_connect(G_OBJECT(suspend_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(machine_sleep), "Suspend"); } - if (can_hibernate) { + if (can_hibernate && allow_hibernate) { hibernate_mi = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(hibernate_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Hibernate")); dbusmenu_menuitem_child_append(root, hibernate_mi); |