authPrompt: Remove Next button and its references
This commit is contained in:
parent
ca046cd29b
commit
d7befc5875
@ -109,6 +109,12 @@ var AuthPrompt = GObject.registerClass({
|
||||
this.add_child(this._entry);
|
||||
|
||||
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,
|
||||
@ -168,31 +174,6 @@ var AuthPrompt = GObject.registerClass({
|
||||
this._buttonBox.add_child(this.cancelButton);
|
||||
|
||||
this._buttonBox.add_child(this._defaultButtonWell);
|
||||
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"),
|
||||
x_align: Clutter.ActorAlign.END,
|
||||
y_align: Clutter.ActorAlign.END,
|
||||
});
|
||||
this.nextButton.connect('clicked', () => this.emit('next'));
|
||||
this.nextButton.add_style_pseudo_class('default');
|
||||
this._buttonBox.add_child(this.nextButton);
|
||||
|
||||
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) {
|
||||
@ -208,15 +189,6 @@ var AuthPrompt = GObject.registerClass({
|
||||
this.setPasswordChar(passwordChar);
|
||||
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.emit('prompted');
|
||||
}
|
||||
@ -416,13 +388,7 @@ var AuthPrompt = GObject.registerClass({
|
||||
}
|
||||
}
|
||||
|
||||
_updateNextButtonSensitivity(sensitive) {
|
||||
this.nextButton.reactive = sensitive;
|
||||
this.nextButton.can_focus = sensitive;
|
||||
}
|
||||
|
||||
updateSensitivity(sensitive) {
|
||||
this._updateNextButtonSensitivity(sensitive && (this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING));
|
||||
this._entry.reactive = sensitive;
|
||||
this._entry.clutter_text.editable = sensitive;
|
||||
}
|
||||
@ -454,7 +420,6 @@ var AuthPrompt = GObject.registerClass({
|
||||
let oldStatus = this.verificationStatus;
|
||||
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
|
||||
this.cancelButton.reactive = true;
|
||||
this.nextButton.label = _("Next");
|
||||
this._preemptiveAnswer = null;
|
||||
|
||||
if (this._userVerifier)
|
||||
|
@ -538,7 +538,6 @@ var UnlockDialog = GObject.registerClass({
|
||||
this._authPrompt.connect('cancelled', this._fail.bind(this));
|
||||
this._authPrompt.connect('reset', this._onReset.bind(this));
|
||||
this._authPrompt.setPasswordChar('\u25cf');
|
||||
this._authPrompt.nextButton.label = _("Unlock");
|
||||
|
||||
this._promptBox.add_child(this._authPrompt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user