GNOME Bugzilla – Bug 517821
Save print settings in key file
Last modified: 2008-04-06 22:50:05 UTC
Under File -> Page Setup, if I select a Paper Size of A4, and select Apply, close the program, and re-open, it doesn't keep that paper setting. It would be nice, so that I don't keep sending Letter page requests to a printer and have it ask for different paper every time.
Thanks for your report. I wonder if we are still in time to implement this for 2.22.
Unsure. When's the deadline? It doesn't _sound_ overly difficult. Just store the settings where the rest of the preferences are stored. If I find time, I'll look into the source...
We shouldn't save that data in GConf. GtkPrint already provides functions to save and load it into (GKey)files which we can use. A place for the data file could be the "dot_dir" (~/.gnome2/eog).
I'll start a refactoring to move the printing code out of EogWindow, and allow saving all print settings to a key file. Updating summary and assigning to myself.
Created attachment 108518 [details] [review] 1 move current printing code to new eog-print.c This simply moves all the printing code to a eog-print.c file. This function has a public EogPrintOperation *eog_printing_operation_new (image, printsettings, pagesetup) That will return a ready to be used printing operation.
Actually, it returns a GtkPrintOperation.
Hmm, nice idea. I haven't looked over it in detail yet, but I think you can make the EogPrintData struct private to eog-print.c now as it's not used elsewhere.
Thanks Felix. I'm committing with your suggestion. 2008-04-03 Claudio Saavedra <csaavedra@gnome.org> * src/Makefile.am: Add eog-print.[ch] * src/eog-print-image-setup.h: Remove declaration of EogPrintData. * src/eog-print.c: (eog_print_draw_page), (eog_print_create_custom_widget), (eog_print_custom_widget_apply), (eog_print_end_print), (eog_print_operation_new): Move from eog-window.c * src/eog-print.h: Add prototype for eog_print_operation_new. * src/eog-window.c: (eog_window_print): Clean up. Move all printing related code out from eog-window.c to eog-print.c
Created attachment 108572 [details] [review] 2. save the page settings + infrastructure for the key file This patch shows what I have in mind for the infrastructure. I plan to add a key file for print settings, and use it for page setup, print settings, and paper size. This patch allows to save and retrieve the page setup to the file.
Created attachment 108578 [details] [review] 3. Store print settings This applies on top of the second patch, and adds support to save and restore print settings. It also simplifies the name of the macro added previously.
I committed both patches together in trunk, rev. 4518. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. 2008-04-05 Claudio Saavedra <csaavedra@gnome.org> * src/eog-print.c: (eog_print_get_key_file), (eog_print_get_page_setup), (eog_print_save_key_file), (eog_print_set_page_setup), (eog_print_get_print_settings), (eog_print_set_print_settings): New API to save/load print settings to/from a GKeyFile. * src/eog-print.h: Add headers for public API. * src/eog-window.c: (eog_window_page_setup), (eog_window_print), (eog_window_init), (eog_window_dispose): Load and save print settings to and from a GKeyFile. Fixes bug #517821.
> Thank you for your bug report. No problem. I look forward to the release.