Bug 1208203 - Display a 'Printing...' indicator toast when starting a print job r=sebastian

This commit is contained in:
Mark Finkle 2015-09-30 09:40:09 -04:00
Родитель b34d2af69e
Коммит 1f09adcae3
2 изменённых файлов: 8 добавлений и 0 удалений

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

@ -45,6 +45,12 @@ var PrintHelper = {
return new Promise((resolve, reject) => {
webBrowserPrint.print(printSettings, {
onStateChange: function(webProgress, request, stateFlags, status) {
// We get two STATE_START calls, one for STATE_IS_DOCUMENT and one for STATE_IS_NETWORK
if (stateFlags & Ci.nsIWebProgressListener.STATE_START && stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
// Let the user know something is happening. Generating the PDF can take some time.
NativeWindow.toast.show(Strings.browser.GetStringFromName("alertPrintjobToast"), "long");
}
// We get two STATE_STOP calls, one for STATE_IS_DOCUMENT and one for STATE_IS_NETWORK
if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP && stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
if (Components.isSuccessCode(status)) {

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

@ -38,6 +38,8 @@ alertSearchEngineAddedToast='%S' has been added as a search engine
alertSearchEngineErrorToast=Couldn't add '%S' as a search engine
alertSearchEngineDuplicateToast='%S' is already one of your search engines
alertPrintjobToast=Printing…
downloadCancelPromptTitle=Cancel Download
downloadCancelPromptMessage=Do you want to cancel this download?