Closed Bug 1653323 Opened 5 years ago Closed 5 years ago

Show print preview progress in content

Categories

(Toolkit :: Printing, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: mstriemer, Assigned: emmamalysz)

References

Details

(Whiteboard: [print2020_v81])

Attachments

(1 file)

A progress dialog is shown as the print preview is being rendered, this is currently a popup with a cancel button.

Since we'll have the print UI available the regular cancel can be used for cancelling.

Rather than showing the dialog we should have a placeholder spinner/progress indiciator where the preview will eventually go.

Whiteboard: [print2020_v80]
Whiteboard: [print2020_v80] → [print2020_v81]
Assignee: nobody → emalysz
Status: NEW → ASSIGNED

WIP that needs cleaning up. Introduces a new html doc that holds the "Preparing Print Preview" label and
the pending animation.
I need to find an appropriate place to put that code (TODO). Right now, pausing at the debugger statement
would show what it may look like.

jwatt just pointed me to the showPrintProgress print setting we can use to disable the dialog when the preview is being generated. This should disable the dialog for the modal but leave it for the full-screen version.

diff --git a/toolkit/actors/PrintingChild.jsm b/toolkit/actors/PrintingChild.jsm
--- a/toolkit/actors/PrintingChild.jsm
+++ b/toolkit/actors/PrintingChild.jsm
@@ -311,16 +311,22 @@ class PrintingChild extends ActorChild {
     simplifiedMode,
     changingBrowsers,
     lastUsedPrinterName
   ) {
     const { docShell } = this;
     try {
       let printSettings = this.getPrintSettings(lastUsedPrinterName);

+      // Disable the progress dialog for generating previews.
+      printSettings.showPrintProgress = !Services.prefs.getBoolPref(
+        "print.tab_modal.enabled",
+        false
+      );
+
       // If we happen to be on simplified mode, we need to set docURL in order
       // to generate header/footer content correctly, since simplified tab has
       // "about:blank" as its URI.
       if (printSettings && simplifiedMode) {
         printSettings.docURL = contentWindow.document.baseURI;
       }

       // The print preview docshell will be in a different TabGroup, so
Pushed by ncsoregi@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35842513b5f7 show print preview progress in the print preview browser when preview is being rendered. r=fluent-reviewers,flod,jaws
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Regressions: 1659099
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: