GNOME Bugzilla – Bug 649713
Print to file should remember previously entered file name and directory
Last modified: 2011-05-09 13:41:59 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.
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.
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.
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.
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.
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.
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
Vidar, it does not surprise me (I am using Ubuntu). At least one can delete "Documents".