[gnome-shell] user-menu: Hide "Switch user" on single user machines



commit dc5d2b83efecf7e62afec6bbf1a19693741dfe5e
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Oct 18 20:57:24 2011 +0200

    user-menu: Hide "Switch user" on single user machines
    
    Ignoring remote logins, the "Switch user" action is meaningless for
    single user setups. Do not show it in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657011

 js/ui/userMenu.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index 0e370b6..f7a6801 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -474,6 +474,8 @@ UserMenuButton.prototype = {
         this._createSubMenu();
         this._userManager.connect('notify::is-loaded',
                                   Lang.bind(this, this._updateSwitchUser));
+        this._userManager.connect('notify::has-multiple-users',
+                                  Lang.bind(this, this._updateSwitchUser));
         this._userManager.connect('user-added',
                                   Lang.bind(this, this._updateSwitchUser));
         this._userManager.connect('user-removed',
@@ -518,7 +520,9 @@ UserMenuButton.prototype = {
 
     _updateSwitchUser: function() {
         let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
-        if (allowSwitch && this._userManager.can_switch ())
+        if (allowSwitch &&
+            this._userManager.can_switch() &&
+            this._userManager.has_multiple_users)
             this._loginScreenItem.actor.show();
         else
             this._loginScreenItem.actor.hide();



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