change label column to tags column in thread pane, sr=sspitzer 341661

This commit is contained in:
bienvenu%nventure.com 2006-06-15 21:28:31 +00:00
parent a1da3222e2
commit b258e46822
24 changed files with 80 additions and 100 deletions

View File

@ -173,8 +173,8 @@
class="treecol-image flagColumnHeader"
display="&flagColumn.label;" tooltiptext="&flagColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="labelCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&labelColumn.label;" tooltiptext="&labelColumn.tooltip;"/>
<treecol id="tagsCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&tagsColumn.label;" tooltiptext="&tagsColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="priorityCol" persist="hidden ordinal width" flex="1"
label="&priorityColumn.label;" tooltiptext="&priorityColumn.tooltip;"/>

View File

@ -523,8 +523,8 @@ function ConvertColumnIDToSortType(columnID)
case "threadCol":
sortKey = nsMsgViewSortType.byThread;
break;
case "labelCol":
sortKey = nsMsgViewSortType.byLabel;
case "tagsCol":
sortKey = nsMsgViewSortType.byTags;
break;
case "junkStatusCol":
sortKey = nsMsgViewSortType.byJunkStatus;
@ -576,8 +576,8 @@ function ConvertSortTypeToColumnID(sortKey)
case nsMsgViewSortType.byStatus:
columnID = "statusCol";
break;
case nsMsgViewSortType.byLabel:
columnID = "labelCol";
case nsMsgViewSortType.byTags:
columnID = "tagsCol";
break;
case nsMsgViewSortType.bySize:
columnID = "sizeCol";

View File

@ -49,7 +49,7 @@ function hiddenWindowStartup()
'sortByDateMenuitem', 'sortByFlagMenuitem', 'sortByOrderReceivedMenuitem', 'sortByPriorityMenuitem',
'sortBySenderMenuitem', 'sortByRecipientMenuitem', 'sortBySenderOrRecipientMenuitem', 'sortBySizeMenuitem',
'sortByStatusMenuitem', 'sortBySubjectMenuitem', 'sortByThreadMenuitem', 'sortByUnreadMenuitem',
'sortByLabelMenuitem', 'sortByJunkStatusMenuitem', 'sortByAttachmentsMenuitem', 'sortAscending', 'sortDescending',
'sortByTagsMenuitem', 'sortByJunkStatusMenuitem', 'sortByAttachmentsMenuitem', 'sortAscending', 'sortDescending',
'viewThreaded', 'viewMessageViewMenu', 'viewAll', 'viewUnread', 'viewLabelMenuItem1',
'viewUnread', 'viewLabelMenuItem1', 'viewLabelMenuItem2', 'viewLabelMenuItem3',
'viewLabelMenuItem4', 'viewLabelMenuItem5', 'viewCreateCustomView', 'viewallheaders',

View File

@ -257,7 +257,7 @@ function InitViewSortByMenu()
setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus));
setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject));
setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread));
setSortByMenuItemCheckState("sortByLabelMenuitem", (sortType == nsMsgViewSortType.byLabel));
setSortByMenuItemCheckState("sortByTagsMenuitem", (sortType == nsMsgViewSortType.byTags));
setSortByMenuItemCheckState("sortByJunkStatusMenuitem", (sortType == nsMsgViewSortType.byJunkStatus));
setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));
setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));
@ -266,7 +266,7 @@ function InitViewSortByMenu()
var sortOrder = gDBView.sortOrder;
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byTags
|| sortType == nsMsgViewSortType.byRecipient || sortType == nsMsgViewSortType.byAccount
|| sortType == nsMsgViewSortType.byStatus || sortType == nsMsgViewSortType.byFlagged
|| sortType == nsMsgViewSortType.byAttachments);

View File

@ -1221,7 +1221,7 @@
<menuitem id="sortByStatusMenuitem" type="radio" name="sortby" label="&sortByStatusCmd.label;" accesskey="&sortByStatusCmd.accesskey;" oncommand="MsgSortByStatus()"/>
<menuitem id="sortBySubjectMenuitem" type="radio" name="sortby" label="&sortBySubjectCmd.label;" accesskey="&sortBySubjectCmd.accesskey;" oncommand="MsgSortBySubject()"/>
<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="sortByTagsMenuitem" type="radio" name="sortby" label="&sortByTagsCmd.label;" accesskey="&sortByTagsCmd.accesskey;" oncommand="MsgSortByTags()"/>
<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/>

