Commit Graph

223 Commits

Author SHA1 Message Date
Geoff Lankow
3ecdc2bcdb Bug 1711805 - Extract uses of gBrowser in PrintUtils in a way that can be easily overridden. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D115433
2021-05-19 10:45:01 +00:00
Emilio Cobos Álvarez
98bf673289 Bug 1705348 - printToFile should only be true for the PDF printer. r=emalysz
There are users with broken prefs (old bugs that are fixed perhaps?),
but anyhow there's no sensible reason to set printToFile to true for
users printing from the print dialog.

We were working around it for the PDF printer but there's no reason we
shouldn't do it for other printers.

Differential Revision: https://phabricator.services.mozilla.com/D113821
2021-05-06 12:02:18 +00:00
Emma Malysz
8226b79c1a Bug 1675965, do not store file name in preference value for save to pdf printers r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D113413
2021-04-29 17:42:54 +00:00
Emilio Cobos Álvarez
f5d2db9ea9 Bug 1705757 - Fix my previous patch, d'oh.
MANUAL PUSH: Minor fixup in a CLOSED TREE
2021-04-17 22:35:45 +02:00
Emilio Cobos Álvarez
009ed37d0e Bug 1705757 - Restore _doPrint to fix mochitest which replaces it.
MANUAL PUSH: orange fix CLOSED TREE
2021-04-17 21:58:53 +02:00
Emilio Cobos Álvarez
a35c7babe5 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
We were using the top BrowsingContextGroup id in this case, which is
obviously wrong. Also make the API take a BrowsingContext directly,
rather than passing outerwindowids around.

Differential Revision: https://phabricator.services.mozilla.com/D112413
2021-04-17 18:41:11 +00:00
Emilio Cobos Álvarez
0e55bca38f Bug 1705757 - Move FrameLoader.print to BrowsingContext.print. r=nika,remote-protocol-reviewers,marionette-reviewers,extension-reviewers,zombie
This makes it trivial to choose the right BrowserParent to print a
browsing context, by removing the OuterWindowID / FrameLoader
indirections.

Differential Revision: https://phabricator.services.mozilla.com/D112412
2021-04-17 18:41:11 +00:00
Sam Foster
ba63a81a83 Bug 1682162 - Use the paperSizeUnit to display and handle mm/inch custom margin values. r=emalysz,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D104291
2021-03-13 00:27:53 +00:00
Tom Schuster
b1fdd19f81 Bug 1695622 - Gracefully handle missing paper when trying to getMarginPresets. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D107708
2021-03-12 17:53:55 +00:00
Tom Schuster
d8a55b8332 Bug 1694844 - In nsPrinterListCUPS::SystemDefaultPrinterName return NS_OK even without working CUPS. r=emilio
The other nsPrinterListCUPS methods already handle !InitOkay() without returning an error or rejecting
the promise.

Differential Revision: https://phabricator.services.mozilla.com/D107210
2021-03-04 16:03:30 +00:00
Emma Malysz
5493e49179 Bug 1669732, add error message for invalid number of copies r=mstriemer,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D103385
2021-02-18 16:23:54 +00:00
Erik Nordin
19442ae4bc Bug 1692316 - Part 1: Update Platform Duplex Print Terminology r=dholbert
This patch updates the terminology used by the print platform from
the formerly used terms of "side edge" and "top edge" to now using
terms of "long edge" and "short edge".

These terms more accurately describe our existing implementation
behavior, and they are congruent with many existing APIs that also
use "long edge" and "short edge" terminology.

Differential Revision: https://phabricator.services.mozilla.com/D105499
2021-02-17 23:57:26 +00:00
Emilio Cobos Álvarez
799d6c68a0 Bug 1671702 - Expose both duplex print settings from the print UI. r=sfoster,fluent-reviewers,nordzilla
We can't wait forever for icons, and exposing the functionality using a
`<select>` is trivial and can be changed later easily if we come up with
a better UI.

Differential Revision: https://phabricator.services.mozilla.com/D104616
2021-02-11 19:27:58 +00:00
Emma Malysz
d63cfba21c Bug 1688099, save more settings state in a pref and honor value on subsequent prints r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D104121
2021-02-08 22:40:37 +00:00
Erik Nordin
0722070fca Bug 1673099 - Support duplex flip styles in the print platform r=jfkthame
Changes the print platform to use uniform terminology for duplex
printing styles.

- DuplexNone
- DuplexFlipOnSideEdge
- DuplexFlipOnTopEdge

