[gnome-shell/wip/reorg: 13/15] loginDialog: drop separate login hint label



commit 412af26e4e8c9c8e1a34bc29117540248a9958a8
Author: Ray Strode <rstrode redhat com>
Date:   Wed Jun 19 13:06:19 2013 -0400

    loginDialog: drop separate login hint label
    
    There isn't really room for a login hint label and an auth message label
    at the same time.  They shouldn't really be showing messages at the same
    time anyway, so consolidate them.

 js/ui/auth/loginDialog.js |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/js/ui/auth/loginDialog.js b/js/ui/auth/loginDialog.js
index bbe6460..f932977 100644
--- a/js/ui/auth/loginDialog.js
+++ b/js/ui/auth/loginDialog.js
@@ -90,7 +90,7 @@ const LoginDialog = new Lang.Class({
 
         this._userVerifier = new AuthUtil.ShellUserVerifier(this._greeterClient);
         this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion));
-        this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
+        this._userVerifier.connect('show-message', Lang.bind(this, this._onShowMessage));
         this._userVerifier.connect('verification-failed', Lang.bind(this, this._verificationFailed));
         this._userVerifier.connect('reset', Lang.bind(this, this._reset));
         this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
@@ -164,9 +164,6 @@ const LoginDialog = new Lang.Class({
         this._promptMessage = new St.Label({ opacity: 0 });
         this._promptBox.add(this._promptMessage, { x_fill: true });
 
-        this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint-message' });
-        this._promptBox.add(this._promptLoginHint);
-
         this._sessionList = new SessionList.SessionList();
         this._sessionList.connect('session-activated',
                                   Lang.bind(this, function(list, sessionId) {
@@ -337,7 +334,7 @@ const LoginDialog = new Lang.Class({
         this._sessionList.setActiveSession(sessionId);
     },
 
-    _showMessage: function(userVerifier, message, styleClass) {
+    _showMessage: function(message, styleClass) {
         if (message) {
             this._promptMessage.text = message;
             this._promptMessage.styleClass = styleClass;
@@ -347,14 +344,21 @@ const LoginDialog = new Lang.Class({
         }
     },
 
+    _onShowMessage: function(userVerifier, message, styleClass) {
+        this._showMessage(message, styleClass);
+        this._loginHintShown = false;
+    },
+
     _showLoginHint: function(verifier, message) {
-        this._promptLoginHint.set_text(message)
-        this._promptLoginHint.opacity = 255;
+        this._showMessage(message, 'login-dialog-prompt-login-hint-message');
+        this._loginHintShown = true;
     },
 
     _hideLoginHint: function() {
-        this._promptLoginHint.opacity = 0;
-        this._promptLoginHint.set_text('');
+        if (!this._loginHintShown)
+            return;
+        this._showMessage('', 'login-dialog-prompt-login-hint-message');
+        this._loginHintShown = false;
     },
 
     cancel: function() {
@@ -368,8 +372,6 @@ const LoginDialog = new Lang.Class({
         this._sessionList.actor.hide();
         this._promptLabel.show();
         this._promptEntry.show();
-        this._promptLoginHint.opacity = 0;
-        this._promptLoginHint.show();
         this._promptBox.opacity = 0;
         this._promptBox.show();
         Tweener.addTween(this._promptBox,
@@ -495,7 +497,6 @@ const LoginDialog = new Lang.Class({
 
         this._setWorking(false);
         this._promptBox.hide();
-        this._promptLoginHint.opacity = 0;
 
         this._promptUser.set_child(null);
 
@@ -503,7 +504,6 @@ const LoginDialog = new Lang.Class({
         this._promptEntry.set_text('');
 
         this._sessionList.close();
-        this._promptLoginHint.opacity = 0;
 
         this._buttonBox.destroy_all_children();
         this._signInButton = null;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]