[gnome-shell] userMenu: Hide "Log out" item on single user machines



commit 518282e169a8318f00c5cb406d853ff6e3f2c340
Author: Florian MÃllner <fmuellner gnome org>
Date:   Thu May 10 13:16:15 2012 +0200

    userMenu: Hide "Log out" item on single user machines
    
    Ignoring remote logins, the "Log out" action is meaningless for
    single user setups. Do not show it in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=675802

 js/ui/userMenu.js |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index 93f4dc3..5b46ca8 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -497,13 +497,13 @@ const UserMenuButton = new Lang.Class({
         }));
 
         this._userManager.connect('notify::is-loaded',
-                                  Lang.bind(this, this._updateSwitchUser));
+                                  Lang.bind(this, this._updateMultiUser));
         this._userManager.connect('notify::has-multiple-users',
-                                  Lang.bind(this, this._updateSwitchUser));
+                                  Lang.bind(this, this._updateMultiUser));
         this._userManager.connect('user-added',
-                                  Lang.bind(this, this._updateSwitchUser));
+                                  Lang.bind(this, this._updateMultiUser));
         this._userManager.connect('user-removed',
-                                  Lang.bind(this, this._updateSwitchUser));
+                                  Lang.bind(this, this._updateMultiUser));
         this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
                                        Lang.bind(this, this._updateSwitchUser));
         this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
@@ -542,6 +542,11 @@ const UserMenuButton = new Lang.Class({
             this._name.set_text("");
     },
 
+    _updateMultiUser: function() {
+        this._updateSwitchUser();
+        this._updateLogout();
+    },
+
     _updateSwitchUser: function() {
         let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
         this._loginScreenItem.actor.visible = allowSwitch &&
@@ -551,7 +556,7 @@ const UserMenuButton = new Lang.Class({
 
     _updateLogout: function() {
         let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
-        this._logoutItem.actor.visible = allowLogout;
+        this._logoutItem.actor.visible = allowLogout && this._userManager.has_multiple_users;
     },
 
     _updateLockScreen: function() {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]