Closed
Bug 251754
Opened 21 years ago
Closed 21 years ago
CUPS support for Mozilla
Categories
(Core :: Printing: Output, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mkaply, Assigned: mkaply)
References
Details
(Keywords: fixed-aviary1.0, fixed1.7.5, relnote)
Attachments
(1 file, 3 obsolete files)
3.77 KB,
patch
|
pkwarren
:
review+
mkaply
:
superreview+
mkaply
:
approval-aviary+
mkaply
:
approval1.7.5+
|
Details | Diff | Splinter Review |
I'd like to add support so that Mozilla can query the list of printers through CUPS.
Eventually we'll do printer settings, but this is a good first start.
Assignee | ||
Comment 1•21 years ago
|
||
*** Bug 251755 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 2•21 years ago
|
||
OK, this is pass one.
If you have the prefs or env variable set (the old way) nothing changes.
If you don't we query from CUPS - I need to add dynamic loading of the CUPS
API.
We also query destinations, not printers explicitly - this provides support for
printer classes, not just printers.
You may wonder why we prepend "Postscript/" to every name - this is because the
print code uses that prefix to decide whether to use Postscript or XPrint - I'm
looking into this.
Comment 3•21 years ago
|
||
mkaply:
1. The functionality should live in a seperate XPCOM module to avoid that the
main gfx module depends on CUPS which isn't available on many platforms.
2. The list of destinations returns by the CUPS API must be cached. Anotherwise
it may happen that the print dialog hangs _minutes_ if the CUPS print API has to
wait for (unreachable) printer queues.
Assignee | ||
Comment 4•21 years ago
|
||
1. No, it shouldn't. I'm tired of us creating a new module for every print type
on Linux. This is vrey straightforward - CUPS wll be in the postscript code, and
it will dynload CUPS if it is there.
2. If you cache the printers, you don't get updated printers in the list when
new ones are added. Please provide me a way to recreate this scenario you are
referring to.
Comment 5•21 years ago
|
||
(In reply to comment #4)
> 1. No, it shouldn't. I'm tired of us creating a new module for every print
> type on Linux.
> This is vrey straightforward - CUPS wll be in the postscript code, and
> it will dynload CUPS if it is there.
Do you want to use dlload() ?
> 2. If you cache the printers, you don't get updated printers in the list when
> new ones are added. Please provide me a way to recreate this scenario you are
> referring to.
Simply use network printers via the lpr or JetDirect printer protocols and turn
one of the printers OFF. It may take some time until the spooler will get the
timeout and stop trying to contact it.
Assignee | ||
Comment 6•21 years ago
|
||
This patch queries CUPS stuff on the fly, so no dependencies on CUPS at all.
Assignee | ||
Updated•21 years ago
|
Attachment #153428 -
Attachment is obsolete: true
Assignee | ||
Comment 7•21 years ago
|
||
Don't NS_ERROR_FAILURE if you can't find CUPS, just go the old way.
Attachment #156332 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #156333 -
Flags: superreview?(blizzard)
Attachment #156333 -
Flags: review?(pkwarren)
Comment 8•21 years ago
|
||
Comment on attachment 156333 [details] [diff] [review]
Better patch
Patch looks fine. However, just for your information libcups.so doesn't exist
on my machine. It's called libcups.so.2.
Attachment #156333 -
Flags: superreview?(blizzard) → superreview+
Comment 9•21 years ago
|
||
Comment on attachment 156333 [details] [diff] [review]
Better patch
>- if (printerList) {
>+ if (printerList && (strlen(printerList) > 0)) {
You could also do:
if (printerList && *printerList) {
>+ CupsGetDests = (CupsGetDestsType) PR_FindSymbol( clib, "cupsGetDests");
>+ CupsGetDest = (CupsGetDestType) PR_FindSymbol( clib, "cupsGetDest");
>+ CupsFreeDests = (CupsFreeDestsType) PR_FindSymbol( clib, "cupsFreeDests");
Don't you want to check that these are valid before you reference them?
Also do you need to call PR_UnloadLibrary?
Assignee | ||
Comment 10•21 years ago
|
||
OK, use the .2 and unload the library.
I also did some reformatting to put my variables only in the scope they are
used. I like it like that.
Attachment #156333 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #156359 -
Flags: superreview+
Attachment #156359 -
Flags: review?(pkwarren)
Comment 11•21 years ago
|
||
Comment on attachment 156359 [details] [diff] [review]
An even better patch
Looks good.
Attachment #156359 -
Flags: review?(pkwarren) → review+
Assignee | ||
Updated•21 years ago
|
Attachment #156359 -
Flags: approval1.8a3?
Attachment #156359 -
Flags: approval1.7.3?
Comment 12•21 years ago
|
||
Comment on attachment 156359 [details] [diff] [review]
An even better patch
unsetting 1.8a3 approval request. we've shipped already.
Attachment #156359 -
Flags: approval1.8a3?
Assignee | ||
Updated•21 years ago
|
Attachment #156333 -
Flags: review?(pkwarren)
Assignee | ||
Updated•21 years ago
|
Attachment #156359 -
Flags: approval1.7.3?
Attachment #156359 -
Flags: approval1.7.3+
Attachment #156359 -
Flags: approval-aviary+
Assignee | ||
Comment 13•21 years ago
|
||
Fix checked in everywhere.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•21 years ago
|
Keywords: fixed-aviary1.0,
fixed1.7.3
Comment 14•21 years ago
|
||
mkaply, did you not land this on 1.7? It doesn't appear in 1.7.3
Comment 15•21 years ago
|
||
How to set the page format e.g. to A4 for all printers???
I allways see the page beeing letter, CUPS *knows* that there is
only e.g. A4 and A3 (may be others in US)
Assignee | ||
Comment 16•21 years ago
|
||
This was very basic CUPS support that did not involve querying page types from
the printer.
Comment 17•21 years ago
|
||
How to disabe CUPS
How to select PERMANENT another printer than the first one?
Assignee | ||
Comment 18•21 years ago
|
||
Why would you want to disable CUPS?
Comment 19•21 years ago
|
||
All those Linux users do not want cups, that are not using cups on their system,
e.g. lprng (that is at now me)
Or if you got a "silly" installation you do not like.
There are allways people, who want to set up this by hand.
I prefer to have the possibility to use e.g. kdeprint.
It should be enough to set it in about:config to use any external
print command with fixed page size.
So I could set up all A4 pages and use kdeprint instead of lpr...
Comment 20•21 years ago
|
||
I'm not using CUPS.
The list for printers is derivated from /etc/printcap as it looks like.
I try to print to CUPS/lp
nothing is printed.
There are remote CUPS server on our net.
I think we have to check for CUPS before using it.
Assignee | ||
Comment 21•21 years ago
|
||
There are ways to override printers using prefs.
I found this on the net:
Printers
There is no GUI for setting these up. Hints suggest setting print.printer_list
to a space separated list of printers. The following comes from my .cfg file, so
uses defaultPref, not user_pref:
defaultPref("print.print_paper_name", "A4");
defaultPref("print.printer_list", "ps2 ps psc");
defaultPref("print.printer_PostScript/ps2.print_command", "lpr -Pps2");
defaultPref("print.printer_PostScript/psc.print_command", "lpr -Ppsc");
defaultPref("print.printer_PostScript/ps.print_command", "lpr -Pps");
The heavily-qualified settings apply to a single printer, whereas the
unqualified ones apply to all printers. Many other options exist.
Comment 22•21 years ago
|
||
I do not have ANY *.cfg in the mozilla tree or in the user tree.
Putting this into user_prefs (prefs.js) did not change anything.
It is NOT visible in about:config too.
You need to log in
before you can comment on or make changes to this bug.
Description
•