# HG changeset patch # User Frank-Rainer Grahl # Date 1587469859 -7200 # Parent a6dfe15e0c7ea5b86b70464a1926f6c61b3e0c7b Bug 1632126 - Part 1: Add ability to mark all folders of an account as read. r=IanN a=IanN Port Bug 317301 "Implement 'Mark all folders of account read'" diff --git a/suite/locales/en-US/chrome/mailnews/messenger.dtd b/suite/locales/en-US/chrome/mailnews/messenger.dtd --- a/suite/locales/en-US/chrome/mailnews/messenger.dtd +++ b/suite/locales/en-US/chrome/mailnews/messenger.dtd @@ -497,16 +497,18 @@ + + diff --git a/suite/mailnews/content/mailContextMenus.js b/suite/mailnews/content/mailContextMenus.js --- a/suite/mailnews/content/mailContextMenus.js +++ b/suite/mailnews/content/mailContextMenus.js @@ -250,16 +250,19 @@ function FillFolderPaneContextMenu() gMessengerBundle.getString("getMessagesFor")); else SetMenuItemLabel("folderPaneContext-getMessages", gMessengerBundle.getString("getMessages")); ShowMenuItem("folderPaneContext-getMessages", (numSelected <= 1) && canGetMessages); EnableMenuItem("folderPaneContext-getMessages", true); + ShowMenuItem("folderPaneContext-sep4", (numSelected <= 1) && isServer); + ShowMenuItem("folderPaneContext-markAllFoldersRead", (numSelected <= 1) && isServer); + ShowMenuItem("folderPaneContext-openNewWindow", (numSelected <= 1)); EnableMenuItem("folderPaneContext-openNewWindow", true); ShowMenuItem("folderPaneContext-openNewTab", (numSelected <= 1)); EnableMenuItem("folderPaneContext-openNewTab", true); SetupRenameMenuItem(folder, numSelected, isServer, serverType, specialFolder); SetupRemoveMenuItem(folder, numSelected, isServer, serverType, specialFolder); diff --git a/suite/mailnews/content/mailWindowOverlay.js b/suite/mailnews/content/mailWindowOverlay.js --- a/suite/mailnews/content/mailWindowOverlay.js +++ b/suite/mailnews/content/mailWindowOverlay.js @@ -1746,16 +1746,33 @@ function MsgFindAgain(reverse) findAgainInPage(getFindInstData(), reverse); } function MsgCanFindAgain() { return canFindAgainInPage(); } +/** + * Go through each selected server and mark all its folders read. + */ +function MsgMarkAllFoldersRead() { + const selectedFolders = GetSelectedMsgFolders(); + if (selectedFolders) { + const selectedServers = selectedFolders.filter(folder => folder.isServer); + + selectedServers.forEach(function(server) { + const folders = server.rootFolder.descendants; + for (let folder of fixIterator(folders, Ci.nsIMsgFolder)) { + folder.markAllMessagesRead(msgWindow); + } + }); + } +} + function MsgFilters(emailAddress, folder) { if (!folder) folder = GetFirstSelectedMsgFolder(); var args; if (emailAddress) { // Prefill the filterEditor with the emailAddress. diff --git a/suite/mailnews/content/mailWindowOverlay.xul b/suite/mailnews/content/mailWindowOverlay.xul --- a/suite/mailnews/content/mailWindowOverlay.xul +++ b/suite/mailnews/content/mailWindowOverlay.xul @@ -473,19 +473,24 @@ + label="&folderContextProperties.label;" + accesskey="&folderContextProperties.accesskey;" + oncommand="gFolderTreeController.editFolder();"/> + +