[gnome-shell/wip/rstrode/login-screen-extensions: 19/134] js: Add caps-lock Warning to the dialogs




commit 8ef0d99dbb4cf48ad795e8c1b287c432b5fec156
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 71069e93b8..3ce9fd0d01 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -113,6 +113,9 @@ var AuthPrompt = class {
 
         this._entry.grab_key_focus();
 
+        this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+        this.actor.add_child(this._capsLockWarningLabel);
+
         this._timedLoginIndicator = new St.Bin({ style_class: 'login-dialog-timed-login-indicator',
                                                  scale_x: 0 });
 
@@ -432,6 +435,7 @@ var AuthPrompt = class {
     setPasswordChar(passwordChar) {
         this._entry.clutter_text.set_password_char(passwordChar);
         this._entry.menu.isPassword = passwordChar != '';
+        this._capsLockWarningLabel.visible = passwordChar !== '';
     }
 
     setQuestion(question) {
diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js
index 0d9f1e4663..3512fb63b1 100644
--- a/js/ui/components/keyring.js
+++ b/js/ui/components/keyring.js
@@ -128,6 +128,12 @@ var KeyringDialog = class 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 f871c732d9..32d40fb2b9 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -95,6 +95,14 @@ var NetworkSecretDialog = class extends ModalDialog.ModalDialog {
                 secret.entry.clutter_text.set_password_char('\u25cf');
         }
 
+        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 21feb40903..734a217335 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -108,6 +108,8 @@ var AuthenticationDialog = class extends ModalDialog.ModalDialog {
 
         this.setInitialKeyFocus(this._passwordEntry);
         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 f976f400f4..3a2377ddaf 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -305,6 +305,9 @@ var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
         this._passwordBox.add(this._passwordEntry, {expand: true });
         this.setInitialKeyFocus(this._passwordEntry);
 
+        this._capsLockWarningLabel = new ShellEntry.CapsLockWarning();
+        content.messageBox.add(this._capsLockWarningLabel);
+
         this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label',
                                                  text: _("Sorry, that didn’t work. Please try again.") });
         this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]