fix for #172178. for servers, "Edit | Properties..." and "Properties..." folder context menu

should open account manager dialog to the selected server.
also some code cleanup.  r/sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2002-12-13 19:50:31 +00:00
Родитель cd81d6da0a
Коммит 5dc23aadf0
3 изменённых файлов: 32 добавлений и 27 удалений

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

@ -251,7 +251,7 @@ var DefaultController =
case "cmd_printSetup":
case "cmd_saveAsFile":
case "cmd_saveAsTemplate":
case "cmd_properties":
case "cmd_properties":
case "cmd_viewPageSource":
case "cmd_setFolderCharset":
case "cmd_reload":
@ -616,9 +616,9 @@ var DefaultController =
case "cmd_findPrev":
MsgFindAgain(true);
return;
case "cmd_properties":
MsgFolderProperties();
return;
case "cmd_properties":
MsgFolderProperties();
return;
case "cmd_search":
MsgSearchMessages();
return;
@ -874,32 +874,29 @@ function IsPropertiesEnabled(command)
{
try
{
var serverType;
var folderTree = GetFolderTree();
var folderResource = GetSelectedFolderResource();
serverType = GetFolderAttribute(folderTree, folderResource, "ServerType");
switch (serverType)
{
case "none":
case "imap":
case "pop3":
goSetMenuValue(command, 'valueFolder');
break;
case "nntp":
goSetMenuValue(command, 'valueNewsgroup');
break
default:
goSetMenuValue(command, 'valueGeneric');
}
// when servers are selected
// it should be "Edit | Properties..."
if (GetFolderAttribute(folderTree, folderResource, "IsServer") == "true")
goSetMenuValue(command, "valueGeneric");
else
goSetMenuValue(command, isNewsURI(folderResource.Value) ? "valueNewsgroup" : "valueFolder");
}
catch (ex)
{
//properties menu failure
// properties menu failure
}
return IsFolderSelected();
// properties should be enabled for folders and servers
// but not fake accounts
if (IsFakeAccount())
return false;
var folderTree = GetFolderTree();
var selection = folderTree.treeBoxObject.selection;
return (selection.count == 1);
}
function IsViewNavigationItemEnabled()

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

@ -250,12 +250,12 @@ function fillFolderPaneContextMenu()
var isNewsgroup = !isServer && serverType == 'nntp';
var canGetMessages = (isServer && (serverType != "nntp") && (serverType !="none")) || isNewsgroup;
EnableMenuItem("folderPaneContext-properties", !isServer);
EnableMenuItem("folderPaneContext-properties", true);
ShowMenuItem("folderPaneContext-getMessages", (numSelected <= 1) && canGetMessages);
EnableMenuItem("folderPaneContext-getMessages", true);
ShowMenuItem("folderPaneContext-openNewWindow", (numSelected <= 1) && !isServer);
EnableMenuItem("folderPaneContext-openNewWindow", (true));
EnableMenuItem("folderPaneContext-openNewWindow", true);
SetupRenameMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);
SetupRemoveMenuItem(folderResource, numSelected, isServer, serverType, specialFolder);

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

@ -179,7 +179,15 @@ function MsgCompactFolder(isAll)
function MsgFolderProperties()
{
var preselectedURI = GetSelectedFolderURI();
var serverType = GetMsgFolderFromUri(preselectedURI, true).server.type;
var msgFolder = GetMsgFolderFromUri(preselectedURI, true);
// if a server is selected, view settings for that account
if (msgFolder.isServer) {
MsgAccountManager(null);
return;
}
var serverType = msgFolder.server.type;
var folderTree = GetFolderTree();
var name = GetFolderNameFromUri(preselectedURI, folderTree);