authPrompt: Remove next button

This commit is contained in:
Georges Basile Stavracas Neto 2019-10-08 16:03:07 -03:00
parent 64aaa46333
commit 2e23a0e6b8
2 changed files with 5 additions and 44 deletions

View File

@ -101,6 +101,11 @@ var AuthPrompt = class {
x_align: St.Align.START }); x_align: St.Align.START });
this._entry.grab_key_focus(); this._entry.grab_key_focus();
this._entry.clutter_text.connect('activate', () => this.emit('next'));
this._entry.clutter_text.connect('text-changed', () => {
if (!this._userVerifier.hasPendingMessages)
this._fadeOutMessage();
});
this._message = new St.Label({ opacity: 0, this._message = new St.Label({ opacity: 0,
styleClass: 'login-dialog-message' }); styleClass: 'login-dialog-message' });
@ -151,32 +156,6 @@ var AuthPrompt = class {
y_fill: false, y_fill: false,
x_align: St.Align.END, x_align: St.Align.END,
y_align: St.Align.MIDDLE }); y_align: St.Align.MIDDLE });
this.nextButton = new St.Button({ style_class: 'modal-dialog-button button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
label: _("Next") });
this.nextButton.connect('clicked', () => this.emit('next'));
this.nextButton.add_style_pseudo_class('default');
this._buttonBox.add(this.nextButton,
{ expand: false,
x_fill: false,
y_fill: false,
x_align: St.Align.END,
y_align: St.Align.END });
this._updateNextButtonSensitivity(this._entry.text.length > 0);
this._entry.clutter_text.connect('text-changed', () => {
if (!this._userVerifier.hasPendingMessages)
this._fadeOutMessage();
this._updateNextButtonSensitivity(this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING);
});
this._entry.clutter_text.connect('activate', () => {
if (this.nextButton.reactive)
this.emit('next');
});
} }
_onAskQuestion(verifier, serviceName, question, passwordChar) { _onAskQuestion(verifier, serviceName, question, passwordChar) {
@ -191,16 +170,6 @@ var AuthPrompt = class {
} }
this.setPasswordChar(passwordChar); this.setPasswordChar(passwordChar);
this.setQuestion(question); this.setQuestion(question);
if (passwordChar) {
if (this._userVerifier.reauthenticating)
this.nextButton.label = _("Unlock");
else
this.nextButton.label = C_("button", "Sign In");
} else {
this.nextButton.label = _("Next");
}
this.updateSensitivity(true); this.updateSensitivity(true);
this.emit('prompted'); this.emit('prompted');
} }
@ -393,13 +362,7 @@ var AuthPrompt = class {
} }
} }
_updateNextButtonSensitivity(sensitive) {
this.nextButton.reactive = sensitive;
this.nextButton.can_focus = sensitive;
}
updateSensitivity(sensitive) { updateSensitivity(sensitive) {
this._updateNextButtonSensitivity(sensitive && (this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING));
this._entry.reactive = sensitive; this._entry.reactive = sensitive;
this._entry.clutter_text.editable = sensitive; this._entry.clutter_text.editable = sensitive;
} }
@ -430,7 +393,6 @@ var AuthPrompt = class {
let oldStatus = this.verificationStatus; let oldStatus = this.verificationStatus;
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING; this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
this.cancelButton.reactive = true; this.cancelButton.reactive = true;
this.nextButton.label = _("Next");
this._preemptiveAnswer = null; this._preemptiveAnswer = null;
if (this._userVerifier) if (this._userVerifier)

View File

@ -346,7 +346,6 @@ var UnlockDialog = GObject.registerClass({
this._authPrompt.connect('cancelled', this._fail.bind(this)); this._authPrompt.connect('cancelled', this._fail.bind(this));
this._authPrompt.connect('reset', this._onReset.bind(this)); this._authPrompt.connect('reset', this._onReset.bind(this));
this._authPrompt.setPasswordChar('\u25cf'); this._authPrompt.setPasswordChar('\u25cf');
this._authPrompt.nextButton.label = _("Unlock");
this._mainBox.add_child(this._authPrompt.actor); this._mainBox.add_child(this._authPrompt.actor);