Bug 786316 - Save As Template should correctly manage multiple selections r/moa=Mnyromyr
This commit is contained in:
Родитель
928149dcfe
Коммит
e22f45982f
|
@ -263,7 +263,7 @@ var DefaultController =
|
|||
case "cmd_saveAsTemplate":
|
||||
var msgFolder = GetSelectedMsgFolders();
|
||||
var target = msgFolder[0].server.localStoreType;
|
||||
if (GetNumSelectedMessages() > 1 || target == "news")
|
||||
if (GetNumSelectedMessages() == 0 || target == "news")
|
||||
return false; // else fall thru
|
||||
case "cmd_reply":
|
||||
case "button_reply":
|
||||
|
|
|
@ -371,10 +371,20 @@ saveAsUrlListener.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function SaveAsTemplate(uri)
|
||||
function SaveAsTemplate(aUris)
|
||||
{
|
||||
if (uri)
|
||||
// For backwards compatibility check if the argument is a string and,
|
||||
// if so, convert to an array.
|
||||
if (typeof aUris == "string")
|
||||
aUris = [aUris];
|
||||
|
||||
var num = aUris.length;
|
||||
if (!num)
|
||||
return;
|
||||
|
||||
for (let i = 0; i < num; i++)
|
||||
{
|
||||
let uri = aUris[i];
|
||||
var hdr = messenger.msgHdrFromURI(uri);
|
||||
var identity = GetIdentityForHeader(hdr, Components.interfaces.nsIMsgCompType.Template);
|
||||
var templates = MailUtils.getFolderForURI(identity.stationeryFolder, false);
|
||||
|
@ -384,7 +394,7 @@ function SaveAsTemplate(uri)
|
|||
let isAsync = templates.server.protocolInfo.foldersCreatedAsync;
|
||||
templates.createStorageIfMissing(new saveAsUrlListener(uri, identity));
|
||||
if (isAsync)
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
messenger.saveAs(uri, false, identity, null);
|
||||
}
|
||||
|
|
|
@ -1522,7 +1522,7 @@ function MsgSaveAsFile()
|
|||
|
||||
function MsgSaveAsTemplate()
|
||||
{
|
||||
SaveAsTemplate(gFolderDisplay.selectedMessageUri);
|
||||
SaveAsTemplate(gFolderDisplay.selectedMessageUris);
|
||||
}
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
|
|
Загрузка…
Ссылка в новой задаче