Bug 289471 Add sort by Attachment to mailnews

p=me r=neil.parkwaycc.co.uk sr=bienvenu a=asa
This commit is contained in:
bugzilla%arlen.demon.co.uk 2005-05-09 00:06:38 +00:00
Родитель de5864cb2a
Коммит f7cb6ff817
17 изменённых файлов: 84 добавлений и 315 удалений

Просмотреть файл

@ -576,6 +576,9 @@ function ConvertColumnIDToSortType(columnID)
case "idCol":
sortKey = nsMsgViewSortType.byId;
break;
case "attachmentCol":
sortKey = nsMsgViewSortType.byAttachments;
break;
default:
dump("unsupported sort column: " + columnID + "\n");
sortKey = 0;
@ -638,6 +641,9 @@ function ConvertSortTypeToColumnID(sortKey)
case nsMsgViewSortType.byJunkStatus:
columnID = "junkStatusCol";
break;
case nsMsgViewSortType.byAttachments:
columnID = "attachmentCol";
break;
default:
dump("unsupported sort key: " + sortKey + "\n");
columnID = null;

Просмотреть файл

@ -221,6 +221,7 @@ function InitViewSortByMenu()
setSortByMenuItemCheckState("sortByJunkStatusMenuitem", (sortType == nsMsgViewSortType.byJunkStatus));
setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));
setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));
setSortByMenuItemCheckState("sortByAttachmentsMenuitem", (sortType == nsMsgViewSortType.byAttachments));
var sortOrder = gDBView.sortOrder;
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor

Просмотреть файл

@ -1238,6 +1238,7 @@
<menuitem id="sortByUnreadMenuitem" type="radio" name="sortby" label="&sortByUnreadCmd.label;" accesskey="&sortByUnreadCmd.accesskey;" oncommand="MsgSortByUnread()"/>
<menuitem id="sortByLabelMenuitem" type="radio" name="sortby" label="&sortByLabelCmd.label;" accesskey="&sortByLabelCmd.accesskey;" oncommand="MsgSortByLabel()"/>
<menuitem id="sortByJunkStatusMenuitem" type="radio" name="sortby" label="&sortByJunkStatusCmd.label;" accesskey="&sortByJunkStatusCmd.accesskey;" oncommand="MsgSortByJunkStatus()"/>
<menuitem id="sortByAttachmentsMenuitem" type="radio" name="sortby" label="&sortByAttachmentsCmd.label;" accesskey="&sortByAttachmentsCmd.accesskey;" oncommand="MsgSortByAttachments()"/>
<menuseparator/>
<menuitem id="sortAscending" type="radio" name="sortdirection" label="&sortAscending.label;" accesskey="&sortAscending.accesskey;" oncommand="MsgSortAscending()"/>
<menuitem id="sortDescending" type="radio" name="sortdirection" label="&sortDescending.label;" accesskey="&sortDescending.accesskey;" oncommand="MsgSortDescending()"/>

Просмотреть файл