Differential Revision: https://phabricator.services.mozilla.com/D94682
2021-02-02 22:19:30 +00:00
Emma Malysz
b0e5ed5625 Bug 1678293, update progress indicator string and limit how long a user has an empty document when saving a large file r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D101854
2021-01-19 20:28:07 +00:00
Bogdan Tara
7f42bf1ac0 Backed out changeset 125c68902194 (bug 1678293) for browser_pdf_printer_settings.js failures CLOSED TREE
DONTBUILD
2021-01-19 08:56:15 +02:00
Emma Malysz
8fa3776779 Bug 1678293, update progress indicator string and limit how long a user has an empty document when saving a large file r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D101854
2021-01-19 06:14:16 +00:00
Mark Striemer
28c50e6369 Bug 1668849 - Part 2: Move base components to top of components section r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101677
2021-01-18 23:01:31 +00:00
Mark Striemer
a7894cbe31 Bug 1668849 - Part 1: Unify more print settings to PrintSettingNumber r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101676
2021-01-18 23:01:24 +00:00
Mark Striemer
b87b97f5a1 Bug 1685823 - Only re-render preview on sheet count change when needed r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101514
2021-01-15 21:43:19 +00:00
Micah Tigley
e6541ef741 Bug 1680637 - Rename TabDialogBox's manager to tabDialogManager r=marionette-reviewers,Gijs
To clarify the two separate SubDialog managers managed by TabDialogManager, this patch renames `_.dialogManager` to `._tabDialogManager`.

Depends on D100066

Differential Revision: https://phabricator.services.mozilla.com/D100955
2021-01-14 06:55:55 +00:00
Narcis Beleuzu
e55ede680d Backed out changeset 8db7af1b3397 (bug 1685823) for bc failures on browser_print_page_range.js. CLOSED TREE 2021-01-15 02:17:13 +02:00
Mark Striemer
319c070f77 Bug 1685823 - Only re-render preview on sheet count change when needed r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D101514
2021-01-14 15:38:07 +00:00
Butkovits Atila
fa285e7047 Backed out changeset f8e28ebbdaa0 (bug 1675720) for causing failures on browser_system_dialog_subdialog_hidden.js. CLOSED TREE 2021-01-13 03:00:31 +02:00
Butkovits Atila
24473dc461 Backed out 4 changesets (bug 1680637, bug 1682395) for causing Marionette failures. CLOSED TREE
Backed out changeset 073e0be7db95 (bug 1680637)
Backed out changeset 552b91b31b0f (bug 1682395)
Backed out changeset c80de6c72779 (bug 1680637)
Backed out changeset d513e228b0ad (bug 1680637)
2021-01-13 02:13:06 +02:00
Micah Tigley
6e23f8d01a Bug 1680637 - Rename TabDialogBox's manager to tabDialogManager r=marionette-reviewers,Gijs
To clarify the two separate SubDialog managers managed by TabDialogManager, this patch renames `_.dialogManager` to `._tabDialogManager`.

Depends on D100066

Differential Revision: https://phabricator.services.mozilla.com/D100955
2021-01-11 20:55:19 +00:00
Erik Nordin
d1e396df0e Bug 1675720 - Fix print_to_filename prefs for Linux system dialog r=emilio
This patch ensures that the global print_to_filename pref is checked
when initializing print settings from prefs.

It also fixes a regression which was preventing the Linux system dialog
from correctly reading its printer-specific print_to_filename prefs.

