modalDialog: do not launch disabled button actions

The "Sign In" button of the login dialog has its look disabled when the
entry is empty, but it can still be triggered by the Enter key.

This fixes the modal dialog so it does not trigger the action of an
insensitive button, and also means we do not need to connect to the
"activate" signal of the entry anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=687113
This commit is contained in:
Stéphane Démurget
2012-11-18 21:29:46 +01:00
parent c10e4c3117
commit 4c55a6f436
2 changed files with 27 additions and 23 deletions

View File

@ -151,7 +151,6 @@ const UnlockDialog = new Lang.Class({
this._promptEntry.clutter_text.set_password_char('\u25cf');
ShellEntry.addContextMenu(this._promptEntry, { isPassword: true });
this.setInitialKeyFocus(this._promptEntry);
this._promptEntry.clutter_text.connect('activate', Lang.bind(this, this._doUnlock));
this._promptEntry.clutter_text.connect('text-changed', Lang.bind(this, function() {
this._updateOkButtonSensitivity(this._promptEntry.text.length > 0);
}));