From ab70c0401d6d07379022c1dd24f9cf977b5d0f95 Mon Sep 17 00:00:00 2001 From: "andreww%netscape.com" Date: Mon, 4 Mar 2002 01:22:18 +0000 Subject: [PATCH] bug 65995 - edit->properties should be context sensitive. r=hwaara, sr=sspitzer a=dbaron --- .../content/mail3PaneWindowCommands.js | 32 +++++++++++++++++-- .../resources/content/mailWindowOverlay.xul | 5 ++- .../base/resources/locale/en-US/messenger.dtd | 2 ++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/mailnews/base/resources/content/mail3PaneWindowCommands.js b/mailnews/base/resources/content/mail3PaneWindowCommands.js index fbdca034804..1265b5c7c0b 100644 --- a/mailnews/base/resources/content/mail3PaneWindowCommands.js +++ b/mailnews/base/resources/content/mail3PaneWindowCommands.js @@ -91,7 +91,6 @@ var FolderPaneController = } else return false; - default: return false; } @@ -424,7 +423,7 @@ var DefaultController = case "cmd_sendUnsentMsgs": return IsSendUnsentMsgsEnabled(null); case "cmd_properties": - return IsPropertiesEnabled(); + return IsPropertiesEnabled(command); case "button_getNewMessages": case "cmd_getNewMessages": case "cmd_getMsgsForAuthAccounts": @@ -875,9 +874,36 @@ function IsFolderCharsetEnabled() return IsFolderSelected(); } -function IsPropertiesEnabled() +function IsPropertiesEnabled(command) { + try + { + var serverType; + var folderOutliner = GetFolderOutliner(); + var folderResource = GetSelectedFolderResource(); + + serverType = GetFolderAttribute(folderOutliner, folderResource, "ServerType"); + + switch (serverType) + { + case "none": + case "imap": + case "pop3": + goSetMenuValue(command, 'valueFolder'); + break; + case "nntp": + goSetMenuValue(command, 'valueNewsgroup'); + break + default: + goSetMenuValue(command, 'valueGeneric'); + } + } + catch (ex) + { + //properties menu failure + } return IsFolderSelected(); + } function IsViewNavigationItemEnabled() diff --git a/mailnews/base/resources/content/mailWindowOverlay.xul b/mailnews/base/resources/content/mailWindowOverlay.xul index 8406ad8aff2..59ff96c12c9 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.xul +++ b/mailnews/base/resources/content/mailWindowOverlay.xul @@ -159,7 +159,10 @@ Rights Reserved. - + diff --git a/mailnews/base/resources/locale/en-US/messenger.dtd b/mailnews/base/resources/locale/en-US/messenger.dtd index 58e26a7b81f..589aa858c42 100644 --- a/mailnews/base/resources/locale/en-US/messenger.dtd +++ b/mailnews/base/resources/locale/en-US/messenger.dtd @@ -104,6 +104,8 @@ Rights Reserved. + +