Bug 1497795 - add confirmation for marking all folders as read. r=mkmelin
authoraleca <alessandro@thunderbird.net>
Mon, 11 Mar 2019 18:05:36 -0700
changeset 26096 a8263af5473c7b8e88d0f86486bb3aefa8afb9ef
parent 26095 264e469aa3dfc919d7adf5cb82a0e3ae8886197c
child 26097 5e0e1514a48354026ba52fa3b94277eea7a00ce3
push id15666
push usergeoff@darktrojan.net
push dateThu, 14 Mar 2019 22:07:07 +0000
treeherdercomm-central@a8263af5473c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1497795
Bug 1497795 - add confirmation for marking all folders as read. r=mkmelin
mail/base/content/mailWindowOverlay.js
mail/locales/en-US/chrome/messenger/messenger.properties
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -2254,16 +2254,24 @@ function MsgMarkAllRead() {
   for (let i = 0; i < folders.length; i++)
     folders[i].markAllMessagesRead(msgWindow);
 }
 
 /**
  * Go through each selected server and mark all its folders read.
  */
 function MsgMarkAllFoldersRead() {
+  const bundle = document.getElementById("bundle_messenger");
+
+  if (!Services.prompt.confirm(window,
+                               bundle.getString("confirmMarkAllFoldersReadTitle"),
+                               bundle.getString("confirmMarkAllFoldersReadMessage"))) {
+    return;
+  }
+
   const selectedFolders = gFolderTreeView.getSelectedFolders();
   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);
     }
--- a/mail/locales/en-US/chrome/messenger/messenger.properties
+++ b/mail/locales/en-US/chrome/messenger/messenger.properties
@@ -322,16 +322,20 @@ feedsAcctType=Feeds
 # LOCALIZATION NOTE(nocachedbodytitle): Do not translate "<TITLE>" or "</TITLE>" in the line below
 nocachedbodytitle=<TITLE>Go Online to View This Message</TITLE>\n
 
 # mailWindowOverlay.js
 confirmUnsubscribeTitle=Confirm Unsubscribe
 confirmUnsubscribeText=Are you sure you want to unsubscribe from %S?
 confirmUnsubscribeManyText=Are you sure you want to unsubscribe from these newsgroups?
 restoreAllTabs=Restore All Tabs
+
+confirmMarkAllFoldersReadTitle=Mark All Folders Read
+confirmMarkAllFoldersReadMessage=Are you sure you want to mark all messages in all folders of this account as read?
+
 # LOCALIZATION NOTE(junkBarMessage): %S is brand
 junkBarMessage=%S thinks this message is Junk mail.
 junkBarButton=Not Junk
 junkBarButtonKey=N
 junkBarInfoButton=Learn More
 junkBarInfoButtonKey=L
 
 # LOCALIZATION NOTE(remoteContentBarMessage): %S is brand