Port seamonkey bug:

Bug 195315 Run Junk Mail Controls on selected messages
This commit is contained in:
scott%scott-macgregor.org 2004-02-20 22:14:04 +00:00
parent 5b6ae6e571
commit 28c7bd3b77
4 changed files with 24 additions and 0 deletions

View File

@ -197,6 +197,7 @@ var DefaultController =
case "cmd_markAsFlagged":
case "cmd_markAsJunk":
case "cmd_markAsNotJunk":
case "cmd_recalculateJunkScore":
case "cmd_applyFilters":
case "cmd_runJunkControls":
case "cmd_deleteJunk":
@ -315,6 +316,7 @@ var DefaultController =
return (GetNumSelectedMessages() > 0 );
case "cmd_markAsJunk":
case "cmd_markAsNotJunk":
case "cmd_recalculateJunkScore":
// can't do news on junk yet.
return (GetNumSelectedMessages() > 0 && !isNewsURI(GetFirstSelectedMessage()));
case "cmd_applyFilters":
@ -625,6 +627,9 @@ var DefaultController =
case "cmd_markAsNotJunk":
JunkSelectedMessages(false);
return;
case "cmd_recalculateJunkScore":
analyzeMessagesForJunk();
return;
case "cmd_applyFilters":
MsgApplyFilters(null);
return;

View File

@ -249,6 +249,7 @@
<command id="cmd_markAsFlagged" oncommand="goDoCommand('cmd_markAsFlagged'); event.preventBubble()" disabled="true"/>
<command id="cmd_markAsJunk" oncommand="goDoCommand('cmd_markAsJunk'); event.preventBubble()" disabled="true"/>
<command id="cmd_markAsNotJunk" oncommand="goDoCommand('cmd_markAsNotJunk'); event.preventBubble()" disabled="true"/>
<command id="cmd_recalculateJunkScore" oncommand="goDoCommand('cmd_recalculateJunkScore');" disabled="true"/>
</commandset>
<commandset id="mailLabelMenuItems"
@ -619,6 +620,10 @@
<menuitem label="&markAsNotJunkCmd.label;"
accesskey="&markAsNotJunkCmd.accesskey;"
observes="cmd_markAsNotJunk"/>
<menuitem label="&recalculateJunkScoreCmd.label;"
accesskey="&recalculateJunkScoreCmd.accesskey;"
command="cmd_recalculateJunkScore"/>
</menupopup>
</menu>
<menuseparator/>
@ -949,6 +954,10 @@
<menuitem label="&markAsNotJunkCmd.label;"
accesskey="&markAsNotJunkCmd.accesskey;"
observes="cmd_markAsNotJunk"/>
<menuitem label="&recalculateJunkScoreCmd.label;"
accesskey="&recalculateJunkScoreCmd.accesskey;"
command="cmd_recalculateJunkScore"/>
</menupopup>
</menu>
<menuseparator id="messagePaneContext-sep-labels-2"/>
@ -1492,6 +1501,9 @@
key="key_markNotJunk"
accesskey="&markAsNotJunkCmd.accesskey;"
observes="cmd_markAsNotJunk"/>
<menuitem label="&recalculateJunkScoreCmd.label;"
accesskey="&recalculateJunkScoreCmd.accesskey;"
command="cmd_recalculateJunkScore"/>
</menupopup>
</menu>
<menuseparator/>

View File

@ -741,6 +741,7 @@ var MessageWindowController =
case "cmd_file":
case "cmd_markAsJunk":
case "cmd_markAsNotJunk":
case "cmd_recalculateJunkScore":
case "cmd_applyFilters":
case "cmd_runJunkControls":
case "cmd_deleteJunk":
@ -801,6 +802,7 @@ var MessageWindowController =
// fall through
case "cmd_markAsJunk":
case "cmd_markAsNotJunk":
case "cmd_recalculateJunkScore":
// can't do junk on news yet
return (!isNewsURI(gCurrentFolderUri));
case "cmd_reply":
@ -1005,6 +1007,9 @@ var MessageWindowController =
case "cmd_markAsNotJunk":
JunkSelectedMessages(false);
return;
case "cmd_recalculateJunkScore":
analyzeMessagesForJunk();
return;
case "cmd_label0":
gDBView.doCommand(nsMsgViewCommandType.label0);
return;

View File

@ -356,6 +356,8 @@
<!ENTITY markAsNotJunkCmd.label "As Not Junk">
<!ENTITY markAsNotJunkCmd.accesskey "N">
<!ENTITY markAsNotJunkCmd.key "j">
<!ENTITY recalculateJunkScoreCmd.label "Run Junk Mail Controls">
<!ENTITY recalculateJunkScoreCmd.accesskey "C">
<!ENTITY openMessageWindowCmd.label "Open Message">
<!ENTITY openMessageWindowCmd.accesskey "O">
<!ENTITY openMessageWindowCmd.key "o">