From 4d510562269d070d08e098d6e51c64081a3f66e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 30 Oct 2012 15:00:07 +0100 Subject: [PATCH] runDialog: Remove "Run" button again While not in the mockups, it was introduced during review of commit 0c807bddaf4da5 after discussion on IRC, but the designers disagree; remove it again. https://bugzilla.gnome.org/show_bug.cgi?id=687127 --- js/ui/runDialog.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 2ec1deaf5..ac3f0901f 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -238,14 +238,8 @@ const RunDialog = new Lang.Class({ this._errorBox.hide(); this.setButtons([{ action: Lang.bind(this, this.close), - label: _("Cancel"), - key: Clutter.Escape }, - { action: Lang.bind(this, - function() { - this._activate(false); - }), - label: _("Run"), - isDefault: true }]); + label: _("Close"), + key: Clutter.Escape }]); this._pathCompleter = new Gio.FilenameCompleter(); this._commandCompleter = new CommandCompleter(); @@ -256,7 +250,13 @@ const RunDialog = new Lang.Class({ this._entryText.connect('key-press-event', Lang.bind(this, function(o, e) { let symbol = e.get_key_symbol(); if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { - this._activate(e.get_state() & Clutter.ModifierType.CONTROL_MASK); + this.popModal(); + this._run(o.get_text(), + e.get_state() & Clutter.ModifierType.CONTROL_MASK); + if (!this._commandError || + !this.pushModal()) + this.close(); + return true; } if (symbol == Clutter.slash) { @@ -291,14 +291,6 @@ const RunDialog = new Lang.Class({ })); }, - _activate: function(inTerminal) { - this.popModal(); - this._run(this._entryText.get_text(), inTerminal); - if (!this._commandError || - !this.pushModal()) - this.close(); - }, - _getCompletion : function(text) { if (text.indexOf('/') != -1) { return this._pathCompleter.get_completion_suffix(text);