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:
scott%scott-macgregor.org 2006-07-11 18:21:51 +00:00
Родитель 235c2c9b52
Коммит 5977aac6f2
3 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -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">