зеркало из https://github.com/mozilla/pjs.git
bug 205054 - need descriptive text dialog to come up for user's first junk mail action. r/sr/a=sspitzer
This commit is contained in:
Родитель
2f5707d364
Коммит
61b428b8b4
|
@ -482,6 +482,7 @@ function analyze(aMsgHdr, aNextFunction)
|
|||
|
||||
function analyzeFolderForJunk()
|
||||
{
|
||||
MsgJunkMailInfo(true);
|
||||
var view = GetDBView();
|
||||
|
||||
// need to expand all threads, so we analyze everything
|
||||
|
@ -531,12 +532,14 @@ function analyzeMessages(messages)
|
|||
|
||||
function JunkSelectedMessages(setAsJunk)
|
||||
{
|
||||
MsgJunkMailInfo(true);
|
||||
gDBView.doCommand(setAsJunk ? nsMsgViewCommandType.junk
|
||||
: nsMsgViewCommandType.unjunk);
|
||||
}
|
||||
|
||||
function deleteJunkInFolder()
|
||||
{
|
||||
MsgJunkMailInfo(true);
|
||||
var view = GetDBView();
|
||||
|
||||
// need to expand all threads, so we find everything
|
||||
|
|
|
@ -1276,6 +1276,7 @@ function CloseMailWindow()
|
|||
|
||||
function MsgJunk()
|
||||
{
|
||||
MsgJunkMailInfo(true);
|
||||
JunkSelectedMessages(!SelectedMessagesAreJunk());
|
||||
}
|
||||
|
||||
|
@ -2152,6 +2153,7 @@ function MsgSearchMessages()
|
|||
|
||||
function MsgJunkMail()
|
||||
{
|
||||
MsgJunkMailInfo(true);
|
||||
var preselectedFolder = null;
|
||||
if ("GetFirstSelectedMsgFolder" in window)
|
||||
preselectedFolder = GetFirstSelectedMsgFolder();
|
||||
|
@ -2160,14 +2162,27 @@ function MsgJunkMail()
|
|||
OpenOrFocusWindow(args, "mailnews:junk", "chrome://messenger/content/junkMail.xul");
|
||||
}
|
||||
|
||||
function MsgJunkMailInfo()
|
||||
function MsgJunkMailInfo(aCheckFirstUse)
|
||||
{
|
||||
if (aCheckFirstUse) {
|
||||
if (!pref.getBoolPref("mailnews.ui.junk.firstuse"))
|
||||
return;
|
||||
pref.setBoolPref("mailnews.ui.junk.firstuse", false);
|
||||
|
||||
// check to see if this is an existing profile where the user has started using
|
||||
// the junk mail feature already
|
||||
var junkmailPlugin = Components.classes["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"]
|
||||
.getService(Components.interfaces.nsIJunkMailPlugin);
|
||||
if (junkmailPlugin.userHasClassified)
|
||||
return;
|
||||
}
|
||||
|
||||
var desiredWindow = GetWindowByWindowType("mailnews:junkmailinfo");
|
||||
|
||||
if (desiredWindow)
|
||||
desiredWindow.focus();
|
||||
else
|
||||
window.openDialog("chrome://messenger/content/junkMailInfo.xul", "mailnews:junkmailinfo", "centerscreen,resizeable=no,titlebar,chrome", null);
|
||||
window.openDialog("chrome://messenger/content/junkMailInfo.xul", "mailnews:junkmailinfo", "centerscreen,resizeable=no,titlebar,chrome,modal", null);
|
||||
}
|
||||
|
||||
function MsgSearchAddresses()
|
||||
|
|
|
@ -1738,7 +1738,7 @@ Rights Reserved.
|
|||
<label id="junkBarMessage" value="&junkBarMessage.label;"/>
|
||||
</hbox>
|
||||
<spacer flex="1"/>
|
||||
<button label="&junkInfoButton.label;" oncommand="MsgJunkMailInfo()" />
|
||||
<button label="&junkInfoButton.label;" oncommand="MsgJunkMailInfo(false)" />
|
||||
<button label="¬JunkButton.label;" oncommand="JunkSelectedMessages(false)" />
|
||||
</hbox>
|
||||
|
||||
|
|
|
@ -40,28 +40,33 @@ function ThreadPaneOnClick(event)
|
|||
if (t.localName == "treecol") {
|
||||
HandleColumnClick(t.id);
|
||||
}
|
||||
else if (event.detail == 2 && t.localName == "treechildren") {
|
||||
var row = new Object;
|
||||
var colID = new Object;
|
||||
var childElt = new Object;
|
||||
else if (t.localName == "treechildren") {
|
||||
var row = new Object;
|
||||
var colID = new Object;
|
||||
var childElt = new Object;
|
||||
|
||||
var tree = GetThreadTree();
|
||||
// figure out what cell the click was in
|
||||
tree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, colID, childElt);
|
||||
if (row.value == -1)
|
||||
return;
|
||||
var tree = GetThreadTree();
|
||||
// figure out what cell the click was in
|
||||
tree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, colID, childElt);
|
||||
if (row.value == -1)
|
||||
return;
|
||||
|
||||
// if the cell is in a "cycler" column
|
||||
// or if the user double clicked on the twisty,
|
||||
// don't open the message in a new window
|
||||
var col = document.getElementById(colID.value);
|
||||
if (col && col.getAttribute("cycler") != "true" && (childElt.value != "twisty")) {
|
||||
ThreadPaneDoubleClick();
|
||||
// double clicking should not toggle the open / close state of the
|
||||
// thread. this will happen if we don't prevent the event from
|
||||
// bubbling to the default handler in tree.xml
|
||||
event.preventBubble();
|
||||
}
|
||||
// if the cell is in a "cycler" column
|
||||
// or if the user double clicked on the twisty,
|
||||
// don't open the message in a new window
|
||||
var col = document.getElementById(colID.value);
|
||||
if (col) {
|
||||
if (event.detail == 2 && col.getAttribute("cycler") != "true" && (childElt.value != "twisty")) {
|
||||
ThreadPaneDoubleClick();
|
||||
// double clicking should not toggle the open / close state of the
|
||||
// thread. this will happen if we don't prevent the event from
|
||||
// bubbling to the default handler in tree.xml
|
||||
event.preventBubble();
|
||||
}
|
||||
else if (colID.value == "junkStatusCol") {
|
||||
MsgJunkMailInfo(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,4 +118,6 @@ interface nsIJunkMailPlugin : nsIMsgFilterPlugin
|
|||
in nsMsgJunkStatus aNewClassification,
|
||||
in nsIMsgWindow aMsgWindow,
|
||||
in nsIJunkMailClassificationListener aListener);
|
||||
|
||||
readonly attribute boolean userHasClassified;
|
||||
};
|
||||
|
|
|
@ -991,6 +991,13 @@ void nsBayesianFilter::readTrainingData()
|
|||
fclose(stream);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBayesianFilter::GetUserHasClassified(PRBool *aResult)
|
||||
{
|
||||
*aResult = (mGoodCount && mGoodTokens.countTokens() ||
|
||||
mBadCount && mBadTokens.countTokens());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setMessageClassification (in string aMsgURL, in long aOldClassification, in long aNewClassification); */
|
||||
NS_IMETHODIMP nsBayesianFilter::SetMessageClassification(const char *aMsgURL,
|
||||
nsMsgJunkStatus aOldClassification,
|
||||
|
|
|
@ -445,6 +445,8 @@ pref("mail.content_disposition_type", 0);
|
|||
pref("mailnews.show_send_progress", true); //Will show a progress dialog when saving or sending a message
|
||||
pref("mail.server.default.retainBy", 1);
|
||||
|
||||
pref("mailnews.ui.junk.firstuse", true);
|
||||
|
||||
// for manual upgrades of certain UI features.
|
||||
// 1 -> 2 is for the folder pane tree landing, to hide the
|
||||
// unread and total columns, see msgMail3PaneWindow.js
|
||||
|
|
|
@ -445,6 +445,8 @@ pref("mail.content_disposition_type", 0);
|
|||
pref("mailnews.show_send_progress", true); //Will show a progress dialog when saving or sending a message
|
||||
pref("mail.server.default.retainBy", 1);
|
||||
|
||||
pref("mailnews.ui.junk.firstuse", true);
|
||||
|
||||
// for manual upgrades of certain UI features.
|
||||
// 1 -> 2 is for the folder pane tree landing, to hide the
|
||||
// unread and total columns, see msgMail3PaneWindow.js
|
||||
|
|
Загрузка…
Ссылка в новой задаче