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
This commit is contained in:
Ray Strode 2012-08-19 20:15:18 -04:00
parent 370de395f7
commit 9024c5d7ac
4 changed files with 31 additions and 31 deletions

View File

@ -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;
}

View File

@ -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('');
}];

View File

@ -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');
}
},
});

View File

@ -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() {