loginDialog: fix up cancel button visibility

This commit makes sure we hide when there's nothing to cancel
to and show it when there's something to cancel to.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
This commit is contained in:
Ray Strode 2013-07-28 20:55:12 -04:00
parent 2a95273b79
commit bb2599eb30
2 changed files with 18 additions and 5 deletions

View File

@ -534,6 +534,19 @@ const LoginDialog = new Lang.Class({
} }
}, },
_updateCancelButton: function() {
let cancelVisible;
// Hide the cancel button if the user list is disabled and we're asking for
// a username
if (this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING && this._disableUserList)
cancelVisible = false;
else
cancelVisible = true;
this._authPrompt.cancelButton.visible = cancelVisible;
},
_updateBanner: function() { _updateBanner: function() {
let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY); let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY);
let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY); let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY);
@ -569,9 +582,6 @@ const LoginDialog = new Lang.Class({
if (this._shouldShowSessionMenuButton()) if (this._shouldShowSessionMenuButton())
this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor); this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor);
this._authPrompt.cancelButton.show();
this._showPrompt(); this._showPrompt();
}, },
@ -644,11 +654,12 @@ const LoginDialog = new Lang.Class({
this._authPrompt.clear(); this._authPrompt.clear();
this._authPrompt.startSpinning(); this._authPrompt.startSpinning();
this._authPrompt.begin({ userName: answer }); this._authPrompt.begin({ userName: answer });
this._updateCancelButton();
realmManager.disconnect(realmSignalId) realmManager.disconnect(realmSignalId)
realmManager.release(); realmManager.release();
})); }));
this._authPrompt.cancelButton.hide(); this._updateCancelButton();
this._showPrompt(); this._showPrompt();
}, },
@ -846,6 +857,8 @@ const LoginDialog = new Lang.Class({
this._user = activatedItem.user; this._user = activatedItem.user;
this._updateCancelButton();
let batch = new Batch.ConcurrentBatch(this, [new Batch.ConsecutiveBatch(this, tasks), let batch = new Batch.ConcurrentBatch(this, [new Batch.ConsecutiveBatch(this, tasks),
this._beginVerificationForItem(activatedItem)]); this._beginVerificationForItem(activatedItem)]);
batch.run(); batch.run();

@ -1 +1 @@
Subproject commit ed0ec4240125ac9f0a6d7502aa29644d37b2eac2 Subproject commit 3d6aac673b88fff548db57a75b82e8f14723c1fe