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 517821 - Save print settings in key file
Save print settings in key file
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-21 09:08 UTC by Austin
Modified: 2008-04-06 22:50 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
1 move current printing code to new eog-print.c (13.50 KB, patch)
2008-04-03 02:40 UTC, Claudio Saavedra
committed Details | Review
2. save the page settings + infrastructure for the key file (6.11 KB, patch)
2008-04-03 21:21 UTC, Claudio Saavedra
committed Details | Review
3. Store print settings (5.25 KB, patch)
2008-04-03 22:48 UTC, Claudio Saavedra
committed Details | Review

Description Austin 2008-02-21 09:08:13 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.
Comment 1 Claudio Saavedra 2008-02-21 10:50:23 UTC
Thanks for your report. I wonder if we are still in time to implement this for 2.22.
Comment 2 Austin 2008-02-22 00:01:40 UTC
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...
Comment 3 Felix Riemann 2008-02-22 18:11:16 UTC
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).
Comment 4 Claudio Saavedra 2008-04-03 02:34:41 UTC
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.
Comment 5 Claudio Saavedra 2008-04-03 02:40:32 UTC
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.
Comment 6 Claudio Saavedra 2008-04-03 02:52:40 UTC
Actually, it returns a GtkPrintOperation.
Comment 7 Felix Riemann 2008-04-03 10:14:22 UTC
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.
Comment 8 Claudio Saavedra 2008-04-03 13:32:02 UTC
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

Comment 9 Claudio Saavedra 2008-04-03 21:21:40 UTC
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.
Comment 10 Claudio Saavedra 2008-04-03 22:48:28 UTC
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.
Comment 11 Claudio Saavedra 2008-04-05 15:21:15 UTC
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.
Comment 12 Austin 2008-04-06 22:50:05 UTC
> Thank you for your bug report.

No problem. I look forward to the release.