mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 03:00:30 +00:00
fix for #67072 - honor the hidden pref mailnews.nav_crosses_folders preference that 4.x used, to optionally prompt when someone hits 'next' to cross to a folder
sr=sspitzer
This commit is contained in:
parent
bbd8617673
commit
a28f653c79
@ -124,6 +124,15 @@ function GoNextMessage(type, startFromBeginning )
|
||||
var allServers = accountManager.allServers;
|
||||
var numServers = allServers.Count();
|
||||
|
||||
var nextMode = pref.GetIntPref("mailnews.nav_crosses_folders");
|
||||
// 0: "next" goes to the next folder, without prompting
|
||||
// 1: "next" goes to the next folder, and prompts (the default)
|
||||
// 2: "next" does nothing when there are no unread messages
|
||||
|
||||
// not crossing folders, don't find next
|
||||
if (nextMode == 2)
|
||||
done=true;
|
||||
|
||||
// todo:
|
||||
// this will search the originalFolderURI server twice
|
||||
// prevent that.
|
||||
@ -149,11 +158,24 @@ function GoNextMessage(type, startFromBeginning )
|
||||
if (nextFolderURI && (originalFolderURI != nextFolderURI)) {
|
||||
var nextFolderResource = RDF.GetResource(nextFolderURI);
|
||||
var nextFolder = nextFolderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
|
||||
var promptText = Bundle.formatStringFromName("advanceNextPrompt", [ nextFolder.name ], 1);
|
||||
if (commonDialogs.Confirm(window, promptText, promptText)) {
|
||||
|
||||
switch (nextMode) {
|
||||
|
||||
case 0:
|
||||
// do this unconditionally
|
||||
gNextMessageAfterLoad = true;
|
||||
SelectFolder(nextFolderURI);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
var promptText = Bundle.formatStringFromName("advanceNextPrompt", [ nextFolder.name ], 1);
|
||||
if (commonDialogs.Confirm(window, promptText, promptText)) {
|
||||
gNextMessageAfterLoad = true;
|
||||
SelectFolder(nextFolderURI);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dump("huh?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user