@ -918,6 +918,12 @@ function OnFolderUnreadColAttrModified(event)
}
}
function OnAttachmentColAttrModified(event)
{
if (event.attrName == "hidden")
UpdateAttachmentCol(false);
}
function UpgradeFolderPaneUI()
{
// placeholder in case any new columns get added to the folder pane
@ -962,36 +968,37 @@ function OnLoadFolderPane()
// "mailnews.ui.threadpane.version" pref.
function UpgradeThreadPaneUI()
{
var threadPaneUIVersion;
try {
threadPaneUIVersion = pref.getIntPref("mailnews.ui.threadpane.version");
if (threadPaneUIVersion < 4) {
var threadTree = document.getElementById("threadTree");
var junkCol = document.getElementById("junkStatusCol");
var beforeCol;
if (threadPaneUIVersion < 3) {
var subjectCol = document.getElementById("subjectCol");
var threadTree = document.getElementById("threadTree");
var junkCol = document.getElementById("junkStatusCol");
var subjectCol = document.getElementById("subjectCol");
var beforeCol;
switch (pref.getIntPref("mailnews.ui.threadpane.version")) {
case 1: // upgrade from 1 to 2
case 2: // upgrade from 2 to 3
beforeCol = subjectCol.boxObject.nextSibling.boxObject.nextSibling;
if (beforeCol)
threadTree._reorderColumn(junkCol, beforeCol, true);
else // subjectCol was the last column, put it after
threadTree._reorderColumn(junkCol, subjectCol, false);
}
var senderCol = document.getElementById("senderCol");
var recipientCol = document.getElementById("recipientCol");
beforeCol = junkCol.boxObject.nextSibling.boxObject.nextSibling;
if (beforeCol)
threadTree._reorderColumn(recipientCol, beforeCol, true);
else // junkCol was the last column, put it after
threadTree._reorderColumn(recipientCol, junkCol, false);
threadTree._reorderColumn(senderCol, recipientCol, true);
case 3: // upgrade from 3 to 4
var senderCol = document.getElementById("senderCol");
var recipientCol = document.getElementById("recipientCol");
beforeCol = junkCol.boxObject.nextSibling.boxObject.nextSibling;
if (beforeCol)
threadTree._reorderColumn(recipientCol, beforeCol, true);
else // junkCol was the last column, put it after
threadTree._reorderColumn(recipientCol, junkCol, false);
threadTree._reorderColumn(senderCol, recipientCol, true);
pref.setIntPref("mailnews.ui.threadpane.version", 4);
case 4: // upgrade from 4 to 5
var attachmentCol = document.getElementById("attachmentCol");
threadTree._reorderColumn(attachmentCol, subjectCol, true);
pref.setIntPref("mailnews.ui.threadpane.version", 5);
default: // already upgraded
break;
}
}
catch (ex) {
@ -1002,6 +1009,18 @@ function UpgradeThreadPaneUI()
function OnLoadThreadPane()
{
UpgradeThreadPaneUI();
UpdateAttachmentCol(true);
}
function UpdateAttachmentCol(aFirstTimeFlag)
{
var attachmentCol = document.getElementById("attachmentCol");
var threadTree = GetThreadTree();
threadTree.setAttribute("noattachcol", attachmentCol.getAttribute("hidden"));
if (aFirstTimeFlag)
attachmentCol.addEventListener("DOMAttrModified", OnAttachmentColAttrModified, false);
else
threadTree.treeBoxObject.clearStyleAndImageCaches();
}
function GetFolderDatasource()

Просмотреть файл

@ -49,13 +49,17 @@
<script src="chrome://messenger/content/threadPane.js"/>
<tree id="threadTree" persist="width lastfoldersent" flex="1" enableColumnDrag="true" _selectDelay="500" class="plain focusring" disableKeyNavigation="true" lastfoldersent="false"
<tree id="threadTree" persist="width lastfoldersent" flex="1" enableColumnDrag="true" _selectDelay="500"
class="plain focusring" disableKeyNavigation="true" lastfoldersent="false" noattachcol="true"
onkeypress="ThreadPaneKeyPress(event);"
onselect="ThreadPaneSelectionChanged();">
<treecols pickertooltiptext="&columnChooser.tooltip;">
<treecol id="threadCol" persist="hidden ordinal" fixed="true" cycler="true" class="treecol-image threadColumnHeader" currentView="unthreaded"
display="&threadColumn.label;" tooltiptext="&threadColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="attachmentCol" persist="hidden ordinal" fixed="true" class="treecol-image attachmentColumnHeader" hidden="true"
display="&attachmentColumn.label;" tooltiptext="&attachmentColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="subjectCol" persist="hidden ordinal width" flex="7" ignoreincolumnpicker="true"
label="&subjectColumn.label;" tooltiptext="&subjectColumn.tooltip;"/>
<splitter class="tree-splitter"/>

Просмотреть файл

@ -204,6 +204,8 @@
<!ENTITY sortByUnreadCmd.accesskey "R">
<!ENTITY sortByOrderReceivedCmd.label "Order Received">
<!ENTITY sortByOrderReceivedCmd.accesskey "O">
<!ENTITY sortByAttachmentsCmd.label "Attachments">
<!ENTITY sortByAttachmentsCmd.accesskey "m">
<!ENTITY sortAscending.label "Ascending">
<!ENTITY sortAscending.accesskey "A">
<!ENTITY sortDescending.label "Descending">

Просмотреть файл

@ -38,6 +38,7 @@
<!ENTITY threadColumn.label "Thread">
<!ENTITY senderColumn.label "Sender">
<!ENTITY recipientColumn.label "Recipient">
<!ENTITY attachmentColumn.label "Attachments">
<!ENTITY subjectColumn.label "Subject">
<!ENTITY dateColumn.label "Date">
<!ENTITY priorityColumn.label "Priority">
@ -59,6 +60,7 @@
<!ENTITY threadColumn.tooltip "Click to display message threads">
<!ENTITY senderColumn.tooltip "Click to sort by sender">
<!ENTITY recipientColumn.tooltip "Click to sort by recipient">
<!ENTITY attachmentColumn.tooltip "Click to sort by attachments">
<!ENTITY subjectColumn.tooltip "Click to sort by subject">
<!ENTITY dateColumn.tooltip "Click to sort by date">
<!ENTITY priorityColumn.tooltip "Click to sort by priority">
@ -73,6 +75,3 @@
<!ENTITY flagColumn.tooltip "Click to sort by flag">
<!ENTITY locationColumn.tooltip "Click to sort by location">
<!ENTITY idColumn.tooltip "Click to sort by order received">

Просмотреть файл

@ -362,6 +362,9 @@ classic.jar:
skin/classic/messenger/start.css (messenger/start.css)
skin/classic/messenger/virtualFolderListDialog.css (messenger/virtualFolderListDialog.css)
skin/classic/messenger/icons/attach.gif (messenger/icons/attach.gif)
skin/classic/messenger/icons/attachment.gif (messenger/icons/attachment.gif)
skin/classic/messenger/icons/attachment-col.gif (messenger/icons/attachment-col.gif)
skin/classic/messenger/icons/attachment-selected.gif (messenger/icons/attachment-selected.gif)
skin/classic/messenger/icons/check.gif (messenger/icons/check.gif)
skin/classic/messenger/icons/dot.gif (messenger/icons/dot.gif)
skin/classic/messenger/icons/flagcol.gif (messenger/icons/flagcol.gif)

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -142,6 +142,20 @@ treechildren::-moz-tree-image(unreadButtonColHeader, unread) {
list-style-image: url("chrome://messenger/skin/icons/unreadmail.gif");
}
/* ..... attachment column ..... */
.attachmentColumnHeader {
list-style-image: url("chrome://messenger/skin/icons/attachment-col.gif");
}
treechildren::-moz-tree-image(attachmentCol, attach) {
list-style-image: url("chrome://messenger/skin/icons/attachment.gif");
}
treechildren::-moz-tree-image(attachmentCol, attach, focus, selected) {
list-style-image: url("chrome://messenger/skin/icons/attachment-selected.gif");
}
/* ..... flag column ..... */
.flagColumnHeader {
@ -192,7 +206,7 @@ treechildren::-moz-tree-image(subjectCol, new) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-new.gif");
}
treechildren::-moz-tree-image(subjectCol, attach) {
tree[noattachcol="true"] > treechildren::-moz-tree-image(subjectCol, attach) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-attach.gif");
}
@ -208,7 +222,7 @@ treechildren::-moz-tree-image(subjectCol, new, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-new-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, attach, offline) {
tree[noattachcol="true"] > treechildren::-moz-tree-image(subjectCol, attach, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-attach-offl.gif");
}
@ -220,11 +234,11 @@ treechildren::-moz-tree-image(subjectCol, news) {
list-style-image: url("chrome://messenger/skin/icons/message-news.gif");
}
treechildren::-moz-tree-image(subjectCol, news, attach) {
tree[noattachcol="true"] > treechildren::-moz-tree-image(subjectCol, news, attach) {
list-style-image: url("chrome://messenger/skin/icons/message-news-attach.gif");
}
treechildren::-moz-tree-image(subjectCol, news, attach, offline) {
tree[noattachcol="true"] > treechildren::-moz-tree-image(subjectCol, news, attach, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-news-attach-offl.gif");
}
@ -232,11 +246,11 @@ treechildren::-moz-tree-image(subjectCol, news, new) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new.gif");
}
treechildren::-moz-tree-image(subjectCol, news, new, attach) {
tree[noattachcol="true"] > treechildren::-moz-tree-image(subjectCol, news, new, attach) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new-attach.gif");
}
treechildren::-moz-tree-image(subjectCol, news, new, attach, offline) {
tree[noattachcol="true"] > treechildren::-moz-tree-image(subjectCol, news, new, attach, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new-attach-off.gif");
}

Просмотреть файл

@ -334,6 +334,9 @@ modern.jar:
skin/modern/messenger/icons/acct-search.gif (messenger/icons/acct-search.gif)
skin/modern/messenger/icons/acct-subscribe.gif (messenger/icons/acct-subscribe.gif)
skin/modern/messenger/icons/attach.gif (messenger/icons/attach.gif)
skin/modern/messenger/icons/attachment.gif (messenger/icons/attachment.gif)
skin/modern/messenger/icons/attachment-col.gif (messenger/icons/attachment-col.gif)
skin/modern/messenger/icons/attachment-selected.gif (messenger/icons/attachment-selected.gif)
skin/modern/messenger/icons/check.gif (messenger/icons/check.gif)
skin/modern/messenger/icons/dot.gif (messenger/icons/dot.gif)
skin/modern/messenger/icons/flagcol-flagged.gif (messenger/icons/flagcol-flagged.gif)

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,283 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Joe Hewitt <hewitt@netscape.com>
* Scott MacGregor (mscott@netscape.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ===== threadPane.css ==============================================
== Styles for the thread pane in the Messenger 3-pane window.
======================================================================= */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* ::::: thread decoration ::::: */
treechildren::-moz-tree-cell-text(read) {
font-weight: normal;
}
treechildren::-moz-tree-cell-text(unread) {
font-weight: bold;
}
treechildren::-moz-tree-cell-text(imapdeleted) {
text-decoration: line-through;
}
/* on a collapsed thread, if the top level message is read, but the thread has
* unread children, underline the text. 4.x mac did this, very slick
*/
treechildren::-moz-tree-cell-text(container, closed, hasUnread, read) {
text-decoration: underline;
}
/* ::::: priority colors ::::: */
/****
**** Priority colors currently not being used at the moment. It has been
**** disabled so as to not conflict with the labels color feature.
****
treechildren::-moz-tree-cell-text(priorityCol, priority-highest) {
color: red;
}
treechildren::-moz-tree-cell-text(priorityCol, priority-high) {
color: rgb(128, 0, 0);
}
treechildren::-moz-tree-cell-text(priorityCol, priority-lowest) {
color: rgb(170, 170, 170);
}
treechildren::-moz-tree-cell-text(priorityCol, priority-low) {
color: rgb(85, 85, 85);
}
treechildren::-moz-tree-cell-text(priorityCol, selected, focus) {
color: #000000;
}
treechildren::-moz-tree-cell-text(priorityCol, selected, focus) {
color: #FFFFFF;
}
****/
/* ::::: message icons ::::: */
/* ::::: message column icons ::::: */
/* ..... thread column ..... */
.threadColumnHeader {
list-style-image: url("chrome://messenger/skin/icons/threadcol-unthreaded.gif");
}
.threadColumnHeader[sortDirection="ascending"] {
list-style-image: url("chrome://messenger/skin/icons/threadcol-threaded.gif");
}
.threadColumnHeader[sortDirection="descending"] {
list-style-image: url("chrome://messenger/skin/icons/threadcol-threaded.gif");
}
treechildren::-moz-tree-image(threadCol, container) {
list-style-image: url("chrome://messenger/skin/icons/thread-closed.gif");
}
treechildren::-moz-tree-image(threadCol, container, hasUnread) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-closed.gif");
}
/* ::::: new thread icons for watch and ignore ::::: */
treechildren::-moz-tree-image(news, threadCol, watch) {
list-style-image: url("chrome://messenger/skin/icons/thread-closed-eye.gif");
}
treechildren::-moz-tree-image(news, threadCol, ignore) {
list-style-image: url("chrome://messenger/skin/icons/thread-closed-kill.gif");
}
treechildren::-moz-tree-image(news, threadCol, watch, offline) {
list-style-image: url("chrome://messenger/skin/icons/thread-closed-offl-eye.gif");
}
treechildren::-moz-tree-image(news, threadCol, ignore, offline) {
list-style-image: url("chrome://messenger/skin/icons/thread-closed-offl-kill.gif");
}
treechildren::-moz-tree-image(news, threadCol, container, hasUnread, watch) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-closed-eye.gif");
}
treechildren::-moz-tree-image(news, threadCol, container, hasUnread, ignore) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-closed-kill.gif");
}
treechildren::-moz-tree-image(news, threadCol, container, hasUnread, watch, offline) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-closed-offl-eye.gif");
}
treechildren::-moz-tree-image(news, threadCol, container, hasUnread, ignore, offline) {
list-style-image: url("chrome://messenger/skin/icons/thread-new-closed-offl-kill.gif");
}
/* ..... read column ..... */
.readColumnHeader {
list-style-image: url("chrome://messenger/skin/icons/readcol-unread.gif");
}
treechildren::-moz-tree-image(unreadButtonColHeader) {
list-style-image: url("chrome://messenger/skin/icons/readcol-read.gif");
padding-left: 0px;
padding-right: 4px;
}
treechildren::-moz-tree-image(unreadButtonColHeader, unread) {
list-style-image: url("chrome://messenger/skin/icons/readcol-unread.gif");
}
/* ..... flag column ..... */
.flagColumnHeader {
list-style-image: url("chrome://messenger/skin/icons/flagcol-flagged.gif");
}
treechildren::-moz-tree-image(flaggedCol) {
list-style-image: url("chrome://messenger/skin/icons/readcol-read.gif");
padding-left: 0px;
padding-right: 4px;
}
treechildren::-moz-tree-image(flaggedCol, flagged) {
list-style-image: url("chrome://messenger/skin/icons/flagcol-flagged.gif");
}
/* ..... junkStatus column ..... */
.junkStatusHeader {
list-style-image: url("chrome://messenger/skin/icons/message-junk-other.gif");
}
/* "unknown" now looks like "not junk". see bug #182386 */
treechildren::-moz-tree-image(junkStatusCol) {
list-style-image: url("chrome://messenger/skin/icons/readcol-read.gif");
padding-left: 0px;
padding-right: 4px;
}
treechildren::-moz-tree-image(junkStatusCol, junk) {
list-style-image: url("chrome://messenger/skin/icons/message-junk-other.gif");
}
treechildren::-moz-tree-image(junkStatusCol, notjunk) {
list-style-image: url("chrome://messenger/skin/icons/readcol-read.gif");
padding-left: 0px;
padding-right: 4px;
}
/* ..... subject column ..... */
treechildren::-moz-tree-image(subjectCol) {
margin-right: 2px;
list-style-image: url("chrome://messenger/skin/icons/message-mail.gif");
}
treechildren::-moz-tree-image(subjectCol, new) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-new.gif");
}
treechildren::-moz-tree-image(subjectCol, attach) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-attach.gif");
}
treechildren::-moz-tree-image(subjectCol, imapdeleted) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-imapdelete.gif");
}
treechildren::-moz-tree-image(subjectCol, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, new, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-new-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, attach, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-attach-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, imapdeleted, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-delete-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, news) {
list-style-image: url("chrome://messenger/skin/icons/message-news.gif");
}
treechildren::-moz-tree-image(subjectCol, news, attach) {
list-style-image: url("chrome://messenger/skin/icons/message-news-attach.gif");
}
treechildren::-moz-tree-image(subjectCol, news, attach, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-news-attach-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, news, new) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new.gif");
}
treechildren::-moz-tree-image(subjectCol, news, new, attach) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new-attach.gif");
}
treechildren::-moz-tree-image(subjectCol, news, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new-attach-off.gif");
}
treechildren::-moz-tree-image(subjectCol, news, new, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-news-new-offl.gif");
}
treechildren::-moz-tree-image(subjectCol, news, offline) {
list-style-image: url("chrome://messenger/skin/icons/message-news-offl.gif");
}
#sizeCol,
#unreadCol,
#totalCol {
text-align: right;
}