Bug #237151 --> Add UI to the junk control dialog for resetting the training data

git-svn-id: svn://10.0.0.236/trunk@153921 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scott%scott-macgregor.org 2004-03-12 19:17:25 +00:00
parent 35953bed1c
commit bd8226223e
3 changed files with 33 additions and 2 deletions

View File

@ -274,3 +274,22 @@ function doHelpButton()
{
openHelp("mail-junk-controls");
}
function resetTrainingData()
{
// make sure the user really wants to do this
promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var title = gMessengerBundle.getString("confirmResetJunkTrainingTitle");
var text = gMessengerBundle.getString("confirmResetJunkTrainingText");
// if the user says no, then just fall out
if (!promptService.confirm(window, title, text))
return;
// otherwise go ahead and remove the training data
var junkmailPlugin = Components.classes["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"]
.getService(Components.interfaces.nsIJunkMailPlugin);
if (junkmailPlugin)
junkmailPlugin.resetTrainingData();
}

View File

@ -204,6 +204,14 @@
<hbox class="indent">
<checkbox id="level" oncommand="conditionallyEnableUI(null);" accesskey="&level.accesskey;" label="&level.label;"/>
</hbox>
<separator/>
<description width="1">&resetTrainingDescription.label;</description>
<separator class="thin"/>
<hbox class="indent">
<spacer flex="1"/>
<button label="&resetTrainingData.label;" accesskey="&resetTrainingData.accesskey;" oncommand="resetTrainingData()"/>
</hbox>
</vbox>
#if 0

View File

@ -4,7 +4,7 @@
<!-- Tab titles -->
<!ENTITY settingsTab.label "Settings">
<!ENTITY whiteListTab.label "White Lists">
<!ENTITY adaptiveTab.label "Adaptive Filters">
<!ENTITY adaptiveTab.label "Adaptive Filter">
<!ENTITY blackListsTab.label "Black Lists">
<!-- Settings tab -->
@ -33,11 +33,15 @@
<!-- Adaptive Filter tab -->
<!ENTITY adaptiveInfo.label "&brandShortName; can be trained to analyze the contents of your incoming messages and identify those that are most likely to be junk. This can be an extremely effective tool for detecting junk mail.">
<!ENTITY adaptiveCaption.label "Adaptive Filters">
<!ENTITY adaptiveCaption.label "Adaptive Filter">
<!ENTITY trainingWarning.label "If enabled, you must first train &brandShortName; to identify junk mail by using the Junk toolbar button to mark messages as junk or not. You need to identify both junk and non junk messages.">
<!ENTITY level.label "Enable adaptive junk mail detection">
<!ENTITY level.accesskey "E">
<!ENTITY resetTrainingDescription.label "Resetting the training data used by the adaptive filter requires you to retrain the filter">
<!ENTITY resetTrainingData.label "Reset Training Data">
<!ENTITY resetTrainingData.accesskey "R">
<!-- White List tab -->
<!ENTITY whiteListCaption.label "White Lists">
<!ENTITY whitelist.label "Do not mark messages as junk mail if the sender is in my address book:">