Differential Revision: https://phabricator.services.mozilla.com/D98975
2021-01-12 22:08:21 +00:00
Bogdan Tara
b79b69550f Backed out 3 changesets (bug 1680637, bug 1682395) for browser/base/content/* failures CLOSED TREE
Backed out changeset 270e2e3183de (bug 1682395)
Backed out changeset e3566f596187 (bug 1680637)
Backed out changeset 66563136c84e (bug 1680637)
2021-01-11 21:36:20 +02:00
Micah Tigley
294f4945cf Bug 1680637 - Rename TabDialogBox's manager to tabDialogManager r=marionette-reviewers,Gijs
To clarify the two separate SubDialog managers managed by TabDialogManager, this patch renames `_.dialogManager` to `._tabDialogManager`.

Depends on D100066

Differential Revision: https://phabricator.services.mozilla.com/D100955
2021-01-11 05:13:00 +00:00
Emma Malysz
1f4d421611 Bug 1685184, print selected frame when selecting Print Frame from context menu r=marionette-reviewers,mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D100842
2021-01-07 19:34:56 +00:00
Emilio Cobos Álvarez
fb7d4b64e3 Bug 1683831 - Print the right preview browser for selection printing. r=emalysz
We were always printing this.previewBrowser, which almost works (because
if the "print selection" setting is specified, the back-end will remove
non-selected nodes again), except in the case we print selection to
begin with and we've never rendered the regular preview.

This ensures we actually try to print what the user sees.

Differential Revision: https://phabricator.services.mozilla.com/D100329
2020-12-23 01:57:30 +00:00
Emma Malysz
52e441a4cb Bug 1682290, set max on copies input and disable form with invalid input r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D99732
2020-12-19 01:21:11 +00:00
Emma Malysz
8647c92f00 Bug 1670122: add check box in print UI to print selection only. r=mstriemer,fluent-reviewers,flod
Uses a new printing actor to determine if there was a selection within
the browsing context.

We now create two browsers, the primary browser and a selected browser,
and will use the appropriate browser depending on the settings value
for printSelectionOnly.

Differential Revision: https://phabricator.services.mozilla.com/D94467
2020-12-17 23:14:43 +00:00
Mark Striemer
3647c0b05e Bug 1679133 - Show a Printing... message and spinner when printing r=sfoster,fluent-reviewers
This hides the platform provided printing dialog which shows progress while printing.
The dialog is dated but does provide an actual 0-100% progress indicator which
unfortunately this does not replace. It also provides a "Cancel" button which
also unfortunately doesn't work and gets us into a bad state.

This provides a simple spinner and a Printing... message to replace that dialog
so that the user knows that something is still happening.

Differential Revision: https://phabricator.services.mozilla.com/D99504
2020-12-12 22:34:26 +00:00
Mark Striemer
66aedbd9fe Bug 1669725 - Hide print settings that don't apply to PDF for PDFs r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D98679
2020-12-11 20:55:46 +00:00
Mark Striemer
8fb67e8cf2 Bug 1676388 - Part 3: Disable print setting inputs while loading printer settings r=sfoster
When loading a printer's settings it can take a few seconds for physical printers. If
this happens then changes made while the settings are being fetched could be thrown
away. Disable the form while we're loading settings for a printer to avoid losing
settings changes.

Differential Revision: https://phabricator.services.mozilla.com/D99156
2020-12-10 04:34:42 +00:00
Mark Striemer
466fb4486f Bug 1676388 - Part 2: Only listen to input events in print dialog r=sfoster
This removes all the change event listeners so that all the elements listen
for just the input event. Listening to both could cause two settings change
events to be dispatched and requires writing code to ignore change events
in many components.

Differential Revision: https://phabricator.services.mozilla.com/D99136
2020-12-10 04:34:39 +00:00
Mark Striemer
89e9475076 Bug 1676388 - Part 1: Don't update to new printer settings if printer has since changed r=sfoster
When changing printers one of them could be slower than another. If you change
to a slow printer and back to an already loaded/fast printer then the slow
printer shouldn't overwrite the settings once it finally loads.

Example: Start print on PDF printer, switch to a physical printer and back to PDF. If
the physical printer had to be contacted to pull settings this operation could take
a few seconds, at which point the settings from the physical printer could overwrite
the PDF printer settings.

Differential Revision: https://phabricator.services.mozilla.com/D99135
2020-12-10 04:34:37 +00:00
Emma Malysz
ad2bbc8224 Bug 1676199, do not refresh preview for changes to copies or duplex printing r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D98980
2020-12-10 03:00:38 +00:00
Sam Foster
69e18b4ee0 Bug 1654684 - Add sheet-indicator and preview navigation to the print preview. r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D96737
2020-12-09 20:56:28 +00:00
Mihai Alexandru Michis
1bf907c941 Backed out changeset 5f2f88dae91f (bug 1669725) for causing linux bc failures in RunWatchdog.
CLOSED TREE
2020-12-09 23:44:21 +02:00
Mark Striemer
2de606025f Bug 1669725 - Hide print settings that don't apply to PDF for PDFs r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D98679
2020-12-09 20:30:04 +00:00
Csoregi Natalia
ab71c86aaf Backed out 2 changesets (bug 1654684) for browser chrome failures with .printPreviewCurrentPageNumber. CLOSED TREE
Backed out changeset 2fdc1b5569e1 (bug 1654684)
Backed out changeset 8ae1d037aa9c (bug 1654684)
2020-12-09 16:11:42 +02:00
Sam Foster
b39650600d Bug 1654684 - Add sheet-indicator and preview navigation to the print preview. r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D96737
2020-12-09 02:59:26 +00:00
Mark Striemer
f217fd8692 Bug 1681226 - Reduce print dialog interaction delay in automation r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D99108
2020-12-08 15:57:01 +00:00
Emma Malysz
0d5f044762 Bug 499640: add frontend support for non-contiguous page ranges r=mstriemer,fluent-reviewers
A comma will separate the list of ranges, and a dash indicates a page range.
If the print preview returns an empty page, we send an update event
to display all pages and invalidate the form.

This patch also changes how we create deferred tasks and instead has the
PrintEventHandler create them. Depending on the type of setting changed,
the PrintEventHandler either immediately handles the event or arms the
delayed settings change task. If the input is invalid, we cancel the settings
change and disarm the task. We finalize any pending tasks when the user prints
and recreate them in case the print was "unsuccessful," meaning the form
is now invalid or the user cnacelled saving as a pdf.

Differential Revision: https://phabricator.services.mozilla.com/D95222
2020-12-07 21:19:16 +00:00
Brindusan Cristian
76c9db8ae8 Backed out 2 changesets (bug 1654684) for bc failures at browser_ext_tabs_printPreview. CLOSED TREE
Backed out changeset 5a0333ca8a19 (bug 1654684)
Backed out changeset 87d06a4d6ab6 (bug 1654684)
2020-12-07 12:59:10 +02:00
Sam Foster
9528af8e33 Bug 1654684 - Add sheet-indicator and preview navigation to the print preview. r=mstriemer,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D96737
2020-12-07 08:44:14 +00:00
Emma Malysz
bb87196476 Bug 1674106, delete custom margins from userChangedSettings when updating an invalid margin after a paper size switch r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D98224
2020-12-02 16:58:23 +00:00