From bb2599eb30715797645ffb0364379aaa389333c2 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 28 Jul 2013 20:55:12 -0400 Subject: [PATCH] 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 --- js/gdm/loginDialog.js | 21 +++++++++++++++++---- src/gvc | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 9286f9857..27c7ef1d3 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -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() { let enabled = this._settings.get_boolean(GdmUtil.BANNER_MESSAGE_KEY); let text = this._settings.get_string(GdmUtil.BANNER_MESSAGE_TEXT_KEY); @@ -569,9 +582,6 @@ const LoginDialog = new Lang.Class({ if (this._shouldShowSessionMenuButton()) this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor); - - this._authPrompt.cancelButton.show(); - this._showPrompt(); }, @@ -644,11 +654,12 @@ const LoginDialog = new Lang.Class({ this._authPrompt.clear(); this._authPrompt.startSpinning(); this._authPrompt.begin({ userName: answer }); + this._updateCancelButton(); realmManager.disconnect(realmSignalId) realmManager.release(); })); - this._authPrompt.cancelButton.hide(); + this._updateCancelButton(); this._showPrompt(); }, @@ -846,6 +857,8 @@ const LoginDialog = new Lang.Class({ this._user = activatedItem.user; + this._updateCancelButton(); + let batch = new Batch.ConcurrentBatch(this, [new Batch.ConsecutiveBatch(this, tasks), this._beginVerificationForItem(activatedItem)]); batch.run(); diff --git a/src/gvc b/src/gvc index ed0ec4240..3d6aac673 160000 --- a/src/gvc +++ b/src/gvc @@ -1 +1 @@ -Subproject commit ed0ec4240125ac9f0a6d7502aa29644d37b2eac2 +Subproject commit 3d6aac673b88fff548db57a75b82e8f14723c1fe