Граф коммитов

57 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 95e40970cd Bug 1692845 - Restore read from global print settings for a few settings, including print_bgcolor and print_bgimages. r=bobowen
These were lost in bug 1667953, but I don't think print_bgimages /
print_bgcolor should be printer-specific only.

Differential Revision: https://phabricator.services.mozilla.com/D105465
2021-02-23 10:52:53 +00:00
Bob Owen 45aa80a96d Bug 1682877: Only send the RemotePrintJob to the parent in PrintData for SendShowPrintDialog. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D102463
2021-01-22 15:04:39 +00:00
Butkovits Atila 4d521226ef 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
Erik Nordin 979cf92582 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
Mark Striemer 8a4e6bf3a5 Bug 1673713 - Part 1: Serialize the numPagesPerSheet property r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95334
2020-11-30 22:46:23 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Emilio Cobos Álvarez 771dd03229 Bug 1669854 - Add a single pageRanges print setting. r=nordzilla
... which is an array of pairs of ranges, and use it instead of the
existing printRange / startPage / endPage settings.

Differential Revision: https://phabricator.services.mozilla.com/D96093
2020-11-07 16:01:57 +00:00
Jonathan Kew f2b9ae0184 Bug 1667053 - Refactor macOS print settings implementation for clarity. r=jwatt
Rather than wrapping an NSPrintInfo in nsPrintSettingsX, where we then have two
(potentially conflicting) sources of truth about various settings, we treat the
settings in the base nsPrintInfo class as authoritative, and just apply them to
a temporary NSPrintInfo when needed to interact with platform APIs.

Differential Revision: https://phabricator.services.mozilla.com/D92966
2020-10-23 11:07:21 +00:00
Bob Owen e4f458e04e Bug 1672370: Revert paper size pref validation back to checking for either being less than 100 inches. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D94341
2020-10-22 08:13:35 +00:00
Daniel Holbert 675e1e5b28 Bug 1669409: Convert the nsIPrintSettings:kEnableSelectionRB flag into a boolean, since it's the only entry in a bitfield. r=jwatt,emilio
This was the last flag that the PrintOptions bitfield was tracking.

So, this patch is effectively converting that bitfield (and its alias
"PrintOptionsBits") into a new, simpler boolean field named
"isPrintSelectionRBEnabled".

Differential Revision: https://phabricator.services.mozilla.com/D92542
2020-10-07 00:36:51 +00:00
Daniel Holbert 63230729cd Bug 1669375 part 2: Remove code that partially implemented the "print only even/odd pages" feature. r=jwatt
This code looked like it might work, but it seems to have only ever been backed
by per-printer about:config prefs.  I believe we only ever exposed UI for this
feature on Linux, via the native GTK dialog; and even there, the UI doesn't
actually seem to have done anything -- it was never wired up to the actual
implementation of even/odd page-skipping.

Differential Revision: https://phabricator.services.mozilla.com/D92528
2020-10-06 15:33:29 +00:00
Jonathan Watt c3bb0ca8ef Bug 1669370. Purge the worst/most obvious cases of corrupt/invalid printing prefs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D92520
2020-10-06 00:35:40 +00:00
Emilio Cobos Álvarez 941e868780 Bug 1668767 - Make "print selection" setting independent of page range. r=jfkthame
It conceptually is, and this will allow to have UI independent of the
page range in bug 140718.

Differential Revision: https://phabricator.services.mozilla.com/D92201
2020-10-02 13:59:48 +00:00
Bob Owen 922f287afd Bug 1668492: Stop using locale based decimals when saving printing prefs. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D92099
2020-10-01 17:55:01 +00:00
Emilio Cobos Álvarez b94fd775e1 Bug 1668406 - Fix nsIPrintSettings.showMarginGuides. r=jfkthame
So that:

 * It accounts for @page.
 * It is correctly serialized and deserialized over IPC.
 * It's nicer to use.

Depends on D92004

Differential Revision: https://phabricator.services.mozilla.com/D92005
2020-10-01 10:54:18 +00:00
Emilio Cobos Álvarez fbd95bb29e Bug 1668406 - Introduce nsIPrintSettings.honorPageRuleMargins. r=jfkthame
(Doing the obvious)

