1) cylon on busy
2) run button turns into stop when filtering
3) closing window while running prompts
4) no ok / cancel / help
This commit is contained in:
sspitzer%netscape.com 2002-09-14 23:28:17 +00:00
Родитель aaa1c28e67
Коммит 247e3047d9
3 изменённых файлов: 51 добавлений и 25 удалений

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

@ -49,10 +49,15 @@ var gStatusFeedback = {
}, },
stopMeteors: function() stopMeteors: function()
{ {
// change run button to be a stop button try {
gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel")); // change run button to be a stop button
gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey")); gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel"));
gStatusBar.setAttribute("mode", "normal"); gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey"));
gStatusBar.setAttribute("mode", "normal");
}
catch (ex) {
// can get here if closing window when running filters
}
}, },
showProgress: function(percentage) showProgress: function(percentage)
{ {
@ -60,11 +65,6 @@ var gStatusFeedback = {
}, },
closeWindow: function() closeWindow: function()
{ {
// if we are running, and the user closes the window, stop.
// XXX todo, prompt first, though.
if (gRunFiltersButton.getAttribute("label") == gRunFiltersButton.getAttribute("stoplabel")) {
gFilterListMsgWindow.StopUrls();
}
} }
}; };
@ -108,14 +108,7 @@ function onLoad()
} }
} }
function onOk() /*
{
// make sure to save the filter to disk
var filterList = currentFilterList();
if (filterList) filterList.saveToDefaultFile();
window.close();
}
function onCancel() function onCancel()
{ {
var firstItem = getSelectedServerForFilters(); var firstItem = getSelectedServerForFilters();
@ -144,6 +137,7 @@ function onCancel()
} }
window.close(); window.close();
} }
*/
function onServerClick(event) function onServerClick(event)
{ {
@ -293,6 +287,37 @@ function viewLog()
window.openDialog("chrome://messenger/content/viewLog.xul", "FilterLog", "chrome,modal,titlebar,resizable,centerscreen", args); window.openDialog("chrome://messenger/content/viewLog.xul", "FilterLog", "chrome,modal,titlebar,resizable,centerscreen", args);
} }
function onFilterClose()
{
// make sure to save the filter to disk
var filterList = currentFilterList();
if (filterList)
filterList.saveToDefaultFile();
var nsIPromptService = Components.interfaces.nsIPromptService;
if (gRunFiltersButton.getAttribute("label") == gRunFiltersButton.getAttribute("stoplabel")) {
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var promptTitle = gFilterBundle.getString("promptTitle");
var promptMsg = gFilterBundle.getString("promptMsg");;
var stopButtonLabel = gFilterBundle.getString("stopButtonLabel");
var continueButtonLabel = gFilterBundle.getString("continueButtonLabel");
var result = promptService.confirmEx(window, promptTitle, promptMsg,
(promptService.BUTTON_TITLE_IS_STRING*promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_IS_STRING*promptService.BUTTON_POS_1),
continueButtonLabel, stopButtonLabel, null, null, {value:0});
if (result)
gFilterListMsgWindow.StopUrls();
else
return false;
}
window.close();
return true;
}
function runSelectedFilters() function runSelectedFilters()
{ {
// if run button has "stop" label, do stop. // if run button has "stop" label, do stop.

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

@ -28,15 +28,12 @@ Contributor(s): Hkan Waara <hwaara@chello.se>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/FilterListDialog.dtd"> <!DOCTYPE window SYSTEM "chrome://messenger/locale/FilterListDialog.dtd">
<dialog id="filterListDialog" <window id="filterListDialog"
xmlns:nc="http://home.netscape.com/NC-rdf#" xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
windowtype="mailnews:filterlist" windowtype="mailnews:filterlist"
buttons="accept,cancel,help"
onload="onLoad();" onload="onLoad();"
ondialogaccept="return onOk();" onclose="return onFilterClose();"
ondialogcancel="return onCancel();"
ondialoghelp="return doHelpButton();"
persist="width height screenX screenY" persist="width height screenX screenY"
title="&window.title;"> title="&window.title;">
@ -172,10 +169,10 @@ Contributor(s): Hkan Waara <hwaara@chello.se>
<separator/> <separator/>
<hbox id="statusContainerBox"> <hbox id="statusContainerBox" align="center">
<spacer flex="1"/>
<label id="statusText" crop="right" flex="1"/> <label id="statusText" crop="right" flex="1"/>
<progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/> <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/>
</hbox> </hbox>
</window>
</dialog>

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

@ -11,3 +11,7 @@ customHeaderOverflow=You've exceeded the limit of 50 custom headers. Please remo
filterCustomHeaderOverflow=Your filters have exceeded the limit of 50 custom headers. Please edit the rules.dat file, which contains your filters, to use fewer custom headers. filterCustomHeaderOverflow=Your filters have exceeded the limit of 50 custom headers. Please edit the rules.dat file, which contains your filters, to use fewer custom headers.
invalidCustomHeader=One of your filters uses a custom header that contains an invalid character, such as ':', a non-printable character, a non-ascii character, or an eight-bit ascii character. Please edit the rules.dat file, which contains your filters, to remove invalid characters from your custom headers. invalidCustomHeader=One of your filters uses a custom header that contains an invalid character, such as ':', a non-printable character, a non-ascii character, or an eight-bit ascii character. Please edit the rules.dat file, which contains your filters, to remove invalid characters from your custom headers.
continueFilterExecution=Applying filter %S failed. Would you like to continue applying filters? continueFilterExecution=Applying filter %S failed. Would you like to continue applying filters?
promptTitle=Running Filters
promptMsg=You are currently in the process of filtering messages.\nWould you like to continue applying filters?
stopButtonLabel=Stop
continueButtonLabel=Continue