aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2013-04-19 10:38:43 +0100
committerIain Lane <iain.lane@canonical.com>2013-04-19 10:38:43 +0100
commit58c80d41f5f7ae1f02d43aba1536416d45d89a8f (patch)
tree14a8197ba1cd0917c8ec061df81335c27e76ea8f /src
parent40c99158a7f39b9932d531a16fe82eb399dcbf37 (diff)
downloadayatana-indicator-session-58c80d41f5f7ae1f02d43aba1536416d45d89a8f.tar.gz
ayatana-indicator-session-58c80d41f5f7ae1f02d43aba1536416d45d89a8f.tar.bz2
ayatana-indicator-session-58c80d41f5f7ae1f02d43aba1536416d45d89a8f.zip
Only show menu items if we can perform the action without authorisation
Diffstat (limited to 'src')
-rw-r--r--src/session-menu-mgr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c
index 1d865fc..278f191 100644
--- a/src/session-menu-mgr.c
+++ b/src/session-menu-mgr.c
@@ -104,7 +104,7 @@ struct _SessionMenuMgr
GSettings * indicator_settings;
GSettings * keybinding_settings;
- /* cached settings taken from the upower proxy */
+ /* cached settings taken from the logind proxy */
gboolean can_hibernate;
gboolean can_suspend;
@@ -121,7 +121,7 @@ struct _SessionMenuMgr
static SwitcherMode get_switcher_mode (SessionMenuMgr *);
-static void init_upower_proxy (SessionMenuMgr *);
+static void init_login1_proxy (SessionMenuMgr *);
static void init_shell_watcher (SessionMenuMgr *);
static void update_screensaver_shortcut (SessionMenuMgr *);
@@ -201,7 +201,7 @@ session_menu_mgr_init (SessionMenuMgr *mgr)
g_signal_connect (mgr->users_dbus_facade, "guest-logged-in-changed",
G_CALLBACK(on_guest_logged_in_changed), mgr);
- init_upower_proxy (mgr);
+ init_login1_proxy (mgr);
init_shell_watcher (mgr);
/* Online accounts menu item */
@@ -249,12 +249,11 @@ session_menu_mgr_class_init (SessionMenuMgrClass * klass)
static gboolean
can_perform_operation (gchar * permission)
{
- return g_strcmp0 ("yes", permission) == 0 ||
- g_strcmp0 ("allowed", permission) == 0;
+ return g_strcmp0 ("yes", permission) == 0;
}
static void
-init_upower_proxy (SessionMenuMgr * mgr)
+init_login1_proxy (SessionMenuMgr * mgr)
{
/* default values */
mgr->can_suspend = TRUE;