imported patch quicksearch_sizing gloda-facet
authorDavid Ascher <david@mozillamessaging.com>
Fri, 04 Sep 2009 10:05:02 -0700
branchgloda-facet
changeset 3696 e16076f1b27d085fd321683606b2bffec1461553
parent 3695 2987d1307352a97d8f1e42bdc392c9eaa9cd2ec4
child 3697 cd2b3d8b5d387f63a9f103a7a75a8a30052fad50
push id2927
push userbugmail@asutherland.org
push dateThu, 10 Sep 2009 01:15:56 +0000
treeherdercomm-central@0b161ed73eb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
imported patch quicksearch_sizing
mail/base/content/extraCustomizeItems.xul
mail/base/content/search.xml
mailnews/db/gloda/content/glodacomplete.css
--- a/mail/base/content/extraCustomizeItems.xul
+++ b/mail/base/content/extraCustomizeItems.xul
@@ -54,22 +54,24 @@
 
   <popupset>
     <panel type="glodacomplete-richlistbox" chromedir="ltr"
            id="PopupGlodaAutocomplete" noautofocus="true" />
   </popupset>
 
   <toolbarpalette id="MailToolbarPalette">
     <!-- gloda search widget; provides global (message) searching.  -->
-    <toolbaritem id="gloda-search" insertafter="search-container"
+    <toolbaritem id="gloda-search" insertafter="button-stop"
                  title="&glodaSearch.title;"
                  align="center"
+                 flex="1000"
                  class="chromeclass-toolbar-additional">
-        <textbox id="searchInput" flex="1"
+        <textbox id="searchInput" 
                  chromedir="ltr"
+                 flex="1"
                  searchCriteria="true"
                  type="glodacomplete"
                  searchbutton="true"
                  autocompletesearch="gloda"
                  autocompletepopup="PopupGlodaAutocomplete"
                  >
         </textbox>
     </toolbaritem>
--- a/mail/base/content/search.xml
+++ b/mail/base/content/search.xml
@@ -182,17 +182,17 @@
         const Cu = Components.utils;
         Cu.import("resource://gre/modules/errUtils.js");
         try {
           Cu.import("resource://app/modules/StringBundle.js");
           Cu.import("resource://app/modules/quickSearchManager.js");
   
           var prefBranch =
               Components.classes['@mozilla.org/preferences-service;1'].
-              getService(Components.interfaces.nsIPrefBranch);
+              getService(Components.interfaces.nsIPrefBranch2);
           prefBranch.addObserver("mailnews.database.global.indexer.enabled", this._prefObserver, false);
 
           this.glodaCompleter =
             Components.classes["@mozilla.org/autocomplete/search;1?name=gloda"].
                       getService(). //Components.interfaces.nsIAutoCompleteSearch)
                       wrappedJSObject;
   
           var observerSvc = Components.classes["@mozilla.org/observer-service;1"]
@@ -224,17 +224,17 @@
           saveAsVF.setAttribute("quicksearchOnly", "true");
           saveAsVF.setAttribute("oncommand",
                                 "gFolderTreeController.newVirtualFolder(this.parentNode.parentNode.parentNode.value,\
                                 gFolderDisplay.view.search.session.searchTerms);");
 
           this.menupopup.appendChild(saveAsVF);
           this.updateSaveItem();
           this.input = "";
-          this.glodaEnabled = gPrefBranch.getBoolPref("mailnews.database.global.indexer.enabled");
+          this.glodaEnabled = prefBranch.getBoolPref("mailnews.database.global.indexer.enabled");
           this.searchMode = this.glodaEnabled ? "global" : String(quickSearchModes[QuickSearchConstants.kQuickSearchFromOrSubject].value);
         } catch (e) {
           logException(e);
         }
       ]]></constructor>
 
       <destructor>
         <![CDATA[
@@ -274,21 +274,24 @@
       <field name="glodaCompleter">null</field>
       <field name="ignoreClick">false</field>
       <field name="quickSearchStrings">null</field>
       <field name="mQuickSearchMode">null</field>
       <field name="timeoutHandler">null</field>
       <property name="searchMode" onget="return this.mQuickSearchMode;"
                 onset="this.mQuickSearchMode = val;
                        this.menupopup.setAttribute('value', val);
-                       let currentTabInfo = document.getElementById('tabmail').currentTabInfo;
-                       this.menupopup.getElementsByAttribute('value', this.searchMode)[0].setAttribute('checked', 'true');
-                       if (currentTabInfo)
-                          currentTabInfo.searchState = this.state;
-                       this.updateEmptyText();"/>
+                       let tabmail = document.getElementById('tabmail');
+                       if (tabmail) { /* if not in the customize toolbar */
+                         let currentTabInfo = tabmail.currentTabInfo;
+                         this.menupopup.getElementsByAttribute('value', this.searchMode)[0].setAttribute('checked', 'true');
+                         if (currentTabInfo)
+                            currentTabInfo.searchState = this.state;
+                         this.updateEmptyText();
+                       }"/>
       <field name="_glodaEnabled"/>
       <property name="glodaEnabled" onget="return this._glodaEnabled"
                 onset="try {this.showGlodaItems(val); this._glodaEnabled = val;} catch(e) {logException(e);}"/> 
 
       <property name="autocompletePopup" readonly="true" onget="return document.getElementById(this.getAttribute('autocompletepopup'))"/>
       <property name="showingSearchCriteria" onget="return this.getAttribute('searchCriteria') == 'true';"
                 onset="this.setAttribute('searchCriteria', val); return val;"/>
       <property name="menupopup" readonly="true" onget="return document.getAnonymousElementByAttribute(this, 'anonid', 'quick-search-menupopup')"/>
--- a/mailnews/db/gloda/content/glodacomplete.css
+++ b/mailnews/db/gloda/content/glodacomplete.css
@@ -1,11 +1,10 @@
 textbox[type="glodacomplete"] {
   -moz-binding: url("chrome://global/content/bindings/autocomplete.xml#autocomplete");
-  width: 400px;
 }
 
 panel[type="glodacomplete-richlistbox"] {
   -moz-binding: url("chrome://gloda/content/glodacomplete.xml#glodacomplete-rich-result-popup");
 }
 
 .autocomplete-richlistbox {
   -moz-binding: url("chrome://global/content/bindings/autocomplete.xml#autocomplete-richlistbox");