Bug 512828 - add a cmd_viewAllHeader and cmd_viewNormalHeader to the MessageWindowController. r=mkmelin

This commit is contained in:
herb@leo.org 2009-09-07 21:26:00 +03:00
Родитель f5f16d1262
Коммит 94c1a3448f
4 изменённых файлов: 31 добавлений и 27 удалений

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

@ -233,6 +233,8 @@ var DefaultController =
case "cmd_fullZoomEnlarge":
case "cmd_fullZoomReset":
case "cmd_fullZoomToggle":
case "cmd_viewAllHeader":
case "cmd_viewNormalHeader":
return true;
case "cmd_downloadFlagged":
case "cmd_downloadSelected":
@ -347,6 +349,8 @@ var DefaultController =
return gFolderDisplay.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody);
return false;
case "cmd_printSetup":
case "cmd_viewAllHeader":
case "cmd_viewNormalHeader":
return true;
case "cmd_markAsFlagged":
case "button_file":
@ -744,6 +748,12 @@ var DefaultController =
case "cmd_markAsFlagged":
MsgMarkAsFlagged();
return;
case "cmd_viewAllHeader":
MsgViewAllHeaders();
return;
case "cmd_viewNormalHeader":
MsgViewNormalHeaders();
return;
case "cmd_markAsJunk":
JunkSelectedMessages(true);
return;

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

@ -406,31 +406,13 @@ function initMoveToFolderAgainMenu(aMenuItem)
function InitViewHeadersMenu()
{
var headerchoice = 1;
try
{
headerchoice = pref.getIntPref("mail.show_headers");
}
catch (ex)
{
dump("failed to get the header pref\n");
}
var id = null;
switch (headerchoice)
{
case 2:
id = "viewallheaders";
break;
case 1:
default:
id = "viewnormalheaders";
break;
}
var menuitem = document.getElementById(id);
if (menuitem)
menuitem.setAttribute("checked", "true");
const nsMimeHeaderDisplayTypes = Components.interfaces.nsMimeHeaderDisplayTypes;
var headerchoice = pref.getIntPref("mail.show_headers");
document.getElementById("cmd_viewAllHeader")
.setAttribute("checked", headerchoice == nsMimeHeaderDisplayTypes.AllHeaders);
document.getElementById("cmd_viewNormalHeader")
.setAttribute("checked", headerchoice == nsMimeHeaderDisplayTypes.NormalHeaders);
document.commandDispatcher.updateCommands("create-menu-mark");
}
function InitViewBodyMenu()

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

@ -302,6 +302,8 @@
<command id="cmd_markAsJunk" oncommand="goDoCommand('cmd_markAsJunk'); event.stopPropagation()" disabled="true"/>
<command id="cmd_markAsNotJunk" oncommand="goDoCommand('cmd_markAsNotJunk'); event.stopPropagation()" disabled="true"/>
<command id="cmd_recalculateJunkScore" oncommand="goDoCommand('cmd_recalculateJunkScore');" disabled="true"/>
<command id="cmd_viewAllHeader" oncommand="goDoCommand('cmd_viewAllHeader');" disabled="true"/>
<command id="cmd_viewNormalHeader" oncommand="goDoCommand('cmd_viewNormalHeader');" disabled="true"/>
</commandset>
<commandset id="mailToolsMenuItems"
@ -1119,13 +1121,13 @@
name="viewheadergroup"
label="&headersAllCmd.label;"
accesskey="&headersAllCmd.accesskey;"
oncommand="MsgViewAllHeaders();"/>
command="cmd_viewAllHeader"/>
<menuitem id="viewnormalheaders"
type="radio"
name="viewheadergroup"
label="&headersNormalCmd.label;"
accesskey="&headersNormalCmd.accesskey;"
oncommand="MsgViewNormalHeaders();"/>
command="cmd_viewNormalHeader"/>
</menupopup>
</menu>
<menu id="viewBodyMenu" accesskey="&bodyMenu.accesskey;" label="&bodyMenu.label;">

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

@ -763,6 +763,8 @@ var MessageWindowController =
case "cmd_fullZoomEnlarge":
case "cmd_fullZoomReset":
case "cmd_fullZoomToggle":
case "cmd_viewAllHeader":
case "cmd_viewNormalHeader":
return true;
case "cmd_synchronizeOffline":
case "cmd_downloadFlagged":
@ -837,6 +839,8 @@ var MessageWindowController =
case "cmd_markAllRead":
case "cmd_markThreadAsRead":
case "cmd_markReadByDate":
case "cmd_viewAllHeader":
case "cmd_viewNormalHeader":
return(true);
case "cmd_markAsFlagged":
case "button_file":
@ -1032,6 +1036,12 @@ var MessageWindowController =
case "cmd_markReadByDate":
MsgMarkReadByDate();
return;
case "cmd_viewAllHeader":
MsgViewAllHeaders();
return;
case "cmd_viewNormalHeader":
MsgViewNormalHeaders();
return;
case "cmd_markAsFlagged":
MsgMarkAsFlagged();
return;