Bug 506510 - Disable filters menu item when no accounts are set up; r=mnyromyr sr=neil

This commit is contained in:
Jens Hatlak 2009-08-04 17:13:08 +02:00
Родитель b0baab42c7
Коммит c4a940a828
2 изменённых файлов: 12 добавлений и 1 удалений

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

@ -228,6 +228,7 @@ var DefaultController =
case "cmd_recalculateJunkScore":
case "cmd_markAsShowRemote":
case "cmd_markAsNotPhish":
case "cmd_displayMsgFilters":
case "cmd_applyFiltersToSelection":
case "cmd_applyFilters":
case "cmd_runJunkControls":
@ -365,6 +366,10 @@ var DefaultController =
return (GetNumSelectedMessages() > 0 && checkMsgHdrPropertyIsNot("remoteContentPolicy", kAllowRemoteContent));
case "cmd_markAsNotPhish":
return (GetNumSelectedMessages() > 0 && checkMsgHdrPropertyIsNot("notAPhishMessage", kNotAPhishMessage));
case "cmd_displayMsgFilters":
let mgr = Components.classes["@mozilla.org/messenger/account-manager;1"]
.getService(Components.interfaces.nsIMsgAccountManager);
return mgr.accounts.Count() > 0;
case "cmd_applyFilters":
if (gDBView)
gDBView.getCommandStatus(nsMsgViewCommandType.applyFilters, enabled, checkStatus);
@ -685,6 +690,9 @@ var DefaultController =
case "cmd_markAsNotPhish":
MsgIsNotAScam();
return;
case "cmd_displayMsgFilters":
MsgFilters(null, null);
return;
case "cmd_applyFiltersToSelection":
MsgApplyFiltersToSelection();
return;

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

@ -309,6 +309,9 @@
commandupdater="true"
events="create-menu-tasks"
oncommandupdate="goUpdateMailMenuItems(this)">
<command id="cmd_displayMsgFilters"
disabled="true"
oncommand="goDoCommand('cmd_displayMsgFilters');"/>
<command id="cmd_applyFilters" oncommand="goDoCommand('cmd_applyFilters');" disabled="true"/>
<command id="cmd_applyFiltersToSelection"
oncommand="goDoCommand('cmd_applyFiltersToSelection');"
@ -1825,7 +1828,7 @@
<menuitem id="menu_Filters"
label="&filtersCmd.label;"
accesskey="&filtersCmd.accesskey;"
oncommand="MsgFilters(null, null);"/>
command="cmd_displayMsgFilters"/>
<menuitem id="applyFilters"
label="&filtersApply.label;"
accesskey="&filtersApply.accesskey;"