зеркало из https://github.com/mozilla/gecko-dev.git
Bug 289471 Add sort by Attachment to mailnews
p=me r=neil.parkwaycc.co.uk sr=bienvenu a=asa
This commit is contained in:
Родитель
bb141d7e14
Коммит
a6c7d42ba5
|
@ -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)
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 132 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 135 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 132 B |
|
@ -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)
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 898 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 986 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 986 B |
|
@ -169,6 +169,20 @@ treechildren::-moz-tree-image(unreadButtonColHeader, unread) {
|
|||
list-style-image: url("chrome://messenger/skin/icons/readcol-unread.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 {
|
||||
|
@ -219,7 +233,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");
|
||||
}
|
||||
|
||||
|
@ -235,7 +249,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");
|
||||
}
|
||||
|
||||
|
@ -247,11 +261,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");
|
||||
}
|
||||
|
||||
|
@ -259,11 +273,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, 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");
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче