[gnome-shell] Add context menus to some entries



commit 9439da81c4184071ae8ad6c331e4eb0a4c1ffbbb
Author: Florian MÃllner <fmuellner gnome org>
Date:   Wed Oct 12 00:38:24 2011 +0200

    Add context menus to some entries
    
    Use ShellEntry.addContextMenu() to add context menus to most
    existing entries, with the exception of:
    
     - the login dialog - it may act be used to enter either the
                          username (e.g. no password entry) or the
                          password, and copy/paste does not make sense
                          (nowhere to copy from, nowhere to paste to)
     - notifications    - while adding a context menu is useful here as
                          well, it will require changes to the tray's
                          focus grab handling, so leave those entries
                          out for now
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659275

 js/ui/lookingGlass.js              |    2 ++
 js/ui/networkAgent.js              |    3 +++
 js/ui/polkitAuthenticationAgent.js |    2 ++
 js/ui/runDialog.js                 |    2 ++
 js/ui/viewSelector.js              |    2 ++
 5 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index e3be685..b0c0f06 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -17,6 +17,7 @@ const Mainloop = imports.mainloop;
 const History = imports.misc.history;
 const ExtensionSystem = imports.ui.extensionSystem;
 const Link = imports.ui.link;
+const ShellEntry = imports.ui.shellEntry;
 const Tweener = imports.ui.tweener;
 const Main = imports.ui.main;
 
@@ -816,6 +817,7 @@ LookingGlass.prototype = {
         entryArea.add(label);
 
         this._entry = new St.Entry({ can_focus: true });
+        ShellEntry.addContextMenu(this._entry);
         entryArea.add(this._entry, { expand: true });
 
         this._windowList = new WindowList();
diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js
index ac0b880..dbb3ed7 100644
--- a/js/ui/networkAgent.js
+++ b/js/ui/networkAgent.js
@@ -30,6 +30,7 @@ const St = imports.gi.St;
 
 const ModalDialog = imports.ui.modalDialog;
 const PopupMenu = imports.ui.popupMenu;
+const ShellEntry = imports.ui.shellEntry;
 
 function NetworkSecretDialog() {
     this._init.apply(this, arguments);
@@ -103,6 +104,8 @@ NetworkSecretDialog.prototype = {
             secret.entry = new St.Entry({ style_class: 'polkit-dialog-password-entry',
                                           text: secret.value, can_focus: reactive,
                                           reactive: reactive });
+            ShellEntry.addContextMenu(secret.entry,
+                                      { isPassword: secret.password });
 
             if (secret.validate)
                 secret.valid = secret.validate(secret);
diff --git a/js/ui/polkitAuthenticationAgent.js b/js/ui/polkitAuthenticationAgent.js
index 92117fc..2d7063a 100644
--- a/js/ui/polkitAuthenticationAgent.js
+++ b/js/ui/polkitAuthenticationAgent.js
@@ -33,6 +33,7 @@ const Polkit = imports.gi.Polkit;
 const PolkitAgent = imports.gi.PolkitAgent;
 
 const ModalDialog = imports.ui.modalDialog;
+const ShellEntry = imports.ui.shellEntry;
 
 function AuthenticationDialog(actionId, message, cookie, userNames) {
     this._init(actionId, message, cookie, userNames);
@@ -139,6 +140,7 @@ AuthenticationDialog.prototype = {
         this._passwordEntry = new St.Entry({ style_class: 'polkit-dialog-password-entry',
                                              text: "",
                                              can_focus: true});
+        ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
         this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivate));
         this._passwordBox.add(this._passwordEntry,
                               {expand: true });
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index c20a3de..2c8e869 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -12,6 +12,7 @@ const Signals = imports.signals;
 const FileUtils = imports.misc.fileUtils;
 const Main = imports.ui.main;
 const ModalDialog = imports.ui.modalDialog;
+const ShellEntry = imports.ui.shellEntry;
 const Tweener = imports.ui.tweener;
 const Util = imports.misc.util;
 const History = imports.misc.history;
@@ -210,6 +211,7 @@ __proto__: ModalDialog.ModalDialog.prototype,
         this.contentLayout.add(label, { y_align: St.Align.START });
 
         let entry = new St.Entry({ style_class: 'run-dialog-entry' });
+        ShellEntry.addContextMenu(entry);
 
         this._entryText = entry.clutter_text;
         this.contentLayout.add(entry, { y_align: St.Align.START });
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 2e3af18..437a6f2 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -12,6 +12,7 @@ const St = imports.gi.St;
 const Main = imports.ui.main;
 const Search = imports.ui.search;
 const SearchDisplay = imports.ui.searchDisplay;
+const ShellEntry = imports.ui.shellEntry;
 const Tweener = imports.ui.tweener;
 
 function BaseTab(titleActor, pageActor, name, a11yIcon) {
@@ -120,6 +121,7 @@ SearchTab.prototype = {
                                      hint_text: _("Type to search..."),
                                      track_hover: true,
                                      can_focus: true });
+        ShellEntry.addContextMenu(this._entry);
         this._text = this._entry.clutter_text;
         this._text.connect('key-press-event', Lang.bind(this, this._onKeyPress));
 



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