зеркало из https://github.com/mozilla/pjs.git
Bug #341490 --> restore the new folder context menu in the folder pane cotnext menu. sr=me. patch by teemu mannermaa
This commit is contained in:
Родитель
235c2c9b52
Коммит
5977aac6f2
|
@ -304,6 +304,7 @@ function fillFolderPaneContextMenu()
|
|||
|
||||
EnableMenuItem("folderPaneContext-properties", true);
|
||||
|
||||
SetupNewMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
|
||||
SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
|
||||
SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
|
||||
SetupCompactMenuItem(folderResource, numSelected);
|
||||
|
@ -346,6 +347,31 @@ function fillFolderPaneContextMenu()
|
|||
return(true);
|
||||
}
|
||||
|
||||
function SetupNewMenuItem(folderResource, numSelected, isServer, serverType,specialFolder)
|
||||
{
|
||||
var folderTree = GetFolderTree();
|
||||
var canCreateNew = GetFolderAttribute(folderTree, folderResource, "CanCreateSubfolders") == "true";
|
||||
var isInbox = specialFolder == "Inbox";
|
||||
var isIMAPFolder = GetFolderAttribute(folderTree, folderResource,
|
||||
"ServerType") == "imap";
|
||||
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
|
||||
var showNew = ((numSelected <=1) && (serverType != 'nntp') && canCreateNew) || isInbox;
|
||||
ShowMenuItem("folderPaneContext-new", showNew);
|
||||
|
||||
EnableMenuItem("folderPaneContext-new", !isIMAPFolder || !ioService.offline);
|
||||
|
||||
if (showNew)
|
||||
{
|
||||
if (isServer || isInbox)
|
||||
SetMenuItemLabel("folderPaneContext-new", gMessengerBundle.getString("newFolder"));
|
||||
else
|
||||
SetMenuItemLabel("folderPaneContext-new", gMessengerBundle.getString("newSubfolder"));
|
||||
}
|
||||
}
|
||||
|
||||
function SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder)
|
||||
{
|
||||
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
|
||||
|
|
|
@ -693,6 +693,10 @@
|
|||
|
||||
<menuseparator id="folderPaneContext-sep1"/>
|
||||
|
||||
<menuitem id="folderPaneContext-new"
|
||||
label="&folderContextNew.label;"
|
||||
accesskey="&folderContextNew.accesskey;"
|
||||
oncommand="MsgNewFolder(NewFolder);"/>
|
||||
<menuitem id="folderPaneContext-remove"
|
||||
label="&folderContextRemove.label;"
|
||||
accesskey="&folderContextRemove.accesskey;"
|
||||
|
|
|
@ -477,6 +477,8 @@
|
|||
<!-- Folder Pane Context Menu -->
|
||||
<!ENTITY folderContextOpenNewWindow.label "Open">
|
||||
<!ENTITY folderContextOpenNewWindow.accesskey "O">
|
||||
<!ENTITY folderContextNew.label "New Subfolder...">
|
||||
<!ENTITY folderContextNew.accesskey "N">
|
||||
<!ENTITY folderContextRename.label "Rename">
|
||||
<!ENTITY folderContextRename.accesskey "R">
|
||||
<!ENTITY folderContextRemove.label "Delete">
|
||||
|
|
Загрузка…
Ссылка в новой задаче