View File

@ -365,8 +365,8 @@
class="treecol-image flagColumnHeader"
display="&flagColumn.label;" tooltiptext="&flagColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="labelCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&labelColumn.label;" tooltiptext="&labelColumn.tooltip;"/>
<treecol id="tagsCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&tagsColumn.label;" tooltiptext="&tagsColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="accountCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&accountColumn.label;" tooltiptext="&accountColumn.tooltip;"/>

View File

@ -1160,7 +1160,6 @@ function OnLoadFolderPane()
// "mailnews.ui.threadpane.version" pref.
function UpgradeThreadPaneUI()
{
var labelCol;
var threadPaneUIVersion;
try {

View File

@ -41,7 +41,7 @@
<!ENTITY subjectColumn.label "Subject">
<!ENTITY dateColumn.label "Date">
<!ENTITY priorityColumn.label "Priority">
<!ENTITY labelColumn.label "Label">
<!ENTITY tagsColumn.label "Tags">
<!ENTITY accountColumn.label "Account">
<!ENTITY statusColumn.label "Status">
<!ENTITY sizeColumn.label "Size">
@ -62,7 +62,7 @@
<!ENTITY subjectColumn.tooltip "Click to sort by subject">
<!ENTITY dateColumn.tooltip "Click to sort by date">
<!ENTITY priorityColumn.tooltip "Click to sort by priority">
<!ENTITY labelColumn.tooltip "Click to sort by label">
<!ENTITY tagsColumn.tooltip "Click to sort by tags">
<!ENTITY accountColumn.tooltip "Click to sort by account">
<!ENTITY statusColumn.tooltip "Click to sort by status">
<!ENTITY sizeColumn.tooltip "Click to sort by size">

View File

@ -142,8 +142,8 @@
<!ENTITY sortBySizeCmd.accesskey "z">
<!ENTITY sortByStatusCmd.label "Status">
<!ENTITY sortByStatusCmd.accesskey "u">
<!ENTITY sortByLabelCmd.label "Label">
<!ENTITY sortByLabelCmd.accesskey "L">
<!ENTITY sortByTagsCmd.label "Tags">
<!ENTITY sortByTagsCmd.accesskey "g">
<!ENTITY sortByJunkStatusCmd.label "Junk Status">
<!ENTITY sortByJunkStatusCmd.accesskey "J">
<!ENTITY sortBySubjectCmd.label "Subject">
@ -525,7 +525,7 @@
<!ENTITY subjectColumn.label "Subject">
<!ENTITY dateColumn.label "Date">
<!ENTITY priorityColumn.label "Priority">
<!ENTITY labelColumn.label "Label">
<!ENTITY tagsColumn.label "Tag">
<!ENTITY accountColumn.label "Account">
<!ENTITY statusColumn.label "Status">
<!ENTITY sizeColumn.label "Size">
@ -547,7 +547,7 @@
<!ENTITY subjectColumn.tooltip "Click to sort by subject">
<!ENTITY dateColumn.tooltip "Click to sort by date">
<!ENTITY priorityColumn.tooltip "Click to sort by priority">
<!ENTITY labelColumn.tooltip "Click to sort by label">
<!ENTITY tagsColumn.tooltip "Click to sort by tags">
<!ENTITY accountColumn.tooltip "Click to sort by account">
<!ENTITY statusColumn.tooltip "Click to sort by status">
<!ENTITY sizeColumn.tooltip "Click to sort by size">

View File

@ -180,8 +180,8 @@ lastWeek=Last Week
twoWeeksAgo=Two Weeks Ago
older=Old Mail
#Grouped By Label
unlabeledMessages=Unlabeled Messages
#Grouped By Tags
untaggedMessages=Untagged Messages
# Grouped by status
messagesWithNoStatus=No Status

View File

@ -50,5 +50,5 @@
46=Attachment Status
47=Junk Status
48=Label
49=Customize
49=Customize...
# don't use above 49

View File

@ -41,7 +41,7 @@
<!ENTITY subjectColumn.label "Subject">
<!ENTITY dateColumn.label "Date">
<!ENTITY priorityColumn.label "Priority">
<!ENTITY labelColumn.label "Label">
<!ENTITY tagsColumn.label "Tags">
<!ENTITY accountColumn.label "Account">
<!ENTITY statusColumn.label "Status">
<!ENTITY sizeColumn.label "Size">
@ -62,7 +62,7 @@
<!ENTITY subjectColumn.tooltip "Click to sort by subject">
<!ENTITY dateColumn.tooltip "Click to sort by date">
<!ENTITY priorityColumn.tooltip "Click to sort by priority">
<!ENTITY labelColumn.tooltip "Click to sort by label">
<!ENTITY tagsColumn.tooltip "Click to sort by tags">
<!ENTITY accountColumn.tooltip "Click to sort by account">
<!ENTITY statusColumn.tooltip "Click to sort by status">
<!ENTITY sizeColumn.tooltip "Click to sort by size">

View File

@ -84,7 +84,7 @@ interface nsMsgViewFlagsType
const nsMsgViewFlagsTypeValue kGroupBySort = 0x40;
};
[scriptable, uuid(b2f31bca-fd18-11d4-a5be-0060b0fc04b7)]
[scriptable, uuid(e8fdf9ca-9425-49de-b231-8d8fb51b8ee2)]
interface nsMsgViewSortType
{
const nsMsgViewSortTypeValue byNone = 0x11; /* not sorted */
@ -100,7 +100,7 @@ interface nsMsgViewSortType
const nsMsgViewSortTypeValue byUnread = 0x1b;
const nsMsgViewSortTypeValue byRecipient = 0x1c;
const nsMsgViewSortTypeValue byLocation = 0x1d;
const nsMsgViewSortTypeValue byLabel = 0x1e;
const nsMsgViewSortTypeValue byTags = 0x1e;
const nsMsgViewSortTypeValue byJunkStatus = 0x1f;
const nsMsgViewSortTypeValue byAttachments = 0x20;
const nsMsgViewSortTypeValue byAccount = 0x21;

View File

@ -564,8 +564,8 @@ function ConvertColumnIDToSortType(columnID)
case "threadCol":
sortKey = nsMsgViewSortType.byThread;
break;
case "labelCol":
sortKey = nsMsgViewSortType.byLabel;
case "tagsCol":
sortKey = nsMsgViewSortType.byTags;
break;
case "junkStatusCol":
sortKey = nsMsgViewSortType.byJunkStatus;
@ -617,8 +617,8 @@ function ConvertSortTypeToColumnID(sortKey)
case nsMsgViewSortType.byStatus:
columnID = "statusCol";
break;
case nsMsgViewSortType.byLabel:
columnID = "labelCol";
case nsMsgViewSortType.byTags:
columnID = "tagsCol";
break;
case nsMsgViewSortType.bySize:
columnID = "sizeCol";
@ -1153,6 +1153,7 @@ function CreateGroupedSearchTerms(searchTermsArray)
var searchTermForQS = searchSession.createTerm();
searchTermForQS.value = searchTerm.value;
searchTermForQS.attrib = searchTerm.attrib;
searchTermForQS.arbitraryHeader = searchTerm.arbitraryHeader
searchTermForQS.op = searchTerm.op;
// mark the first node as a group

View File

@ -228,7 +228,7 @@ function InitViewSortByMenu()
setSortByMenuItemCheckState("sortByStatusMenuitem", (sortType == nsMsgViewSortType.byStatus));
setSortByMenuItemCheckState("sortBySubjectMenuitem", (sortType == nsMsgViewSortType.bySubject));
setSortByMenuItemCheckState("sortByUnreadMenuitem", (sortType == nsMsgViewSortType.byUnread));
setSortByMenuItemCheckState("sortByLabelMenuitem", (sortType == nsMsgViewSortType.byLabel));
setSortByMenuItemCheckState("sortByTagsMenuitem", (sortType == nsMsgViewSortType.byTags));
setSortByMenuItemCheckState("sortByJunkStatusMenuitem", (sortType == nsMsgViewSortType.byJunkStatus));
setSortByMenuItemCheckState("sortBySenderMenuitem", (sortType == nsMsgViewSortType.byAuthor));
setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));
@ -237,7 +237,7 @@ function InitViewSortByMenu()
var sortOrder = gDBView.sortOrder;
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byTags
|| sortType == nsMsgViewSortType.byRecipient|| sortType == nsMsgViewSortType.byFlagged
|| sortType == nsMsgViewSortType.byAttachments);

