Bug 297251 - Persist search dialog list column choice and sort column/order; share threadTree between 3pane and search. r=aceman a=jorgk
authoralta88@fixall.com
Tue, 30 Jul 2019 07:53:16 -0600
changeset 36150 d16312466cccd7771275d32ee45d88474f7f6c83
parent 36149 e28a7f022182740449c07d97f510d1b2cfb09779
child 36151 064d9eae4999cb48ca01a7b15ece76780592dc6e
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersaceman, jorgk
bugs297251
Bug 297251 - Persist search dialog list column choice and sort column/order; share threadTree between 3pane and search. r=aceman a=jorgk
mail/base/content/SearchDialog.js
mail/base/content/SearchDialog.xul
mail/base/content/messenger.xul
mail/base/content/threadTree.inc.xul
mail/locales/en-US/chrome/messenger/SearchDialog.dtd
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -230,33 +230,41 @@ function searchOnLoad() {
   gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
   gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
 
   gMessageDisplay = new NeverVisibleMessageDisplayWidget();
   gFolderDisplay = new SearchFolderDisplayWidget(gMessageDisplay);
   gFolderDisplay.messenger = messenger;
   gFolderDisplay.msgWindow = msgWindow;
   gFolderDisplay.tree = document.getElementById("threadTree");
+
+  // The view is initially unsorted; get the persisted sortDirection column
+  // and set up the user's desired sort. This synthetic view is not backed by
+  // a db, so secondary sorts and custom columns are not supported here.
+  let sortCol = gFolderDisplay.tree.querySelector("[sortDirection]");
+  let sortType, sortOrder;
+  if (sortCol) {
+    sortType = Ci.nsMsgViewSortType[gFolderDisplay.COLUMNS_MAP.get(sortCol.id)];
+    sortOrder = sortCol.getAttribute("sortDirection") == "descending" ?
+                  Ci.nsMsgViewSortOrder.descending : Ci.nsMsgViewSortOrder.ascending;
+  }
+
   gFolderDisplay.view.openSearchView();
   gFolderDisplay.makeActive();
 
-  gFolderDisplay.setColumnStates({
-    subjectCol: { visible: true },
-    correspondentCol: { visible: Services.prefs.getBoolPref("mail.threadpane.use_correspondents") },
-    senderCol: { visible: !Services.prefs.getBoolPref("mail.threadpane.use_correspondents") },
-    dateCol: { visible: true },
-    locationCol: { visible: true },
-  });
+  if (sortType) {
+    gFolderDisplay.view.sort(sortType, sortOrder);
+  }
 
   if (window.arguments && window.arguments[0])
     updateSearchFolderPicker(window.arguments[0].folder);
 
-  // trigger searchTerm.js to create the first criterion
+  // Trigger searchTerm.js to create the first criterion.
   onMore(null);
-  // make sure all the buttons are configured
+  // Make sure all the buttons are configured.
   UpdateMailSearch("onload");
 }
 
 function searchOnUnload() {
   gFolderDisplay.close();
   top.controllers.removeController(nsSearchResultsController);
 
   // release this early because msgWindow holds a weak reference
--- a/mail/base/content/SearchDialog.xul
+++ b/mail/base/content/SearchDialog.xul
@@ -1,21 +1,24 @@
 <?xml version="1.0"?>
-
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+#filter substitution
+#define SEARCH_WINDOW
 <?xml-stylesheet href="chrome://messenger/content/bindings.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/searchDialog.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/folderPane.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/tagColors.css" type="text/css"?>
 <?xml-stylesheet href="chrome://messenger/skin/folderMenus.css" type="text/css"?>
 
 <!DOCTYPE window [
+  <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd" >
+  %messengerDTD;
   <!ENTITY % SearchDialogDTD SYSTEM "chrome://messenger/locale/SearchDialog.dtd">
   %SearchDialogDTD;
   <!ENTITY % searchTermDTD SYSTEM "chrome://messenger/locale/searchTermOverlay.dtd">
   %searchTermDTD;
 ]>
 
 <window id="searchMailWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@@ -117,82 +120,17 @@
 #include ../../../mailnews/base/search/content/searchTerm.inc.xul
       </hbox>
     </vbox>
 
     <splitter id="gray_horizontal_splitter" persist="state" orient="vertical"/>
 
     <vbox id="searchResults" flex="4" persist="height">
       <vbox id="searchResultListBox" flex="1">
-        <tree id="threadTree" class="plain" persist="lastfoldersent" flex="1"
-              enableColumnDrag="true" _selectDelay="500" lastfoldersent="false"
-              disableKeyNavigation="true"
-              context="mailContext"
-              onkeydown="ThreadPaneKeyDown(event);"
-              onselect="ThreadPaneSelectionChanged();">
-          <treecols id="threadCols" pickertooltiptext="&columnChooser2.tooltip;">
-            <treecol id="threadCol" is="treecol-image" persist="hidden ordinal" fixed="true" cycler="true"
-                     class="treecol-image threadColumnHeader" currentView="unthreaded"
-                     label="&threadColumn.label;" tooltiptext="&threadColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="subjectCol" persist="hidden ordinal width" flex="7" ignoreincolumnpicker="true"
-                     label="&subjectColumn.label;" tooltiptext="&subjectColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="junkStatusCol" is="treecol-image" persist="hidden ordinal width" fixed="true" cycler="true"
-                     class="treecol-image junkStatusHeader"
-                     label="&junkStatusColumn.label;" tooltiptext="&junkStatusColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="senderCol" persist="hidden swappedhidden ordinal width" flex="4"
-                     hidden="false" swappedhidden="true"
-                     label="&fromColumn.label;" tooltiptext="&fromColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="recipientCol" persist="hidden swappedhidden ordinal width" flex="4"
-                     hidden="true" swappedhidden="false"
-                     label="&recipientColumn.label;" tooltiptext="&recipientColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="correspondentCol" persist="hidden ordinal width" flex="4"
-                     label="&correspondentColumn.label;" tooltiptext="&correspondentColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="unreadButtonColHeader" is="treecol-image" persist="hidden ordinal" fixed="true" cycler="true"
-                     class="treecol-image readColumnHeader"
-                     label="&readColumn.label;" tooltiptext="&readColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="dateCol" persist="hidden ordinal width" flex="2"
-                     label="&dateColumn.label;" tooltiptext="&dateColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="statusCol" persist="hidden ordinal width" flex="1" hidden="true"
-                     label="&statusColumn.label;" tooltiptext="&statusColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="sizeCol" persist="hidden ordinal width" flex="1" hidden="true"
-                     label="&sizeColumn.label;" tooltiptext="&sizeColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="flaggedCol" is="treecol-image" persist="hidden ordinal" fixed="true" cycler="true" hidden="true"
-                     class="treecol-image flagColumnHeader"
-                     label="&starredColumn.label;" tooltiptext="&starredColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="tagsCol" persist="hidden ordinal width" flex="1" hidden="true"
-                     label="&tagsColumn.label;" tooltiptext="&tagsColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="priorityCol" persist="hidden ordinal width" flex="1"
-                     label="&priorityColumn.label;" tooltiptext="&priorityColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="unreadCol" persist="hidden ordinal width" flex="1" hidden="true"
-                     label="&unreadColumn.label;" tooltiptext="&unreadColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="totalCol" persist="hidden ordinal width" flex="1" hidden="true"
-                     label="&totalColumn.label;" tooltiptext="&totalColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="locationCol" persist="width" flex="1" hidden="true" ignoreincolumnpicker="true"
-                     label="&locationColumn.label;" tooltiptext="&locationColumn2.tooltip;"/>
-            <splitter class="tree-splitter"/>
-            <treecol id="idCol" persist="hidden ordinal width" flex="1" hidden="true"
-                     label="&idColumn.label;" tooltiptext="&idColumn2.tooltip;"/>
-          </treecols>
-          <treechildren ondragstart="ThreadPaneOnDragStart(event);"/>
-        </tree>
+#include threadTree.inc.xul
       </vbox>
       <hbox align="start">
         <button label="&openButton.label;" id="openButton" command="cmd_open" accesskey="&openButton.accesskey;"/>
         <button id="fileMessageButton" type="menu" label="&moveButton.label;"
                 accesskey="&moveButton.accesskey;"
                 command="file_message_button">
           <menupopup is="folder-menupopup" showFileHereLabel="true" mode="filing"/>
         </button>
--- a/mail/base/content/messenger.xul
+++ b/mail/base/content/messenger.xul
@@ -580,111 +580,26 @@
                   </vbox>
                   <!-- The threadPaneBox is the basis for the vertical view and you
                        should not put anything in it, because the messagepane will
                        get transplanted in there. (In the vertical view, the elements
                        end up being: threadPaneBox, threadpane-splitter, messagepanebox)
                     -->
                   <!-- second panel is the threadPane -->
                   <hbox id="threadPaneBox">
-                   <!-- The threadContentArea was specially created to be a place for
-                        things that want to be above/below the thread pane, regardless
-                        of where the message reader ("messagepane") gets off to. -->
-                   <vbox id="threadContentArea" flex="1" persist="width">
+                    <!-- The threadContentArea was specially created to be a place for
+                         things that want to be above/below the thread pane, regardless
+                         of where the message reader ("messagepane") gets off to. -->
+                    <vbox id="threadContentArea" flex="1" persist="width">
                     <!-- Gloda search facets UI for use when dealing with a gloda-backed
                          search view, implemented by glodaFacets XBL in search.xml. -->
                     <box id="glodaSearchFacets"/>
-                    <tree id="threadTree"
-                          persist="lastfoldersent width"
-                          treelines="true"
-                          flex="2"
-                          enableColumnDrag="true"
-                          _selectDelay="250"
-                          class="plain"
-                          lastfoldersent="false"
-                          keepcurrentinview="true"
-                          disableKeyNavigation="true"
-                          context="mailContext"
-                          onkeydown="ThreadPaneKeyDown(event);"
-                          onselect="ThreadPaneSelectionChanged();"
-                          >
-                      <treecols id="threadCols" is="thread-pane-treecols" pickertooltiptext="&columnChooser2.tooltip;">
-                        <treecol is="treecol-image" id="threadCol" fixed="true" cycler="true"
-                                 class="treecol-image threadColumnHeader" currentView="unthreaded"
-                                 label="&threadColumn.label;" tooltiptext="&threadColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol is="treecol-image" id="flaggedCol" fixed="true" cycler="true"
-                                 class="treecol-image flagColumnHeader"
-                                 label="&starredColumn.label;" tooltiptext="&starredColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol is="treecol-image" id="attachmentCol" fixed="true"
-                                 class="treecol-image attachmentColumnHeader"
-                                 label="&attachmentColumn.label;" tooltiptext="&attachmentColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="subjectCol" persist="width" flex="7" ignoreincolumnpicker="true"
-                                 label="&subjectColumn.label;" tooltiptext="&subjectColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol is="treecol-image" id="unreadButtonColHeader" fixed="true" cycler="true"
-                                 class="treecol-image readColumnHeader"
-                                 label="&readColumn.label;" tooltiptext="&readColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="senderCol" persist="width" flex="4"
-                                 hidden="false" swappedhidden="true"
-                                 label="&fromColumn.label;" tooltiptext="&fromColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="recipientCol" persist="width" flex="4"
-                                 hidden="true" swappedhidden="false"
-                                 label="&recipientColumn.label;" tooltiptext="&recipientColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="correspondentCol" persist="width" flex="4" hidden="true"
-                                 label="&correspondentColumn.label;" tooltiptext="&correspondentColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol is="treecol-image" id="junkStatusCol" persist="width" fixed="true"
-                                 cycler="true" class="treecol-image junkStatusHeader"
-                                 label="&junkStatusColumn.label;" tooltiptext="&junkStatusColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="receivedCol" persist="width temphidden" flex="2" hidden="true"
-                                 label="&receivedColumn.label;" tooltiptext="&receivedColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="dateCol" persist="width" flex="2"
-                                 label="&dateColumn.label;" tooltiptext="&dateColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="statusCol" persist="width" flex="1" hidden="true"
-                                 label="&statusColumn.label;" tooltiptext="&statusColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="sizeCol" persist="width" flex="1" hidden="true"
-                                 label="&sizeColumn.label;" tooltiptext="&sizeColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="tagsCol" persist="width" flex="1" hidden="true"
-                                 label="&tagsColumn.label;" tooltiptext="&tagsColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="accountCol" persist="width" flex="1" hidden="true"
-                                 label="&accountColumn.label;" tooltiptext="&accountColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="priorityCol" persist="width" flex="1" hidden="true"
-                                 label="&priorityColumn.label;" tooltiptext="&priorityColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="unreadCol" persist="width" flex="1" hidden="true"
-                                 label="&unreadColumn.label;" tooltiptext="&unreadColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="totalCol" persist="width" flex="1" hidden="true"
-                                 label="&totalColumn.label;" tooltiptext="&totalColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="locationCol" persist="width" flex="1" hidden="true"
-                                 label="&locationColumn.label;" tooltiptext="&locationColumn2.tooltip;"/>
-                        <splitter class="tree-splitter"/>
-                        <treecol id="idCol" persist="width" flex="1" hidden="true"
-                                 label="&idColumn.label;" tooltiptext="&idColumn2.tooltip;"/>
-                      </treecols>
-                    <treechildren ondragstart="ThreadPaneOnDragStart(event);"
-                                  ondragover="ThreadPaneOnDragOver(event);"
-                                  ondrop="ThreadPaneOnDrop(event);"/>
-                  </tree>
-                 </vbox>
-                </hbox>
+#include threadTree.inc.xul
+                    </vbox>
+                  </hbox>
                 <!-- extensions may overlay in additional panels; don't assume that there are only 2! -->
                 </deck> <!-- displayDeck -->
 
                 <!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePane() -->
                 <splitter id="threadpane-splitter"
                           collapse="after"
                           collapsed="true"
                           onmouseup="OnMouseUpThreadAndMessagePaneSplitter()"/>
new file mode 100644
--- /dev/null
+++ b/mail/base/content/threadTree.inc.xul
@@ -0,0 +1,199 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+                    <!-- The threadTree is shared with messenger.xul (MAIN_WINDOW)
+                         and SearchDialog.xul (SEARCH_WINDOW). -->
+                    <tree id="threadTree"
+                          class="plain"
+                          persist="lastfoldersent width"
+                          flex="2"
+                          treelines="true"
+                          enableColumnDrag="true"
+                          _selectDelay="250"
+                          lastfoldersent="false"
+                          keepcurrentinview="true"
+                          disableKeyNavigation="true"
+                          context="mailContext"
+                          onkeydown="ThreadPaneKeyDown(event);"
+                          onselect="ThreadPaneSelectionChanged();">
+#ifdef MAIN_WINDOW
+                      <treecols is="thread-pane-treecols" id="threadCols"
+#else
+                      <treecols id="threadCols"
+#endif
+                                pickertooltiptext="&columnChooser2.tooltip;">
+                        <treecol is="treecol-image" id="threadCol"
+                                 class="treecol-image threadColumnHeader"
+                                 persist="hidden ordinal"
+                                 fixed="true"
+                                 cycler="true"
+                                 currentView="unthreaded"
+#ifdef SEARCH_WINDOW
+                                 ignoreincolumnpicker="true"
+                                 hidden="true"
+#endif
+                                 closemenu="none"
+                                 label="&threadColumn.label;"
+                                 tooltiptext="&threadColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol is="treecol-image" id="flaggedCol"
+                                 class="treecol-image flagColumnHeader"
+                                 persist="hidden ordinal sortDirection"
+                                 fixed="true"
+                                 cycler="true"
+                                 closemenu="none"
+                                 label="&starredColumn.label;"
+                                 tooltiptext="&starredColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol is="treecol-image" id="attachmentCol"
+                                 class="treecol-image attachmentColumnHeader"
+                                 persist="hidden ordinal sortDirection"
+                                 fixed="true"
+                                 closemenu="none"
+                                 label="&attachmentColumn.label;"
+                                 tooltiptext="&attachmentColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="subjectCol"
+                                 persist="ordinal width sortDirection"
+                                 flex="7"
+                                 ignoreincolumnpicker="true"
+                                 closemenu="none"
+                                 label="&subjectColumn.label;"
+                                 tooltiptext="&subjectColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol is="treecol-image" id="unreadButtonColHeader"
+                                 class="treecol-image readColumnHeader"
+                                 persist="hidden ordinal sortDirection"
+                                 fixed="true"
+                                 cycler="true"
+                                 closemenu="none"
+                                 label="&readColumn.label;"
+                                 tooltiptext="&readColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="senderCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="4"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&fromColumn.label;"
+                                 tooltiptext="&fromColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="recipientCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="4"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&recipientColumn.label;"
+                                 tooltiptext="&recipientColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="correspondentCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="4"
+                                 closemenu="none"
+                                 label="&correspondentColumn.label;"
+                                 tooltiptext="&correspondentColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol is="treecol-image" id="junkStatusCol"
+                                 class="treecol-image junkStatusHeader"
+                                 persist="hidden ordinal sortDirection"
+                                 fixed="true"
+                                 cycler="true"
+                                 closemenu="none"
+                                 label="&junkStatusColumn.label;"
+                                 tooltiptext="&junkStatusColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="receivedCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="2"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&receivedColumn.label;"
+                                 tooltiptext="&receivedColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="dateCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="2"
+                                 closemenu="none"
+                                 label="&dateColumn.label;"
+                                 tooltiptext="&dateColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="statusCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&statusColumn.label;"
+                                 tooltiptext="&statusColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="sizeCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&sizeColumn.label;"
+                                 tooltiptext="&sizeColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="tagsCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&tagsColumn.label;"
+                                 tooltiptext="&tagsColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="accountCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&accountColumn.label;"
+                                 tooltiptext="&accountColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="priorityCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&priorityColumn.label;"
+                                 tooltiptext="&priorityColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="unreadCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&unreadColumn.label;"
+                                 tooltiptext="&unreadColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="totalCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&totalColumn.label;"
+                                 tooltiptext="&totalColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="locationCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 closemenu="none"
+                                 label="&locationColumn.label;"
+                                 tooltiptext="&locationColumn2.tooltip;"/>
+                        <splitter class="tree-splitter"/>
+                        <treecol id="idCol"
+                                 persist="hidden ordinal sortDirection width"
+                                 flex="1"
+                                 hidden="true"
+                                 closemenu="none"
+                                 label="&idColumn.label;"
+                                 tooltiptext="&idColumn2.tooltip;"/>
+                      </treecols>
+#ifdef MAIN_WINDOW
+                    <treechildren ondragstart="ThreadPaneOnDragStart(event);"
+                                  ondragover="ThreadPaneOnDragOver(event);"
+                                  ondrop="ThreadPaneOnDrop(event);"/>
+#else
+                    <treechildren/>
+#endif
+                  </tree>
--- a/mail/locales/en-US/chrome/messenger/SearchDialog.dtd
+++ b/mail/locales/en-US/chrome/messenger/SearchDialog.dtd
@@ -30,51 +30,8 @@
 <!ENTITY abSearchHeading.accesskey   "h">
 <!ENTITY propertiesButton.label      "Properties">
 <!ENTITY propertiesButton.accesskey  "P">
 <!ENTITY composeButton.label         "Write">
 <!ENTITY composeButton.accesskey     "W">
 <!ENTITY deleteCardButton.label      "Delete">
 <!ENTITY deleteCardButton.accesskey  "D">
 <!ENTITY abSearchDialogTitle.label   "Advanced Address Book Search">
-
-<!-- Thread Pane -->
-<!ENTITY threadColumn.label "Thread">
-<!ENTITY fromColumn.label "From">
-<!ENTITY recipientColumn.label "Recipient">
-<!ENTITY correspondentColumn.label "Correspondents">
-<!ENTITY subjectColumn.label "Subject">
-<!ENTITY dateColumn.label "Date">
-<!ENTITY priorityColumn.label "Priority">
-<!ENTITY tagsColumn.label "Tags">
-<!ENTITY accountColumn.label "Account">
-<!ENTITY statusColumn.label "Status">
-<!ENTITY sizeColumn.label "Size">
-<!ENTITY junkStatusColumn.label "Junk Status">
-<!ENTITY unreadColumn.label "Unread">
-<!ENTITY totalColumn.label "Total">
-<!ENTITY readColumn.label "Read">
-<!ENTITY receivedColumn.label "Received">
-<!ENTITY starredColumn.label "Starred">
-<!ENTITY locationColumn.label "Location">
-<!ENTITY idColumn.label "Order Received">
-
-<!-- Thread Pane Tooltips -->
-<!ENTITY columnChooser2.tooltip "Select columns to display">
-<!ENTITY threadColumn2.tooltip "Display message threads">
-<!ENTITY fromColumn2.tooltip "Sort by from">
-<!ENTITY recipientColumn2.tooltip "Sort by recipient">
-<!ENTITY correspondentColumn2.tooltip "Sort by correspondents">
-<!ENTITY subjectColumn2.tooltip "Sort by subject">
-<!ENTITY dateColumn2.tooltip "Sort by date">
-<!ENTITY priorityColumn2.tooltip "Sort by priority">
-<!ENTITY tagsColumn2.tooltip "Sort by tags">
-<!ENTITY accountColumn2.tooltip "Sort by account">
-<!ENTITY statusColumn2.tooltip "Sort by status">
-<!ENTITY sizeColumn2.tooltip "Sort by size">
-<!ENTITY junkStatusColumn2.tooltip "Sort by junk status">
-<!ENTITY unreadColumn2.tooltip "Number of unread messages in thread">
-<!ENTITY totalColumn2.tooltip "Total number of messages in thread">
-<!ENTITY readColumn2.tooltip "Sort by read">
-<!ENTITY receivedColumn2.tooltip "Sort by date received">
-<!ENTITY starredColumn2.tooltip "Sort by star">
-<!ENTITY locationColumn2.tooltip "Sort by location">
-<!ENTITY idColumn2.tooltip "Sort by order received">