[gnome-shell] js: Add caps-lock Warning to the dialogs
- From: Florian MĂźllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] js: Add caps-lock Warning to the dialogs
- Date: Tue, 17 Dec 2019 22:18:11 +0000 (UTC)
commit 474dda7ffef269ed881f10356065bd113b0993e0
Author: Umang Jain <mailumangjain gmail com>
Date: Wed Dec 18 01:33:45 2019 +0530
js: Add caps-lock Warning to the dialogs
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/619
js/gdm/authPrompt.js | 4 ++++
js/ui/components/keyring.js | 6 ++++++
js/ui/components/networkAgent.js | 8 ++++++++
js/ui/components/polkitAgent.js | 2 ++
js/ui/shellMountOperation.js | 3 +++
5 files changed, 23 insertions(+)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index cb39104e14..ac42c2c960 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -119,6 +119,9 @@ var AuthPrompt = GObject.registerClass({
this._entry.grab_key_focus();
+ this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+ this.add_child(this._capsLockWarningLabel);
+
this._message = new St.Label({
opacity: 0,
styleClass: 'login-dialog-message',
@@ -212,6 +215,7 @@ var AuthPrompt = GObject.registerClass({
this.replace_child(this._entry, this._textEntry);
this._entry = this._textEntry;
}
+ this._capsLockWarningLabel.visible = secret;
}
_onAskQuestion(verifier, serviceName, question, secret) {
diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js
index c01e09b827..a211d002ee 100644
--- a/js/ui/components/keyring.js
+++ b/js/ui/components/keyring.js
@@ -126,6 +126,12 @@ class KeyringDialog extends ModalDialog.ModalDialog {
this.prompt.set_password_actor(this._passwordEntry ? this._passwordEntry.clutter_text : null);
this.prompt.set_confirm_actor(this._confirmEntry ? this._confirmEntry.clutter_text : null);
+ if (this._passwordEntry || this._confirmEntry) {
+ this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+ layout.attach(this._capsLockWarningLabel, 1, row, 1, 1);
+ row++;
+ }
+
if (this.prompt.choice_visible) {
let choice = new CheckBox.CheckBox();
this.prompt.bind_property('choice-label', choice.getLabelActor(), 'text',
GObject.BindingFlags.SYNC_CREATE);
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index ab7cc88daf..ee376326bf 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -101,6 +101,14 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
pos++;
}
+ if (this._content.secrets.some(s => s.password)) {
+ this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+ if (rtl)
+ layout.attach(this._capsLockWarningLabel, 0, pos, 1, 1);
+ else
+ layout.attach(this._capsLockWarningLabel, 1, pos, 1, 1);
+ }
+
contentBox.messageBox.add(secretTable);
if (flags & NM.SecretAgentGetSecretsFlags.WPS_PBC_ACTIVE) {
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index e57b2cdc7f..f4366c2ee1 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -109,6 +109,8 @@ var AuthenticationDialog = GObject.registerClass({
this._passwordBox.add(this._workSpinner);
this._passwordBox.hide();
+ this._capsLockWarningLabel = new ShellEntry.CapsLockWarning({ style_class:
'prompt-dialog-caps-lock-warning' });
+ content.messageBox.add(this._capsLockWarningLabel);
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js
index ca06873c3e..98989ce406 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -368,13 +368,16 @@ var ShellMountPasswordDialog = GObject.registerClass({
animate: true,
});
this._passwordEntry.secondary_icon = this._workSpinner;
+ this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
if (rtl) {
layout.attach(this._passwordEntry, 0, 1, 1, 1);
layout.attach(this._passwordLabel, 1, 1, 1, 1);
+ layout.attach(this._capsLockWarningLabel, 0, 2, 1, 1);
} else {
layout.attach(this._passwordLabel, 0, 1, 1, 1);
layout.attach(this._passwordEntry, 1, 1, 1, 1);
+ layout.attach(this._capsLockWarningLabel, 1, 2, 1, 1);
}
content.messageBox.add(grid);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]