This should allow the front-end to expose it in one way or another in
bug 1661663.

Differential Revision: https://phabricator.services.mozilla.com/D92004
2020-10-01 13:18:01 +00:00
Jonathan Watt 568f31deea Bug 1668296. Remove a bunch of DEBUG_rods code. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91939
2020-09-30 15:54:30 +00:00
Jonathan Watt 1890bfffde Bug 1667265. Remove nsIPrintSettingsService.globalPrintSettings. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D91366
2020-09-30 12:25:02 +00:00
Csoregi Natalia b3bc0b7401 Backed out changeset 0028834844d2 (bug 1668210) for web platform failures on delayed_window_print.html. CLOSED TREE 2020-09-30 14:37:59 +03:00
Jonathan Watt 85b74a2951 Bug 1668210. Prevent print settings being saved to unprefixed prefs on non-Android. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91907
2020-09-30 09:36:40 +00:00
Jonathan Watt 3f30f74084 Bug 1667953 p1. Stop reading printer specific settings from global prefs. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91819
2020-09-29 18:51:35 +00:00
Jonathan Watt d5de56ef43 Bug 1667285. Make nsPrintSettingsService::_CreatePrintSettings pure virtual. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D91377
2020-09-25 09:33:14 +00:00
Jonathan Kew 7fd751e756 Bug 1665904 - Rename paperName to paperId for better clarity (platform). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D90790
2020-09-19 21:31:05 +00:00
Jonathan Kew b8b3720ae7 Bug 1665901 - Remove (Windows-specific) paperData field, as it now just duplicates the paper id. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D90686
2020-09-18 15:28:46 +00:00
Emilio Cobos Álvarez e6b821e340 Bug 968753 - Save per-printer settings on GTK. r=jwatt
I don't see any reason why this shouldn't work off-hand, there's no
gtk globals or such that fundamentally avoid sharing settings.

The PSPrinters stuff is gone so it's not needed to mess up with PS/CUPS
names.

The last used printer name stuff is now just a pref read, so there
shouldn't be sandbox violation shenanigans...

There are some restrictions on what can be set or what not (like, if you
set the paper name that may also override the paper size).

But these are problems that we have when restoring from prefs already,
so there's no reason we shouldn't do this, afaict.

Differential Revision: https://phabricator.services.mozilla.com/D90418
2020-09-16 15:31:45 +00:00
Emilio Cobos Álvarez 706ceffb4b Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-16 11:21:41 +00:00
Narcis Beleuzu 38f63aa9b6 Backed out changeset 0834b634ea07 (bug 1665125) for reftest failures. CLOSED TREE 2020-09-15 23:32:11 +03:00
Emilio Cobos Álvarez f3927b672a Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-15 16:19:20 +00:00
Bob Owen c6fa9e48a9 Bug 1663940: Ensure the unwriteable margins are populated in the print settings. r=emilio
This updates the settings with the correct paper ID as well.
It also removes the printable size fields from the Windows settings now that
unwriteable margins are being used consistently.

Differential Revision: https://phabricator.services.mozilla.com/D89911
2020-09-11 15:00:18 +00:00
Emilio Cobos Álvarez 5ed9da2bf7 Bug 1664205 - Simplify rect getters in nsIPrintSettings. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89778
2020-09-10 15:25:59 +00:00
Emilio Cobos Álvarez 2b38c4883a Bug 1661436 - Fix documentation and simplify nsIPrintSettingsService.globalPrintSettings. r=jwatt
It always returns a new print settings object, so the docs are just
wrong. At that point it is just an alias of thew newPrintSettings
attribute, so document it as such.

Differential Revision: https://phabricator.services.mozilla.com/D88399
2020-08-27 11:05:32 +00:00
Emilio Cobos Álvarez 19fd1264ab Bug 1661388 - Factor out the default print settings code. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88397
2020-08-27 10:58:19 +00:00
Emilio Cobos Álvarez 2b6c7db4e8 Bug 1657363 - Make nsIPrinterList.printers return a promise. r=jwatt
I intentionally removed the "move the default printer to the front" in
windows because that's not a guarantee that we provide in CUPS, but lmk
if you want it back.

I have zero idea about why the GlobalPrinters code was so ridiculously
complex.

Depends on D86396

