[gnome-shell] run-dialog: Honor lockdown settings



commit 291ef07cf3d6efd7c858fa1f956ede72464a523d
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Mar 21 14:06:35 2011 +0100

    run-dialog: Honor lockdown settings
    
    org.gnome.desktop.lockdown has a setting to prevent the use of the
    Alt-F2 run dialog. Honor this setting.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645335

 js/ui/runDialog.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index 15340d3..2a02a3b 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -22,6 +22,9 @@ const MAX_FILE_DELETED_BEFORE_INVALID = 10;
 
 const HISTORY_KEY = 'command-history';
 
+const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
+const DISABLE_COMMAND_LINE_KEY = 'disable-command-line';
+
 const DIALOG_GROW_TIME = 0.1;
 
 function CommandCompleter() {
@@ -167,6 +170,7 @@ __proto__: ModalDialog.ModalDialog.prototype,
     _init : function() {
         ModalDialog.ModalDialog.prototype._init.call(this, { styleClass: 'run-dialog' });
 
+        this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });
         global.settings.connect('changed::development-tools', Lang.bind(this, function () {
             this._enableInternalCommands = global.settings.get_boolean('development-tools');
         }));
@@ -353,6 +357,9 @@ __proto__: ModalDialog.ModalDialog.prototype,
         this._entryText.set_text('');
         this._commandError = false;
 
+        if (this._lockdownSettings.get_boolean(DISABLE_COMMAND_LINE_KEY))
+            return;
+
         ModalDialog.ModalDialog.prototype.open.call(this);
     },
 



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