[gnome-shell/uajain/st-entry-password-2: 4/8] shellEntry: Remove isPassword property



commit 5adbfdb590bc3ef18c0b048cbc4ce9709df4abf3
Author: Umang Jain <mailumangjain gmail com>
Date:   Thu Dec 12 16:52:17 2019 +0530

    shellEntry: Remove isPassword property
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/619

 js/ui/components/keyring.js      |  4 ++--
 js/ui/components/networkAgent.js |  3 +--
 js/ui/components/polkitAgent.js  |  2 +-
 js/ui/shellEntry.js              | 21 +--------------------
 js/ui/shellMountOperation.js     |  4 ++--
 5 files changed, 7 insertions(+), 27 deletions(-)
---
diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js
index 3e049e4666..c01e09b827 100644
--- a/js/ui/components/keyring.js
+++ b/js/ui/components/keyring.js
@@ -76,7 +76,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
                 can_focus: true,
                 x_expand: true,
             });
-            ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+            ShellEntry.addContextMenu(this._passwordEntry);
             this._passwordEntry.clutter_text.connect('activate', this._onPasswordActivate.bind(this));
 
             this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
@@ -109,7 +109,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
                 can_focus: true,
                 x_expand: true,
             });
-            ShellEntry.addContextMenu(this._confirmEntry, { isPassword: true });
+            ShellEntry.addContextMenu(this._confirmEntry);
             this._confirmEntry.clutter_text.connect('activate', this._onConfirmActivate.bind(this));
             if (rtl) {
                 layout.attach(this._confirmEntry, 0, row, 1, 1);
diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js
index 7b30b4c556..ab7cc88daf 100644
--- a/js/ui/components/networkAgent.js
+++ b/js/ui/components/networkAgent.js
@@ -65,8 +65,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
                 secret.entry = new St.PasswordEntry(entryParams);
             else
                 secret.entry = new St.Entry(entryParams);
-            ShellEntry.addContextMenu(secret.entry,
-                                      { isPassword: secret.password });
+            ShellEntry.addContextMenu(secret.entry);
 
             if (secret.validate)
                 secret.valid = secret.validate(secret);
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index 254676cabb..e57b2cdc7f 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -96,7 +96,7 @@ var AuthenticationDialog = GObject.registerClass({
             can_focus: true,
             x_expand: true,
         });
-        ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+        ShellEntry.addContextMenu(this._passwordEntry);
         this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
         this._passwordEntry.bind_property('reactive',
             this._passwordEntry.clutter_text, 'editable',
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index 79a38bf56c..53aed60496 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -41,24 +41,6 @@ var EntryMenu = class extends PopupMenu.PopupMenu {
         this._passwordItem = item;
     }
 
-    get isPassword() {
-        return this._passwordItem != null;
-    }
-
-    set isPassword(v) {
-        if (v == this.isPassword)
-            return;
-
-        if (v) {
-            this._makePasswordItem();
-            this._entry.input_purpose = Clutter.InputContentPurpose.PASSWORD;
-        } else {
-            this._passwordItem.destroy();
-            this._passwordItem = null;
-            this._entry.input_purpose = Clutter.InputContentPurpose.NORMAL;
-        }
-    }
-
     open(animate) {
         this._updatePasteItem();
         this._updateCopyItem();
@@ -144,10 +126,9 @@ function addContextMenu(entry, params) {
     if (entry.menu)
         return;
 
-    params = Params.parse(params, { isPassword: false, actionMode: Shell.ActionMode.POPUP });
+    params = Params.parse(params, { actionMode: Shell.ActionMode.POPUP });
 
     entry.menu = new EntryMenu(entry);
-    entry.menu.isPassword = params.isPassword;
     entry._menuManager = new PopupMenu.PopupMenuManager(entry,
                                                         { actionMode: params.actionMode });
     entry._menuManager.addMenu(entry.menu);
diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js
index 7157ad085c..ca06873c3e 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -332,7 +332,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
                 x_expand: true,
             });
             this._pimEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
-            ShellEntry.addContextMenu(this._pimEntry, { isPassword: true });
+            ShellEntry.addContextMenu(this._pimEntry);
 
             if (rtl) {
                 layout.attach(this._pimEntry, 0, 0, 1, 1);
@@ -362,7 +362,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
             x_expand: true,
         });
         this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
-        ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+        ShellEntry.addContextMenu(this._passwordEntry);
         this.setInitialKeyFocus(this._passwordEntry);
         this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
             animate: true,


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