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 649713 - Print to file should remember previously entered file name and directory
Print to file should remember previously entered file name and directory
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Printing
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2011-05-08 09:13 UTC by Vidar Braut Haarr
Modified: 2011-05-09 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vidar Braut Haarr 2011-05-08 09:13:48 UTC
When printing to file (PDF), currently it defaults to the last file name and directory you entered, but I'd like it to remember the name either per-book or per-worksheet (probably per-book), and directory per-book as well.
Comment 1 Vidar Braut Haarr 2011-05-08 22:02:53 UTC
Now that Andreas fixed bug 649711, it uses the current workbook name by default (instead of just "output.pdf"), but if you change from the default that should be noted by Gnumeric and stored in the document as metadata so that it can be restored on next print - if the file format supports it.
Comment 2 Andreas J. Guelzow 2011-05-08 23:08:14 UTC
While I agree that this is desirable, I don't see how we would find out whether the user printed to a file or to a printer. I can't see any way of querying the gtk library to determine that.

If the user change the filename but then asked to print to a printer, we cannot be sure that the filename in fact makes sense.

Saving the directory is problematic since the directory path may not be valid when the file is opened next.
Comment 3 Vidar Braut Haarr 2011-05-09 01:21:40 UTC
I have no idea about the GTK or printing internals so I can't say if it's doable or not.

If the user selects first "Print to File", fills in a file name, then changes his mind and selects a physical printer - I don't see the problem with saving whatever he entered. Whether it makes sense or not, it's what he typed in and the next time he sees it, he will remember.

About the directory, Gnumeric currently remembers the last used output folder globally - or perhaps that's done by GTK? I have no idea :) - but surely this is a common problem among any application that deals with opening files. I would suggest defaulting to the last used directory of the current workbook and if that URI no longer exists (surely GTK has a facility to test for valid URIs?), fall back to the users home folder? Or possibly use the xdg-user-dirs "Documents" folder if it exists.
Comment 4 Andreas J. Guelzow 2011-05-09 02:39:52 UTC
GTK's memory of the directory is account specific and so it is likely that the path will stay valid. A path stored in a file is likely not valid so I find is questionable why store it.

I dearly hope nobody ever tries to implement the stupid MS Windows spinoff of a "Documents" folder.
Comment 5 Andreas J. Guelzow 2011-05-09 06:58:19 UTC
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.

What may be surprising is that our print-information is worksheet (not workbook) specific, so the file URI is attached to the current sheet. Different sheets can have different URIs in the saved file.
Comment 6 Vidar Braut Haarr 2011-05-09 07:50:46 UTC
Thank you!

It may surprise you but both Ubuntu and Fedora currently ship with xdg-user-dirs that automatically fills your home folder with folders for Documents, Music, Downloads, Templates, Pictures, Videos, Public and Desktop :-P
Comment 7 Andreas J. Guelzow 2011-05-09 13:41:59 UTC
Vidar, it does not surprise me (I am using Ubuntu). At least one can delete "Documents".