authPrompt: add support for auth without username

This commit introduces a new BeginRequestType enum which gets
passed to the 'reset' signal to specify whether
a username should be provided to the begin() method and changes
the loginDialog to comply.

Currently, the signal only ever gets emitted with

AuthPrompt.BeginRequestType.PROVIDE_USERNAME

but that will change in the future when providing smartcard
support.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
This commit is contained in:
Ray Strode
2013-07-28 17:49:50 -04:00
parent 1104a385fa
commit 93f072d1fc
3 changed files with 43 additions and 10 deletions

View File

@ -31,6 +31,11 @@ const AuthPromptStatus = {
VERIFICATION_SUCCEEDED: 3
};
const BeginRequestType = {
PROVIDE_USERNAME: 0,
DONT_PROVIDE_USERNAME: 1
};
const AuthPrompt = new Lang.Class({
Name: 'AuthPrompt',
@ -431,7 +436,7 @@ const AuthPrompt = new Lang.Class({
if (oldStatus == AuthPromptStatus.VERIFICATION_FAILED)
this.emit('failed');
this.emit('reset');
this.emit('reset', BeginRequestType.PROVIDE_USERNAME);
},
addCharacter: function(unichar) {