From 2ddc7cf00f64e937c8c2798b31c46d25734b7967 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 14 Sep 2009 13:45:49 -0400 Subject: [PATCH] Only enable internal commands if developer_tools is true 'r' is a bit too accidentally-hittable for outside of developer usage. However it will still be enabled when developer_tools is true. https://bugzilla.gnome.org/show_bug.cgi?id=595116 --- js/ui/runDialog.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 67d5b8b4f..9e3209288 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -34,6 +34,13 @@ RunDialog.prototype = { _init : function() { this._isOpen = false; + let gconf = Shell.GConf.get_default(); + gconf.connect('changed', Lang.bind(this, function (gconf, key) { + if (key == 'development_tools') + this._enableInternalCommands = gconf.get_bool('development_tools'); + })); + this._enableInternalCommands = gconf.get_boolean('development_tools'); + this._internalCommands = { 'lg': Lang.bind(this, function() { // Run in an idle to avoid recursive key grab problems @@ -142,7 +149,11 @@ RunDialog.prototype = { }, _run : function(command) { - let f = this._internalCommands[command]; + let f; + if (this._enableInternalCommands) + f = this._internalCommands[command]; + else + f = null; if (f) { f(); } else if (command) {