After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 551409 - Print dialog should include page size and orientation
Print dialog should include page size and orientation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.12.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
: 359030 427748 551357 551726 570147 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-09-08 18:45 UTC by Maxim Levitsky
Modified: 2009-08-06 08:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
add paper size combo and orientation combo to print dialog (73.61 KB, patch)
2009-06-22 13:54 UTC, Marek Kašík
none Details | Review
modified patch (working version) (117.79 KB, patch)
2009-06-24 15:20 UTC, Marek Kašík
none Details | Review
modified patch (116.46 KB, patch)
2009-07-07 15:40 UTC, Marek Kašík
none Details | Review
modified patch (117.05 KB, patch)
2009-07-08 10:28 UTC, Marek Kašík
committed Details | Review

Description Maxim Levitsky 2008-09-08 18:45:53 UTC
I suggest to add two option now present in 'page setup' to print dialog, so users won't need to open two dialogs to print.

Not only user can forget to open page setup dialog, and get wrong printout, but some applications lack page setup dialog (f-spot, inkscape), some don't save its settings (eye of gnome), making printing on non-standard paper ether hard or impossible.



Other information:
Comment 1 Maxim Levitsky 2008-09-08 18:47:17 UTC
Few additions:

After this done, page setup dialog can be depricated, and removed from most applications
Comment 2 Matthias Clasen 2008-09-11 02:29:19 UTC
A separate page setup dialog is necessary for use cases involving paginated documents, where you need some page setup information before working on the document, independent of printing.

So no, it cannot be deprecated.
Comment 3 Maxim Levitsky 2008-09-11 14:51:34 UTC
Yep, didn't thought about this, but very few applications use such thing.

So lets add a option for developers to show page setup options in print dialog, for applications that do no page layout on screen, (like eye of gnome)
Comment 4 Andreas J. Guelzow 2008-09-11 17:50:25 UTC
*** Bug 427748 has been marked as a duplicate of this bug. ***
Comment 5 Matthias Clasen 2009-04-13 01:39:17 UTC
*** Bug 551357 has been marked as a duplicate of this bug. ***
Comment 6 Matthias Clasen 2009-05-07 05:34:59 UTC
*** Bug 551726 has been marked as a duplicate of this bug. ***
Comment 7 Marek Kašík 2009-06-22 13:54:43 UTC
Created attachment 137175 [details] [review]
add paper size combo and orientation combo to print dialog

Hi,

this patch add paper size combo and orientation combo to print dialog (to Page Setup page). It is optional and depends on calling of gtk_print_operation_set_embed_page_setup_dialog().
Page layout preview is also modified, it shows dimensions of current
page setup (mm or inch - depends on locale). It also shows the name of
actual paper if page setup dialog is not embedded (paper size combo is
not visible).

Marek
Comment 8 Matthias Clasen 2009-06-22 14:17:05 UTC
I think I'd prefer embed-page-setup as property name, since we are not literally embedding the page setup dialog, just some of the page setup controls...
Comment 9 Matthias Clasen 2009-06-22 14:31:51 UTC
And there seems to be quite a bit of code duplication between the page setup dialog and the new stuff; we should get that factored out. 
Comment 11 Matthias Clasen 2009-06-22 14:37:16 UTC
Wrt to showing the paper size name in the non-embedded case, I wonder if we should simply always show the Paper size and Orientation controls, and just make them insensitive in the non-embedded case ?
Comment 12 Marek Kašík 2009-06-22 14:52:38 UTC
I wasn't sure about the name, so, there is no problem with renaming it.
The code is really duplicated, but factoring it out would need a lot of API changes (in gtkpagesetupunixdialog.h), I'll try it.
It sounds better to change only the sensitivity instead of showing/hiding those combos (I did it in similar way to Selection radio button).
Comment 13 Marek Kašík 2009-06-24 15:20:29 UTC
Created attachment 137319 [details] [review]
modified patch (working version)

Hi,

this is not final version of the patch. But I'm leaving for more than week, so you can revise the structure if you want.
There is a new class GtkCustomPaperUnixDialog which manages paper sizes.
Showing of paper name in page layout preview was replaced by changing sensitivity of paper size combo.
There is only one think I need to finish. It is getting of correct margins from printer in the custom paper dialog (it is wrong now).

Regards

Marek
Comment 14 Matthias Clasen 2009-06-28 05:07:51 UTC
Do we really want to have GtkCustomPaperUnixDialog as public api, since it is not really good for anything (other than the uses inside GTK+) ?
Comment 15 Marek Kašík 2009-07-07 15:40:54 UTC
Created attachment 137977 [details] [review]
modified patch

Hi,

this is new version of the patch. It is ready for review. I made the GtkCustomPaperUnixDialog private and the problem with margins was solved.

Marek
Comment 16 Matthias Clasen 2009-07-07 23:32:59 UTC
Patch looks good to me in general.

Can you modify the printing example in gtk-demo to embed the page setup controls ?

One question: how does one get the modified page setup back from GtkPrintOperation ? When using the page setup dialog, it is clear - you run gtk_print_operation_run_page_setup_dialog which returns the new page setup.
But with embedded page setup controls, I don't see an easy way to get it.
Comment 17 Marek Kašík 2009-07-08 10:28:48 UTC
Created attachment 138024 [details] [review]
modified patch

Modified page setup is stored as default page setup in GtkPrintOperation. So, you can get the new page setup by calling of gtk_print_operation_get_default_page_setup().
This version of the patch contains modified gtk-demo.
Comment 18 Matthias Clasen 2009-07-09 05:08:18 UTC
Looks good to go.
Comment 19 Marek Kašík 2009-07-10 09:40:46 UTC
Committed:

    Add paper size combo and orientation combo to print dialog
    
    Paper size combo and orientation combo can be added by
    gtk_print_operation_set_embed_page_setup_dialog() to GtkPrinUnixDialog
    now. This function induce calling of
    gtk_print_unix_dailog_set_embed_page_setup_dialog() after creation of
    dialog. These two functions control embed-page-setup-dialog properties
    in GtkPrintOperation and in GtkPrintUnixDialog.
    There is also new function gtk_print_unix_dialog_get_page_setup_set()
    which says whether page setup was set by user.
    Selected page setup is stored as default page setup in
    GtkPrintOperation.
    New class is added, its name is GtkCustomPaperUnixDialog. The class
    manages custom sizes. It is derived from GtkPageSetupUnixDialog's
    CustomPaperDialog structure.
    Page layout preview is modified, so, it shows dimensions of current
    page setup (mm or inch - depends on locale). It also shows the name of
    actual paper if page setup dialog is not embedded (paper size combo is
    not visible).
    gtk-demo is actualized to include this new feature.

Marek
Comment 20 Marek Kašík 2009-07-23 10:07:51 UTC
*** Bug 359030 has been marked as a duplicate of this bug. ***
Comment 21 Marek Kašík 2009-08-06 08:27:44 UTC
*** Bug 570147 has been marked as a duplicate of this bug. ***