Closed Bug 128142 Opened 23 years ago Closed 22 years ago

[FIX]Need way to set/save the Print Command

Categories

(Core :: Printing: Output, defect, P2)

x86
All
defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: mdeibler, Assigned: rods)

References

Details

Attachments

(1 file, 2 obsolete files)

Mozilla 0.9.8

The Print Command for the PostScript/default printer is lost
every time the browser is restarted.  The value it starts with is
"lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}" and there
is nothing in the preferences to set this value.  I can change
it, but all changes are lost when the browser is shut down.
This make printing bothersome as you have to change the Print
Command every time you start the browser.

Linux, RedHat (2.2.19-6.2.1 kernel)
sounds familiar..do we have a DUP on this ?
gisburn, this sounds like one of yours...
I also see this problem...this is a big regression! 
We need a counterpart for InitPrintSettingsFromPrinter() - a
SavePrintSettingsFromPrinter() to get this properly working. Otherwise we lack a
centralized, general place where we save the settings, hack the code somewhere
else and risking regression all the time... ;-(

For now - as a workaround the user can do this:
1. set |pref("print.postscript.print_command", "lpr
${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}");| in prefs.js to set the print
command for all printers (note that ${MOZ_PRINTER_NAME} is the printer name (if
it is != "default")).
2. set |pref("print.postscript.printer_foobar.print_command", "lpr
${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}");| in prefs.js to set the print
command for printer "foobar" only (OK, a shorter way would be
|pref("print.postscript.printer_foobar.print_command", "lpr -P foobar"|)
Status: UNCONFIRMED → NEW
Ever confirmed: true
can we fix this ASAP? thanks..
sujay wrote:
> can we fix this ASAP? thanks..

Sure, but please give use the neccesary time to fix it using the clean solution
(e.g. |SavePrintSettingsFromPrinter()|) this time, otherwise it will come back
again some day (sort of undead zombie bug =:-) ...
This is really a problem for the UNIX folks.
Status: NEW → ASSIGNED
Keywords: nsbeta1
Target Milestone: --- → mozilla1.0
can we back out the fix that caused this problem until we get a better fix?

We're gonna get flooded with DUPs on this.
Attached patch patch (obsolete) — Splinter Review
Inital patch
Summary: Need way to set/save the Print Command → [FIX]Need way to set/save the Print Command
nsbeta1+
Keywords: nsbeta1nsbeta1+
Attached patch complete patch (obsolete) — Splinter Review
This patch does the following:
1) Removes most all the unneeded data from nsPrintOptions service. All data
   should be in the PrintSettings.
2) Removed unneeded methods from PrintOptions
3) PrintOption can now read and write (most) all the data in a PrintSettings 
   object. The items not saved are those used during the printing process and
   it wouldn't make any sense to save them.
4) Adds a prefs for turning on and off the automatic saving of PrintSettings.
   If this is turned on it is almost the same as using the global PS.
5) On Linux it turns on the saving of PS prefs and turns on the global PS. 
   Meaning it will always use a single Global PS object.
6) The PrintSettings can be initialized from a generic non-printer specific 
   set of prefs. Then if a printer name is available in the PS then it tries
   to initialize itself from the printer specific prefs. This enables to define

   "back stop" prefs for picking up first. Then the printer specific prefs 
   can override those settings.
   For example, we may define in prefs that the default paper size 8.5x11, 
   then if if the "save PS prefs" is turned on, for a given printer it might
   save 8.5x16 as the size.
Attachment #72007 - Attachment is obsolete: true
Blocks: 127646
Blocks: 125824
Comment on attachment 72610 [details] [diff] [review]
complete patch

Nice... :)

r=Roland.Mainz@informatik.med.uni-giessen.de

Please file a bug to implement the Linux-specific parts for  the new features
introduced with this patch...
Attachment #72610 - Flags: review+
Blocks: 118563
The new feature is that I added the paperSizeName attr to nsIPrintSettings,
needed to get that in before 1.0 iface freeze
Comment on attachment 72610 [details] [diff] [review]
complete patch

sr=attinasi (whew!)
Attachment #72610 - Flags: superreview+
Blocks: 129639
Attached patch final patchSplinter Review
The difference between this patch and the previous patch is that I have added a
set of "flags" for inidicating which PrintSettings attrs need to be init/saved
to prefs. These are setup and used in printdialog.js Other than that, it is
pretty much the same patch.
Attachment #72610 - Attachment is obsolete: true
Comment on attachment 73863 [details] [diff] [review]
final patch

r=dcone
Attachment #73863 - Flags: review+
Comment on attachment 73863 [details] [diff] [review]
final patch

sr=attinasi - You do not need to check for the doAll case - the bits are all
filled for kInitSaveAll so the individual bit-tests will work fine.
Attachment #73863 - Flags: superreview+
I just made the small change, ready for a=
Comment on attachment 73863 [details] [diff] [review]
final patch

a=shaver for the 1.0 trunk, but _please_ test printing thoroughly (once through
each of those prefs) on the Big 3 before checking in.
Attachment #73863 - Flags: approval+
fixed
really fixed

Also earlier I checked in a bug that refered to this bug but it was Bug 128427
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Had to back oout changes
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
OS: Linux → All
This is breaking the Classic Mac builds on tinderbox.
fixed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
Mike/Roland/Boris, does this look fixed to you all ? please check it out..
try in latest build...I"ll also try...lets report back here...thanks..
I didn't hear back from anyone...can a couple of you please
help verify this? thanks!
I haven't tried any of the nightly builds, but on build 2002031312 (0.9.9) on 
all the operating systems that I've tried (Linux, NT, Win2K) the Print 
Background (colors & images) option still does not remember any values.
guys, I cannot verify this until I get some systems here configured to print on
linux...can a couple of you help verify this?
still not fixed...


I still get "lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}"
in the Print Command field in the print dialog.

it should be just "lpr"

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
sujay:
It works for me.
Steps to reproduct (without killing trees):
1. Open the Zilla
2. Go to the "File/Print..." menu
3. Printer should be "PostScript/default" (unless you do something special like
MOZILLA_POSTSCRIPT_PRINTER_LIST or using Xprint)
4. Go to the print job options dialog
5. Replace the command with "tail"
6. Print
7. Exit the browser
8. Open the Zilla
9. Go to the "File/Print..." menu
10. Go to the print job options dialog

Result:
"tail" should be the print command for this printer

Note that "lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}" is the _default_
for all printers to allow that Mozilla can set a specific printer name.

Example:
% export MOZILLA_POSTSCRIPT_PRINTER_LIST="foo bar"
% ./mozilla

will give you the printers "foo", "bar", "default" in the print dialog.
Mozilla will set the $MOZ_PRINTER_NAME _INTERNALLY_ to the name of the selected
printer - and the "lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}" will set
the -P option of "lpr" based on that info.

Where is your problem ?
Marking nsbeta1-.
Keywords: nsbeta1+nsbeta1-
Priority: -- → P2
Target Milestone: mozilla1.0 → Future
ok it works..

REOPEN if anyone is still seeing a problem..
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: