[Pkg-mozext-commits] [nostalgy] 10/19: Workaround to make the completetion popup re-appear after it has been closed with Escape.

David Prévot taffit at moszumanska.debian.org
Sat Aug 9 20:06:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository nostalgy.

commit 2ba5a05284dc2863ed0312e0d76c1ac56c9a13c8
Author: alain.frisch <alain.frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Thu Jul 24 09:29:54 2014 +0000

    Workaround to make the completetion popup re-appear after it has been closed with Escape.
    
    git-svn-id: http://nostalgy.googlecode.com/svn/trunk@233 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
 components/nostalgy-autocomplete.js |  7 +++++++
 content/folders.js                  | 17 ++++++++++++++++-
 content/thunderbirdOverlay.xul      |  3 +--
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/components/nostalgy-autocomplete.js b/components/nostalgy-autocomplete.js
index ede033b..fb6e3f3 100644
--- a/components/nostalgy-autocomplete.js
+++ b/components/nostalgy-autocomplete.js
@@ -11,6 +11,13 @@ const CONTRACT_ID = '@mozilla.org/autocomplete/search;1?name=nostalgy-autocomple
 
 // nsIAutoCompleteResult implementation
 
+function NostalgyDebug(aText)
+{
+  var csClass = Components.classes['@mozilla.org/consoleservice;1'];
+  var cs = csClass.getService(Components.interfaces.nsIConsoleService);
+  cs.logStringMessage(aText);
+}
+
 function NostalgyAutoCompleteResult(searchString, results) {
   const ACR = Ci.nsIAutoCompleteResult;
   this._searchResult = results.length > 0 ? ACR.RESULT_SUCCESS : ACR.NOMATCH;
diff --git a/content/folders.js b/content/folders.js
index beac36c..cc73d3e 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -179,6 +179,21 @@ function NostalgyGetAutoCompleteValuesFunction(box) {
       }
     }
 
+    /* For unknown reason, the popup is left closed (even though box.popupOpen = true)
+     * when the user does a new nostalgy completion after the previous one has been
+     * cancelled with Escape.  We this force the popup to be opened some time after
+     * the completeion is done.
+     */
+    if (box.popup.state == "closed")
+      setTimeout(function() {
+                   NostalgyDebug("popup open = " + box.popupOpen);
+                   NostalgyDebug("state " + box.popup.state);
+                   if (box.popup.state == "closed") {
+                     NostalgyDebug("Forcing popup to be opened");
+                     box.popup.sizeTo(box.boxObject.width,300);
+                     box.popup.openPopup(box, "before_start", 0, 0, false, false);
+                   } }, 300);
+
     return values;
   };
 }
@@ -212,6 +227,7 @@ function NostalgyStartLookup() {
     } catch (e) { NostalgyDebug("ERR" + e); }
 }
 
+
 function NostalgyProcessInput() {
  if (this.ignoreInputEvent)
    return;
@@ -295,7 +311,6 @@ function NostalgyFolderSelectionBox(box) {
      .classes["@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete"]
      .getService()
      .wrappedJSObject;
- nac.attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box));
  box.searchParam = nac.attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box));
   /*
  box.processInput = NostalgyProcessInput;
diff --git a/content/thunderbirdOverlay.xul b/content/thunderbirdOverlay.xul
index 6a13ad2..70b867b 100644
--- a/content/thunderbirdOverlay.xul
+++ b/content/thunderbirdOverlay.xul
@@ -41,10 +41,9 @@
    <textbox id="nostalgy-folderbox" type="autocomplete" tabScrolling="true"
 	   autocompletesearch="nostalgy-autocomplete"
 	   ontextentered="NostalgyRunCommand();"
-	   ontextcommand="NostalgyRunCommand();"
 	   ontextreverted="NostalgyHide(true);"
-	   ontextrevert="NostalgyHide(true);"
            completeselectedindex="true"
+           highlightnonmatches="true"
 	   flex="1"
 	   maxrows="25" crop="center"
            />

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git



More information about the Pkg-mozext-commits mailing list