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
This commit is contained in:
parent
04f10ceb4e
commit
2ddc7cf00f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user