diff --git a/mozilla/mail/base/content/commandglue.js b/mozilla/mail/base/content/commandglue.js
index d74cfb7df4c..a196dc1f6be 100644
--- a/mozilla/mail/base/content/commandglue.js
+++ b/mozilla/mail/base/content/commandglue.js
@@ -650,7 +650,10 @@ function CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType
break;
case nsMsgViewType.eShowAllThreads:
default:
- dbviewContractId += "threaded";
+ if (viewFlags & nsMsgViewFlagsType.kGroupBySort)
+ dbviewContractId += "group";
+ else
+ dbviewContractId += "threaded";
break;
}
diff --git a/mozilla/mail/base/content/mailWindowOverlay.js b/mozilla/mail/base/content/mailWindowOverlay.js
index 1d3b311a40d..cbc98f72e0d 100644
--- a/mozilla/mail/base/content/mailWindowOverlay.js
+++ b/mozilla/mail/base/content/mailWindowOverlay.js
@@ -229,19 +229,29 @@ function InitViewSortByMenu()
setSortByMenuItemCheckState("sortByAttachmentsMenuitem", (sortType == nsMsgViewSortType.byAttachments));
var sortOrder = gDBView.sortOrder;
+ var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
+ || sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
+ || sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
+ || sortType == nsMsgViewSortType.byRecipient);
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));
- var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0);
+ var grouped = ((gDBView.viewFlags & nsMsgViewFlagsType.kGroupBySort) != 0);
+ var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0 && !grouped);
var sortThreadedMenuItem = document.getElementById("sortThreaded");
var sortUnthreadedMenuItem = document.getElementById("sortUnthreaded");
sortThreadedMenuItem.setAttribute("checked", threaded);
- sortUnthreadedMenuItem.setAttribute("checked", !threaded);
+ sortUnthreadedMenuItem.setAttribute("checked", !threaded && !grouped);
sortThreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
sortUnthreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
+
+ var groupBySortOrderMenuItem = document.getElementById("groupBySort");
+
+ groupBySortOrderMenuItem.setAttribute("disabled", !gDBView.supportsThreading || !sortTypeSupportsGrouping);
+ groupBySortOrderMenuItem.setAttribute("checked", grouped);
}
function InitViewMessagesMenu()
diff --git a/mozilla/mail/base/content/mailWindowOverlay.xul b/mozilla/mail/base/content/mailWindowOverlay.xul
index 46a0baac44e..37681135f42 100644
--- a/mozilla/mail/base/content/mailWindowOverlay.xul
+++ b/mozilla/mail/base/content/mailWindowOverlay.xul
@@ -1226,6 +1226,7 @@
+
diff --git a/mozilla/mail/base/skin/mailWindow1.css b/mozilla/mail/base/skin/mailWindow1.css
index 9c54c4511f5..d3810fe9524 100644
--- a/mozilla/mail/base/skin/mailWindow1.css
+++ b/mozilla/mail/base/skin/mailWindow1.css
@@ -251,6 +251,10 @@ treechildren::-moz-tree-image(unreadButtonColHeader) {
list-style-image: url("chrome://messenger/skin/icons/readmail.gif");
}
+treechildren::-moz-tree-image(unreadButtonColHeader, dummy) {
+ list-style-image: none;
+}
+
treechildren::-moz-tree-image(unreadButtonColHeader, unread) {
list-style-image: url("chrome://messenger/skin/icons/unreadmail.png");
}
@@ -277,6 +281,10 @@ treechildren::-moz-tree-image(flaggedCol) {
list-style-image: url("chrome://messenger/skin/icons/readmail.gif");
}
+treechildren::-moz-tree-image(flaggedCol, dummy) {
+ list-style-image: none;
+}
+
treechildren::-moz-tree-image(flaggedCol, flagged) {
list-style-image: url("chrome://messenger/skin/icons/flag.png");
}
@@ -298,11 +306,14 @@ treechildren::-moz-tree-image(junkStatusCol, junk) {
list-style-image: url("chrome://messenger/skin/icons/folder-junk.png");
}
+treechildren::-moz-tree-image(junkStatusCol, dummy) {
+ list-style-image: none;
+}
+
treechildren::-moz-tree-image(junkStatusCol, notjunk) {
list-style-image: url("chrome://messenger/skin/icons/readmail.gif");
padding-left: 0px;
}
-
/* ..... subject column ..... */
treechildren::-moz-tree-image(subjectCol) {
@@ -310,6 +321,10 @@ treechildren::-moz-tree-image(subjectCol) {
list-style-image: url("chrome://messenger/skin/icons/message-mail.png ");
}
+treechildren::-moz-tree-image(subjectCol, dummy) {
+ list-style-image: none;
+}
+
treechildren::-moz-tree-image(subjectCol, read) {
list-style-image: url("chrome://messenger/skin/icons/message-mail-read.png");
}
diff --git a/mozilla/mailnews/base/build/nsMsgFactory.cpp b/mozilla/mailnews/base/build/nsMsgFactory.cpp
index 6076a2f192d..3b42863f0a2 100644
--- a/mozilla/mailnews/base/build/nsMsgFactory.cpp
+++ b/mozilla/mailnews/base/build/nsMsgFactory.cpp
@@ -100,6 +100,7 @@
#include "nsMsgSpecialViews.h"
#include "nsMsgXFVirtualFolderDBView.h"
#include "nsMsgQuickSearchDBView.h"
+#include "nsMsgGroupView.h"
#include "nsMsgOfflineManager.h"
@@ -153,8 +154,9 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgThreadedDBView)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgThreadsWithUnreadDBView)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgWatchedThreadsWithUnreadDBView)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgSearchDBView)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgQuickSearchDBView)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgXFVirtualFolderDBView)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgQuickSearchDBView)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgGroupView)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgOfflineManager)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgProgress)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSpamSettings)
@@ -338,6 +340,10 @@ static const nsModuleComponentInfo gComponents[] = {
NS_MSGXFVFDBVIEW_CONTRACTID,
nsMsgXFVirtualFolderDBViewConstructor,
},
+ { "grouped view", NS_MSG_GROUPDBVIEW_CID,
+ NS_MSGGROUPDBVIEW_CONTRACTID,
+ nsMsgGroupViewConstructor,
+ },
{ "Messenger Offline Manager", NS_MSGOFFLINEMANAGER_CID,
NS_MSGOFFLINEMANAGER_CONTRACTID,
nsMsgOfflineManagerConstructor,
diff --git a/mozilla/mailnews/base/public/nsIMsgDBView.idl b/mozilla/mailnews/base/public/nsIMsgDBView.idl
index afb24bd098d..2997e04f8ba 100644
--- a/mozilla/mailnews/base/public/nsIMsgDBView.idl
+++ b/mozilla/mailnews/base/public/nsIMsgDBView.idl
@@ -45,6 +45,7 @@ interface nsIMsgDBHdr;
interface nsIMsgDBViewCommandUpdater;
interface nsIMsgDatabase;
interface nsIMsgSearchSession;
+interface nsISimpleEnumerator;
typedef long nsMsgViewNotificationCodeValue;
typedef long nsMsgViewCommandCheckStateValue;
@@ -79,6 +80,7 @@ interface nsMsgViewFlagsType
const nsMsgViewFlagsTypeValue kShowIgnored = 0x8;
const nsMsgViewFlagsTypeValue kUnreadOnly = 0x10;
const nsMsgViewFlagsTypeValue kExpandAll = 0x20;
+ const nsMsgViewFlagsTypeValue kGroupBySort = 0x40;
};
[scriptable, uuid(b2f31bca-fd18-11d4-a5be-0060b0fc04b7)]
@@ -251,6 +253,9 @@ interface nsMsgNavigationType
interface nsIMsgDBView : nsISupports
{
void open(in nsIMsgFolder folder, in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder, in nsMsgViewFlagsTypeValue viewFlags, out long count);
+ void openWithHdrs(in nsISimpleEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType,
+ in nsMsgViewSortOrderValue aSortOrder,
+ in nsMsgViewFlagsTypeValue aViewFlags, out long aCount);
void close();
void init(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
@@ -264,7 +269,7 @@ interface nsIMsgDBView : nsISupports
readonly attribute nsMsgViewTypeValue viewType;
attribute nsMsgViewFlagsTypeValue viewFlags;
- readonly attribute nsMsgViewSortTypeValue sortType;
+ attribute nsMsgViewSortTypeValue sortType;
readonly attribute nsMsgViewSortOrderValue sortOrder;
readonly attribute nsMsgKey keyForFirstSelectedMessage;
readonly attribute nsMsgViewIndex viewIndexForFirstSelectedMsg;
diff --git a/mozilla/mailnews/base/resources/content/commandglue.js b/mozilla/mailnews/base/resources/content/commandglue.js
index a1d9587c251..b69ad7bf562 100644
--- a/mozilla/mailnews/base/resources/content/commandglue.js
+++ b/mozilla/mailnews/base/resources/content/commandglue.js
@@ -666,7 +666,10 @@ function CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType
break;
case nsMsgViewType.eShowAllThreads:
default:
- dbviewContractId += "threaded";
+ if (viewFlags & nsMsgViewFlagsType.kGroupBySort)
+ dbviewContractId += "group";
+ else
+ dbviewContractId += "threaded";
break;
}
diff --git a/mozilla/mailnews/base/resources/content/mailWindowOverlay.js b/mozilla/mailnews/base/resources/content/mailWindowOverlay.js
index 8b7954efae2..f4e11c89cd4 100644
--- a/mozilla/mailnews/base/resources/content/mailWindowOverlay.js
+++ b/mozilla/mailnews/base/resources/content/mailWindowOverlay.js
@@ -210,19 +210,29 @@ function InitViewSortByMenu()
setSortByMenuItemCheckState("sortByRecipientMenuitem", (sortType == nsMsgViewSortType.byRecipient));
var sortOrder = gDBView.sortOrder;
+ var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor
+ || sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority
+ || sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel
+ || sortType == nsMsgViewSortType.byRecipient);
setSortByMenuItemCheckState("sortAscending", (sortOrder == nsMsgViewSortOrder.ascending));
setSortByMenuItemCheckState("sortDescending", (sortOrder == nsMsgViewSortOrder.descending));
- var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0);
+ var grouped = ((gDBView.viewFlags & nsMsgViewFlagsType.kGroupBySort) != 0);
+ var threaded = ((gDBView.viewFlags & nsMsgViewFlagsType.kThreadedDisplay) != 0 && !grouped);
var sortThreadedMenuItem = document.getElementById("sortThreaded");
var sortUnthreadedMenuItem = document.getElementById("sortUnthreaded");
sortThreadedMenuItem.setAttribute("checked", threaded);
- sortUnthreadedMenuItem.setAttribute("checked", !threaded);
+ sortUnthreadedMenuItem.setAttribute("checked", !threaded && !grouped);
sortThreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
sortUnthreadedMenuItem.setAttribute("disabled", !gDBView.supportsThreading);
+
+ var groupBySortOrderMenuItem = document.getElementById("groupBySort");
+
+ groupBySortOrderMenuItem.setAttribute("disabled", !gDBView.supportsThreading || !sortTypeSupportsGrouping);
+ groupBySortOrderMenuItem.setAttribute("checked", grouped);
}
function InitViewMessagesMenu()
diff --git a/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul b/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul
index 0871075e21a..9d30bbef026 100644
--- a/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul
+++ b/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul
@@ -1224,6 +1224,7 @@
+