quote message should be disabled when no message selected

b=144748 r=ducarroz@netscape.com sr=bienvenu@netscape.com
This commit is contained in:
pete.zha%sun.com 2002-11-20 03:44:46 +00:00
Родитель 0b4b29c7c0
Коммит e7bf2cef05
2 изменённых файлов: 20 добавлений и 8 удалений

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

@ -534,10 +534,10 @@ var defaultController =
case "cmd_outputFormat":
return composeHTML;
case "cmd_quoteMessage":
try {
gMailSession.topmostMsgWindow;
var selectedURIs = GetSelectedMessages();
if (selectedURIs && selectedURIs.length > 0)
return true;
} catch (ex) { return false; }
return false;
//Format Menu
case "cmd_decreaseFont":
@ -654,18 +654,25 @@ var defaultController =
}
function QuoteSelectedMessage()
{
var selectedURIs = GetSelectedMessages();
if (selectedURIs)
for (i = 0; i < selectedURIs.length; i++)
gMsgCompose.quoteMessage(selectedURIs[i]);
}
function GetSelectedMessages()
{
if (gMsgCompose) {
var mailWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService()
.QueryInterface(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("mail:3pane");
if (mailWindow) {
var selectedURIs = mailWindow.GetSelectedMessages();
if (selectedURIs)
for (i = 0; i < selectedURIs.length; i++)
gMsgCompose.quoteMessage(selectedURIs[i]);
return mailWindow.GetSelectedMessages();
}
}
return null;
}
function SetupCommandUpdateHandlers()
@ -735,6 +742,11 @@ function updateEditItems() {
goUpdateCommand("cmd_findNext");
}
function updateOptionItems()
{
goUpdateCommand("cmd_quoteMessage");
}
var messageComposeOfflineObserver = {
observe: function(subject, topic, state) {
// sanity checks

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

@ -295,7 +295,7 @@
</menu>
<menu id="optionsMenu" label="&optionsMenu.label;" accesskey="&optionsMenu.accesskey;">
<menupopup id="optionsMenuPopup">
<menupopup id="optionsMenuPopup" onpopupshowing="updateOptionItems();">
<menuitem label="&selectAddressCmd.label;" accesskey="&selectAddressCmd.accesskey;" command="cmd_selectAddress"/>
<menuitem label="&checkSpellingCmd.label;" id="menu_checkspelling" accesskey="&checkSpellingCmd.accesskey;" key="key_checkspelling" command="cmd_spelling"/>
<menuitem label="&quoteCmd.label;" accesskey="&quoteCmd.accesskey;" command="cmd_quoteMessage"/>