View File

@ -1289,7 +1289,7 @@
<menuitem id="sortByStatusMenuitem" type="radio" name="sortby" label="&sortByStatusCmd.label;" accesskey="&sortByStatusCmd.accesskey;" oncommand="MsgSortByStatus()"/>
<menuitem id="sortBySubjectMenuitem" type="radio" name="sortby" label="&sortBySubjectCmd.label;" accesskey="&sortBySubjectCmd.accesskey;" oncommand="MsgSortBySubject()"/>
<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="sortByTagsMenuitem" 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/>

View File

@ -216,9 +216,9 @@ function MsgSortByStatus()
MsgSortThreadPane(nsMsgViewSortType.byStatus);
}
function MsgSortByLabel()
function MsgSortByTags()
{
MsgSortThreadPane(nsMsgViewSortType.byLabel);
MsgSortThreadPane(nsMsgViewSortType.byTags);
}
function MsgSortByJunkStatus()
@ -359,7 +359,7 @@ function MsgGroupBySort()
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byTags
|| sortType == nsMsgViewSortType.byStatus || sortType == nsMsgViewSortType.byRecipient
|| sortType == nsMsgViewSortType.byAccount || sortType == nsMsgViewSortType.byFlagged
|| sortType == nsMsgViewSortType.byAttachments);

