[gnome-shell] loginScreen: Add support for 'disable-restart-buttons'



commit 86c85a752eacf4f89d8d5ca5ef1000692385c1af
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Oct 16 21:32:05 2012 +0200

    loginScreen: Add support for 'disable-restart-buttons'
    
    GDM's GSettings schema contains a 'disable-restart-buttons' key
    that currently is only supported by the fallback greeter.
    Implement support in the shell greeter as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686247

 js/gdm/powerMenu.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/js/gdm/powerMenu.js b/js/gdm/powerMenu.js
index b57eec5..bf545c1 100644
--- a/js/gdm/powerMenu.js
+++ b/js/gdm/powerMenu.js
@@ -18,11 +18,13 @@
  * 02111-1307, USA.
  */
 
+const Gio = imports.gi.Gio;
 const Lang = imports.lang;
 const UPowerGlib = imports.gi.UPowerGlib;
 
 const LoginManager = imports.misc.loginManager;
 
+const GdmUtil = imports.gdm.util;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 
@@ -37,6 +39,10 @@ const PowerMenuButton = new Lang.Class({
 
         this._loginManager = LoginManager.getLoginManager();
 
+        this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
+        this._settings.connect('changed::disable-restart-buttons',
+                               Lang.bind(this, this._updateVisibility));
+
         this._createSubMenu();
 
         this._upClient.connect('notify::can-suspend',
@@ -58,7 +64,7 @@ const PowerMenuButton = new Lang.Class({
 
     _updateVisibility: function() {
         let shouldBeVisible = (this._haveSuspend || this._haveShutdown || this._haveRestart);
-        this.actor.visible = shouldBeVisible;
+        this.actor.visible = shouldBeVisible && !this._settings.get_boolean('disable-restart-buttons');
     },
 
     _updateHaveShutdown: function() {



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