Bug 267427 - [printing] File -> Print... should use new PrintDialog.setPrinterData() API
Summary: [printing] File -> Print... should use new PrintDialog.setPrinterData() API
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2009-03-06 14:28 EST by Carolyn MacLeod CLA
Modified: 2010-01-25 15:19 EST (History)
2 users (show)

See Also:


Attachments
patch (1.35 KB, patch)
2009-10-26 08:04 EDT, Deepak Azad CLA
daniel_megert: review-
Details | Diff
reworked patch (1.42 KB, patch)
2009-12-16 03:52 EST, Deepak Azad CLA
daniel_megert: review-
Details | Diff
reworked patch (1.38 KB, patch)
2009-12-16 07:58 EST, Deepak Azad CLA
no flags Details | Diff
reworked patch (1.31 KB, patch)
2009-12-16 08:58 EST, Deepak Azad CLA
daniel_megert: iplog+
daniel_megert: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2009-03-06 14:28:22 EST
Please see bug 25612 for details.
Comment 1 Dani Megert CLA 2009-03-19 10:15:25 EDT
TextViewer clients need a way (API) to say whether they want the shared printer data or not. Given that API freeze has passed this needs to be shifted to 3.6.
Comment 2 Dani Megert CLA 2009-10-23 11:07:26 EDT
Actually before we do that we need the investigate and discuss:
- which preferences do want to we remember (e.g. I wouldn't keep page range 
  setting)
- do we want the settings only per session or store them so that they are
  available after workspace restart

I've seen all combinations of the above in different tools. Deepak, please do a little investigation to find out what's the most common behavior of modern applications.
Comment 3 Deepak Azad CLA 2009-10-26 05:58:24 EDT
I think the following preferences in PrinterData class should be remembered
collate
copyCount
name (printer name)
orientation
otherData (printer specific data like margins, paper size etc)
printToFile

Most applications remember these settings only for the current session. The default printer name (the only setting that is remembered across sessions) is set at the system level not at the application level.
Comment 4 Dani Megert CLA 2009-10-26 06:35:20 EDT
>The
>default printer name (the only setting that is remembered across sessions) is
>set at the system level not at the application level.
Right, but some (e.g. Firefox) even remember that (which I think is not good).

OK, please go ahead and implement the above settings.
Comment 5 Deepak Azad CLA 2009-10-26 08:04:10 EDT
Created attachment 150500 [details]
patch
Comment 6 Dani Megert CLA 2009-11-02 10:17:58 EST
The patch needs some more work:
- it's not remembered for the session but per editor
- 0 is not a valid value for setStart/EndPage(int)
- I prefer to store the correct printer data and then just use that one i.e. reset
  the corresponding values when assigning to the field
Comment 7 Deepak Azad CLA 2009-12-16 03:52:07 EST
Created attachment 154548 [details]
reworked patch
Comment 8 Dani Megert CLA 2009-12-16 04:36:04 EST
The patch needs some more work:
- we group statics together
- the "if (fgPrinterData != null)" is not needed, simply reset the values
  when setting the field as said in my previous comment
- as said before, 0 is an illegal value for start/EndPage
- after some poking I found that the copy count is also reset by most apps
  ==> please also reset the copy count
Comment 9 Deepak Azad CLA 2009-12-16 07:58:11 EST
Created attachment 154554 [details]
reworked patch

Resetting the copyCount to 1 dosent work, I have filed bug 297952 for this.
Comment 10 Deepak Azad CLA 2009-12-16 08:58:05 EST
Created attachment 154558 [details]
reworked patch
Comment 11 Deepak Azad CLA 2009-12-16 09:08:09 EST
bug 297957 filed for allowing copying of PrinterData object.
Comment 12 Dani Megert CLA 2009-12-16 09:29:58 EST
Thanks for the patch. Committed to HEAD with a FIXME comment that we need to copy the printer data.

Available in builds > N20091215-2000.
Comment 13 Dani Megert CLA 2009-12-16 09:37:26 EST
.
Comment 14 Deepak Azad CLA 2009-12-16 10:01:39 EST
Bug 297964 for the dependency on 297957.
Comment 15 Raksha Vasisht CLA 2010-01-25 15:19:16 EST
Verified for 3.6 M5 with I20100124-2000.