View File

@ -86,8 +86,8 @@
<treecol id="flaggedCol" persist="hidden ordinal" fixed="true" cycler="true" hidden="true" class="treecol-image flagColumnHeader"
display="&flagColumn.label;" tooltiptext="&flagColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="labelCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&labelColumn.label;" tooltiptext="&labelColumn.tooltip;"/>
<treecol id="tagCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&tagColumn.label;" tooltiptext="&tagColumn.tooltip;"/>
<splitter class="tree-splitter"/>
<treecol id="accountCol" persist="hidden ordinal width" flex="1" hidden="true"
label="&accountColumn.label;" tooltiptext="&accountColumn.tooltip;"/>

View File

@ -190,8 +190,8 @@
<!ENTITY sortBySizeCmd.accesskey "z">
<!ENTITY sortByStatusCmd.label "Status">
<!ENTITY sortByStatusCmd.accesskey "u">
<!ENTITY sortByLabelCmd.label "Label">
<!ENTITY sortByLabelCmd.accesskey "L">
<!ENTITY sortByTagsCmd.label "Tags">
<!ENTITY sortByTagsCmd.accesskey "g">
<!ENTITY sortByJunkStatusCmd.label "Junk Status">
<!ENTITY sortByJunkStatusCmd.accesskey "J">
<!ENTITY sortBySubjectCmd.label "Subject">

View File

@ -181,8 +181,8 @@ lastWeek=Last Week
twoWeeksAgo=Two Weeks Ago
older=Old Mail
#Grouped By Label
unlabeledMessages=Unlabeled Messages
#Grouped By Tags
untaggedMessages=Untagged Messages
# Grouped by status
messagesWithNoStatus=No Status

View File

@ -42,7 +42,7 @@
<!ENTITY subjectColumn.label "Subject">
<!ENTITY dateColumn.label "Date">
<!ENTITY priorityColumn.label "Priority">
<!ENTITY labelColumn.label "Label">
<!ENTITY tagColumn.label "Tags">
<!ENTITY accountColumn.label "Account">
<!ENTITY statusColumn.label "Status">
<!ENTITY sizeColumn.label "Size">
@ -64,7 +64,7 @@
<!ENTITY subjectColumn.tooltip "Click to sort by subject">
<!ENTITY dateColumn.tooltip "Click to sort by date">
<!ENTITY priorityColumn.tooltip "Click to sort by priority">
<!ENTITY labelColumn.tooltip "Click to sort by label">
<!ENTITY tagColumn.tooltip "Click to sort by tags">
<!ENTITY accountColumn.tooltip "Click to sort by account">
<!ENTITY statusColumn.tooltip "Click to sort by status">
<!ENTITY sizeColumn.tooltip "Click to sort by size">

View File