Differential Revision: https://phabricator.services.mozilla.com/D86397
2020-08-09 22:05:57 +00:00
Bob Owen c4f92dc077 Bug 1653334 part 1: Remove unused isRangeSelection and isIFrameSelected. r=jwatt
These unused members are removed from nsIWebBrowserPrint and PPrintingTypes
along with their supporting functions.

Differential Revision: https://phabricator.services.mozilla.com/D85007
2020-08-03 14:23:27 +00:00
Butkovits Atila 076d3aa7ed Backed out 2 changesets (bug 1653334) for reftest failures at test-print-selection.html. CLOSED TREE
Backed out changeset 6cc6bbaa91f0 (bug 1653334)
Backed out changeset 75a5873f02a4 (bug 1653334)
2020-08-03 15:35:37 +03:00
Bob Owen d5715ceb42 Bug 1653334 part 1: Remove unused isRangeSelection and isIFrameSelected. r=jwatt
These unused members are removed from nsIWebBrowserPrint and PPrintingTypes
along with their supporting functions.

Differential Revision: https://phabricator.services.mozilla.com/D85007
2020-08-03 08:53:44 +00:00
Erik Nordin ce70595b23 Bug 1651532 - Change systemDefaultPrinter to systemDefaultPrinterName r=jwatt
The `systemDefaultPrinter` attribute in `nsIPrinterList` currently has
only one usage: to retrieve the printer's name. This patch changes the
attribute to be the name instead of the whole printer until such
funcationality is needed.

Differential Revision: https://phabricator.services.mozilla.com/D82951
2020-07-10 19:00:17 +00:00
Erik Nordin f7c0bd0aa2 Bug 1647480 - Refactor Printer Enumeration to Use nsIPrinter r=jwatt
- Add new interface for `nsIPrinter`.
- Add readonly attribute for printer name.
- Add implementation of interface: `nsPrinter`.
- Rename `nsIPrinterEnumerator` to `nsIPrinterList`.
- Refactor `nsIPrinterList` to use `nsIPrinter`.

Differential Revision: https://phabricator.services.mozilla.com/D81414
2020-07-05 19:00:43 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Jonathan Watt 974e4621b9 Bug 1641949. Removing the rest of the hacky print prefs code introduced by bug 1276717. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D77506
2020-05-29 19:07:39 +00:00
Erik Nordin 4c06dea151 Bug 1639990 - Rename defaultPrinterName to lastUsedPrinterName r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D76955
2020-05-29 17:37:01 +00:00
Hiroyuki Ikezoe 2971a5b04a Bug 1636678 - Drop unnecessary `if (kInitSaveOddEvenPages)` blocks. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D75898
2020-05-19 22:30:20 +00:00
Jonathan Watt 3199185dcc Bug 1636636. Remove old printing pref paper size fixup code. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D74714
2020-05-11 18:00:26 +00:00
Jonathan Watt ac1ef7b1a2 Bug 1636623. Remove some old DEBUG_rods_X from nsPrintSettingsService.cpp. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D74522
2020-05-09 12:34:55 +00:00
Jonathan Watt 2f4b27a303 Bug 1602125. Remove nsIPrintingPromptService.showPrintDialog's nsIWebBrowserPrint parameter and MockWebBrowserPrint. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D56249

--HG--
extra : moz-landing-system : lando
2019-12-09 09:04:29 +00:00
Gabriele Svelto 5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Gabriele Svelto 10d41866a5 Bug 1585156 - Remove useless inclusions of nsIDOMWindow.h and nsIDOMWindowUtils.h r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D47678

--HG--
extra : moz-landing-system : lando
2019-09-30 22:06:47 +00:00
Jonathan Watt 39945059b3 Bug 1552785. Remove printing related isFramesetDocument and isFramesetFrameSelected code. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D33696

--HG--
extra : rebase_source : 2e7f854a808059b4955ffaad425fe8b68263883e
2019-05-21 23:25:57 +01:00
Jonathan Watt 098392f093 Bug 1552785. Remove internal code for various frameset printing behaviors. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D33624

--HG--
extra : rebase_source : 336e87a05970895684602c9db3e5222918f861c8
extra : source : 98fbf1ed617549496036099b5aee333aa6b29925
2019-05-21 16:01:34 +01:00