add group by flag, enable grouping by has attachment status, 238631, sr=sspitzer

This commit is contained in:
bienvenu%nventure.com 2006-06-03 16:20:33 +00:00
Родитель 5145178324
Коммит c5ab9b71ab
6 изменённых файлов: 31 добавлений и 3 удалений

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

@ -268,7 +268,8 @@ function InitViewSortByMenu()
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.byRecipient || sortType == nsMsgViewSortType.byAccount
|| sortType == nsMsgViewSortType.byStatus);
|| sortType == nsMsgViewSortType.byStatus || sortType == nsMsgViewSortType.byFlagged
|| sortType == nsMsgViewSortType.byAttachments);
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));

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

@ -192,6 +192,10 @@ noPriority=No Priority
noAttachments=No Attachments
attachments=Attachments
#Grouped by flagged
notFlagged=Not Flagged
flagged=Flagged
# defaults for labels prefs listed in mailnews.js
mailnews.labels.description.0=None
mailnews.labels.description.1=Important

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

@ -238,7 +238,8 @@ function InitViewSortByMenu()
var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.byRecipient);
|| sortType == nsMsgViewSortType.byRecipient|| sortType == nsMsgViewSortType.byFlagged
|| sortType == nsMsgViewSortType.byAttachments);
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));

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

@ -361,7 +361,8 @@ function MsgGroupBySort()
|| sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
|| sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
|| sortType == nsMsgViewSortType.byStatus || sortType == nsMsgViewSortType.byRecipient
|| sortType == nsMsgViewSortType.byAccount);
|| sortType == nsMsgViewSortType.byAccount || sortType == nsMsgViewSortType.byFlagged
|| sortType == nsMsgViewSortType.byAttachments);
if (!dbview.supportsThreading || !sortTypeSupportsGrouping)
return; // we shouldn't be trying to group something we don't support grouping for...

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

@ -190,6 +190,14 @@ messagesWithNoStatus=No Status
#Grouped by priority
noPriority=No Priority
#Grouped by has attachments
noAttachments=No Attachments
attachments=Attachments
#Grouped by flagged
notFlagged=Not Flagged
flagged=Flagged
# defaults for labels prefs listed in mailnews.js
mailnews.labels.description.0=None
mailnews.labels.description.1=Important

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

@ -164,6 +164,12 @@ nsHashKey *nsMsgGroupView::AllocHashKeyForHdr(nsIMsgDBHdr *msgHdr)
msgHdr->GetFlags(&flags);
return new nsPRUint32Key(flags & MSG_FLAG_ATTACHMENT ? 1 : 0);
}
case nsMsgViewSortType::byFlagged:
{
PRUint32 flags;
msgHdr->GetFlags(&flags);
return new nsPRUint32Key(flags & MSG_FLAG_MARKED ? 1 : 0);
}
case nsMsgViewSortType::byPriority:
{
nsMsgPriorityValue priority;
@ -691,6 +697,13 @@ NS_IMETHODIMP nsMsgGroupView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsA
: NS_LITERAL_STRING("noAttachments").get()));
aValue.Assign(valueText);
break;
case nsMsgViewSortType::byFlagged:
valueText.Adopt(GetString(((nsPRUint32Key *)hashKey)->GetValue()
? NS_LITERAL_STRING("flagged").get()
: NS_LITERAL_STRING("notFlagged").get()));
aValue.Assign(valueText);
break;
default:
NS_ASSERTION(PR_FALSE, "we don't sort by group for this type");
break;