@ -136,17 +136,17 @@ interface nsMsgSearchOp {
const nsMsgSearchOpValue IsLowerThan = 8;
const nsMsgSearchOpValue BeginsWith = 9;
const nsMsgSearchOpValue EndsWith = 10;
const nsMsgSearchOpValue EndsWith = 10;
const nsMsgSearchOpValue SoundsLike = 11; /* for LDAP phoenetic matching */
const nsMsgSearchOpValue LdapDwim = 12; /* Do What I Mean for simple search */
const nsMsgSearchOpValue LdapDwim = 12; /* Do What I Mean for simple search */
const nsMsgSearchOpValue IsGreaterThan = 13;
const nsMsgSearchOpValue IsLessThan = 14;
const nsMsgSearchOpValue IsGreaterThan = 13;
const nsMsgSearchOpValue IsLessThan = 14;
const nsMsgSearchOpValue NameCompletion = 15; /* Name Completion operator...as the name implies =) */
const nsMsgSearchOpValue IsInAB = 16;
const nsMsgSearchOpValue IsntInAB = 17;
const nsMsgSearchOpValue NameCompletion = 15; /* Name Completion operator...as the name implies =) */
const nsMsgSearchOpValue IsInAB = 16;
const nsMsgSearchOpValue IsntInAB = 17;
const nsMsgSearchOpValue kNumMsgSearchOperators = 18; /* must be last operator */
};

View File

