GNOME Bugzilla – Bug 551409
Print dialog should include page size and orientation
Last modified: 2009-08-06 08:27:44 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:
Few additions: After this done, page setup dialog can be depricated, and removed from most applications
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.
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)
*** Bug 427748 has been marked as a duplicate of this bug. ***
*** Bug 551357 has been marked as a duplicate of this bug. ***
*** Bug 551726 has been marked as a duplicate of this bug. ***
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
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...
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.
Screen shots are here: http://mkasik.fedorapeople.org/screenshots/screenshot-1.png http://mkasik.fedorapeople.org/screenshots/screenshot-2.png
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 ?
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).
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
Do we really want to have GtkCustomPaperUnixDialog as public api, since it is not really good for anything (other than the uses inside GTK+) ?
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
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.
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.
Looks good to go.
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
*** Bug 359030 has been marked as a duplicate of this bug. ***
*** Bug 570147 has been marked as a duplicate of this bug. ***