[gnome-shell] gdm: generalize fingerprint message into login hint



commit 9024c5d7ac28d0e56efc8ceb2cc572b72e063f60
Author: Ray Strode <rstrode redhat com>
Date:   Sun Aug 19 20:15:18 2012 -0400

    gdm: generalize fingerprint message into login hint
    
    The fingerprint message is useful for users that click their
    names in the user list to let them know if fingerprint login
    is available.
    
    This same place on screen (below the login entry) can potentially
    be used for other messages as well.
    
    This commit changes the variable and style names surrounding
    this feature to be more generic.
    
    A subsequent commit will leverage this functionality to provide
    a hint on how to log in to the local enterprise domain controller
    (if relevant).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681975

 data/theme/gnome-shell.css |    2 +-
 js/gdm/loginDialog.js      |   31 +++++++++++++++----------------
 js/gdm/util.js             |    7 +++++--
 js/ui/unlockDialog.js      |   22 ++++++++++------------
 4 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 07aee81..ee6f01a 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -1988,7 +1988,7 @@ StButton.popup-menu-item:insensitive {
     min-width: 350px;
 }
 
-.login-dialog-prompt-fingerprint-message {
+.login-dialog-prompt-login-hint-message {
     font-size: 10.5pt;
 }
 
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 5c60d24..9e103ec 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -696,8 +696,8 @@ const LoginDialog = new Lang.Class({
         this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
         this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
 
-        this._userVerifier.connect('show-fingerprint-prompt', Lang.bind(this, this._showFingerprintPrompt));
-        this._userVerifier.connect('hide-fingerprint-prompt', Lang.bind(this, this._hideFingerprintPrompt));
+        this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
+        this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
 
         this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
 
@@ -761,12 +761,9 @@ const LoginDialog = new Lang.Class({
                               x_fill: true,
                               y_fill: false,
                               x_align: St.Align.START });
-        // Translators: this message is shown below the password entry field
-        // to indicate the user can swipe their finger instead
-        this._promptFingerprintMessage = new St.Label({ text: _("(or swipe finger)"),
-                                                        style_class: 'login-dialog-prompt-fingerprint-message' });
-        this._promptFingerprintMessage.hide();
-        this._promptBox.add(this._promptFingerprintMessage);
+        this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint-message' });
+        this._promptLoginHint.hide();
+        this._promptBox.add(this._promptLoginHint);
 
         this._sessionList = new SessionList();
         this._sessionList.connect('session-activated',
@@ -854,7 +851,7 @@ const LoginDialog = new Lang.Class({
 
                      function() {
                          this._sessionList.close();
-                         this._promptFingerprintMessage.hide();
+                         this._promptLoginHint.hide();
                          this._userList.actor.show();
                          this._userList.actor.opacity = 255;
                          return this._userList.showItems();
@@ -875,12 +872,14 @@ const LoginDialog = new Lang.Class({
         this._sessionList.setActiveSession(sessionId);
     },
 
-    _showFingerprintPrompt: function() {
-        GdmUtil.fadeInActor(this._promptFingerprintMessage);
+    _showLoginHint: function(verifier, message) {
+        this._promptLoginHint.set_text(message)
+        GdmUtil.fadeInActor(this._promptLoginHint);
     },
 
-    _hideFingerprintPrompt: function() {
-        GdmUtil.fadeOutActor(this._promptFingerprintMessage);
+    _hideLoginHint: function() {
+        GdmUtil.fadeOutActor(this._promptLoginHint);
+        this._promptLoginHint.set_text('');
     },
 
     cancel: function() {
@@ -899,8 +898,8 @@ const LoginDialog = new Lang.Class({
                      function() {
                          // Show it with 0 opacity so we preallocate space for it
                          // in the event we need to fade in the message
-                         this._promptFingerprintMessage.opacity = 0;
-                         this._promptFingerprintMessage.show();
+                         this._promptLoginHint.opacity = 0;
+                         this._promptLoginHint.show();
                      },
 
                      function() {
@@ -972,7 +971,7 @@ const LoginDialog = new Lang.Class({
                      },
 
                      function() {
-                         this._promptFingerprintMessage.hide();
+                         this._promptLoginHint.hide();
                          this._promptEntry.reactive = true;
                          this._promptEntry.set_text('');
                      }];
diff --git a/js/gdm/util.js b/js/gdm/util.js
index fb68ab0..3224539 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -211,7 +211,10 @@ const ShellUserVerifier = new Lang.Class({
         // as a cue to display our own message.
         if (serviceName == FINGERPRINT_SERVICE_NAME &&
             this._haveFingerprintReader) {
-            this.emit('show-fingerprint-prompt');
+
+            // Translators: this message is shown below the password entry field
+            // to indicate the user can swipe their finger instead
+            this.emit('show-login-hint', _("(or swipe finger)"));
         } else if (serviceName == PASSWORD_SERVICE_NAME) {
             Main.notifyError(info);
         }
@@ -261,7 +264,7 @@ const ShellUserVerifier = new Lang.Class({
         if (serviceName == PASSWORD_SERVICE_NAME) {
             this.emit('verification-failed');
         } else if (serviceName == FINGERPRINT_SERVICE_NAME) {
-            this.emit('hide-fingerprint-prompt');
+            this.emit('hide-login-hint');
         }
     },
 });
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 86ce8ec..fb510fc 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -97,8 +97,8 @@ const UnlockDialog = new Lang.Class({
         this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
         this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
 
-        this._userVerifier.connect('show-fingerprint-prompt', Lang.bind(this, this._showFingerprintPrompt));
-        this._userVerifier.connect('hide-fingerprint-prompt', Lang.bind(this, this._hideFingerprintPrompt));
+        this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
+        this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
 
         this._userWidget = new UserWidget(this._user);
         this.contentLayout.add_actor(this._userWidget.actor);
@@ -122,12 +122,9 @@ const UnlockDialog = new Lang.Class({
 
         this.contentLayout.add_actor(this._promptLayout);
 
-        // Translators: this message is shown below the password entry field
-        // to indicate the user can swipe their finger instead
-        this._promptFingerprintMessage = new St.Label({ text: _("(or swipe finger)"),
-                                                        style_class: 'login-dialog-prompt-fingerprint-message' });
-        this._promptFingerprintMessage.hide();
-        this.contentLayout.add_actor(this._promptFingerprintMessage);
+        this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint' });
+        this._promptLoginHint.hide();
+        this.contentLayout.add_actor(this._promptLoginHint);
 
         let cancelButton = { label: _("Cancel"),
                              action: Lang.bind(this, this._escape),
@@ -183,12 +180,13 @@ const UnlockDialog = new Lang.Class({
         this._updateOkButton(true);
     },
 
-    _showFingerprintPrompt: function() {
-        GdmUtil.fadeInActor(this._promptFingerprintMessage);
+    _showLoginHint: function(verifier, message) {
+        this._promptLoginHint.set_text(message)
+        GdmUtil.fadeInActor(this._promptLoginHint);
     },
 
-    _hideFingerprintPrompt: function() {
-        GdmUtil.fadeOutActor(this._promptFingerprintMessage);
+    _hideLoginHint: function() {
+        GdmUtil.fadeOutActor(this._promptLoginHint);
     },
 
     _doUnlock: function() {



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