@ -1627,10 +1627,6 @@ NS_IMETHODIMP nsMsgDBView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsAStr
rv = FetchPriority(msgHdr, getter_Copies(valueText));
aValue.Assign(valueText);
break;
case 'l': // label - labels are now tags...
rv = FetchTags(msgHdr, getter_Copies(valueText));
aValue.Assign(valueText);
break;
case 'a': // account
if (colID[1] == 'c') // account
{
@ -1655,6 +1651,11 @@ NS_IMETHODIMP nsMsgDBView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsAStr
}
}
}
else if (colID[1] == 'a') // tags
{
rv = FetchTags(msgHdr, getter_Copies(valueText));
aValue.Assign(valueText);
}
break;
case 'u':
// unread msgs in thread col
@ -1733,11 +1734,18 @@ NS_IMETHODIMP nsMsgDBView::CycleCell(PRInt32 row, nsITreeColumn* col)
if (colID[6] == 'B')
ApplyCommandToIndices(nsMsgViewCommandType::toggleMessageRead, (nsMsgViewIndex *) &row, 1);
break;
case 't': // threaded cell or total cell
case 't': // tag cell, threaded cell or total cell
if (colID[1] == 'h')
{
ExpandAndSelectThreadByIndex(row, PR_FALSE);
}
else if (colID[1] == 'a')
{
// ### Do we want to keep this behaviour but switch it to tags?
// We could enumerate over the tags and go to the next one - it looks
// to me like this wasn't working before tags landed, so maybe not
// worth bothering with.
}
break;
case 'f': // flagged column
// toggle the flagged status of the element at row.
@ -1765,27 +1773,6 @@ NS_IMETHODIMP nsMsgDBView::CycleCell(PRInt32 row, nsITreeColumn* col)
}
}
break;
case 'l': // label column
{
nsCOMPtr <nsIMsgDBHdr> msgHdr;
nsresult rv = GetMsgHdrForViewIndex(row, getter_AddRefs(msgHdr));
if (NS_SUCCEEDED(rv) && msgHdr)
{
nsMsgLabelValue label;
if (NS_SUCCEEDED(msgHdr->GetLabel(&label)))
{
// we have five labels, and the special 0 label, meaning no label.
// lastLabel - label1 is 4, so we need to compare label to 4 + 1 to see if we're at the last label
if (label != (nsMsgViewCommandType::lastLabel - nsMsgViewCommandType::label1 + 1))
msgHdr->SetLabel(label + 1);
else
msgHdr->SetLabel(0);
}
}
}
break;
default:
break;
@ -3271,6 +3258,7 @@ nsresult nsMsgDBView::GetFieldTypeAndLenForSort(nsMsgViewSortTypeValue sortType,
*pMaxLen = kMaxSubjectKey;
break;
case nsMsgViewSortType::byAccount:
case nsMsgViewSortType::byTags:
case nsMsgViewSortType::byLocation:
*pFieldType = kCollationKey;
*pMaxLen = kMaxLocationKey;
@ -3291,7 +3279,6 @@ nsresult nsMsgDBView::GetFieldTypeAndLenForSort(nsMsgViewSortTypeValue sortType,
case nsMsgViewSortType::byFlagged:
case nsMsgViewSortType::byUnread:
case nsMsgViewSortType::byStatus:
case nsMsgViewSortType::byLabel:
case nsMsgViewSortType::byJunkStatus:
case nsMsgViewSortType::byAttachments:
*pFieldType = kU32;
@ -3370,13 +3357,6 @@ nsresult nsMsgDBView::GetLongField(nsIMsgDBHdr *msgHdr, nsMsgViewSortTypeValue s
case nsMsgViewSortType::byStatus:
rv = GetStatusSortValue(msgHdr,result);
break;
case nsMsgViewSortType::byLabel:
rv = msgHdr->GetLabel(result);
if(*result == 0)
// set result to be the last label id value + 1 to ensure that it will always
// be sorted last.
*result = (nsMsgViewCommandType::lastLabel - nsMsgViewCommandType::label0) + 1;
break;
case nsMsgViewSortType::byFlagged:
bits = 0;
rv = msgHdr->GetFlags(&bits);
@ -3451,16 +3431,20 @@ nsMsgDBView::GetCollationKey(nsIMsgDBHdr *msgHdr, nsMsgViewSortTypeValue sortTyp
rv = msgHdr->GetAuthorCollationKey(result, len);
break;
case nsMsgViewSortType::byAccount:
case nsMsgViewSortType::byTags:
{
nsXPIDLString accountName;
nsXPIDLString str;
nsCOMPtr <nsIMsgDatabase> dbToUse = m_db;
if (!dbToUse) // probably search view
GetDBForViewIndex(0, getter_AddRefs(dbToUse));
rv = FetchAccount(msgHdr, getter_Copies(accountName));
rv = (sortType == nsMsgViewSortType::byAccount)
? FetchAccount(msgHdr, getter_Copies(str))
: FetchTags(msgHdr, getter_Copies(str));
if (NS_SUCCEEDED(rv) && dbToUse)
rv = dbToUse->CreateCollationKey(accountName, result, len);
rv = dbToUse->CreateCollationKey(str, result, len);
}
break;
default:

View File

@ -140,24 +140,20 @@ nsHashKey *nsMsgGroupView::AllocHashKeyForHdr(nsIMsgDBHdr *msgHdr)
(void) msgHdr->GetRecipients(getter_Copies(cStringKey));
return new nsCStringKey(cStringKey.get());
case nsMsgViewSortType::byAccount:
case nsMsgViewSortType::byTags:
{
nsCOMPtr <nsIMsgDatabase> dbToUse = m_db;
if (!dbToUse) // probably search view
GetDBForViewIndex(0, getter_AddRefs(dbToUse));
rv = FetchAccount(msgHdr, getter_Copies(stringKey));
rv = (m_sortType == nsMsgViewSortType::byAccount)
? FetchAccount(msgHdr, getter_Copies(stringKey))
: FetchTags(msgHdr, getter_Copies(stringKey));
return NS_SUCCEEDED(rv) ? new nsStringKey(stringKey.get()) : nsnull;
}
break;
case nsMsgViewSortType::byLabel:
{
nsMsgLabelValue label;
msgHdr->GetLabel(&label);
return new nsPRUint32Key(label);
}
break;
case nsMsgViewSortType::byAttachments:
{
PRUint32 flags;
@ -671,10 +667,10 @@ NS_IMETHODIMP nsMsgGroupView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsA
valueText.Adopt(GetString(NS_LITERAL_STRING("messagesWithNoStatus").get()));
aValue.Assign(valueText);
break;
case nsMsgViewSortType::byLabel:
rv = FetchLabel(msgHdr, getter_Copies(valueText));
if (!valueText)
valueText.Adopt(GetString(NS_LITERAL_STRING("unlabeledMessages").get()));
case nsMsgViewSortType::byTags:
rv = FetchTags(msgHdr, getter_Copies(valueText));
if (valueText.IsEmpty())
valueText.Adopt(GetString(NS_LITERAL_STRING("untaggedMessages").get()));
aValue.Assign(valueText);
break;
case nsMsgViewSortType::byPriority: