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 655514 - Don't set the current folder while saving/opening a file
Don't set the current folder while saving/opening a file
Status: RESOLVED WONTFIX
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks: document-centric
 
 
Reported: 2011-07-28 16:57 UTC by Akshay Gupta
Modified: 2012-07-07 15:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: Store and restore current folder when opening or saving file (10.10 KB, patch)
2012-07-06 17:18 UTC, Christian Persch
accepted-commit_now Details | Review

Description Akshay Gupta 2011-07-28 16:57:00 UTC
Updated guidelines for writing Save dialogs -

Make use of gtk_file_chooser_set_current_name() for File/Open and
gtk_file_chooser_set_filename() for File/Save As (File/Save a Copy)
Basically, gtk_file_chooser_set_current_folder() should not be used to set folders.

http://people.gnome.org/~federico/news-2011-07.html#recent-folders
Comment 1 Carlos Garcia Campos 2011-08-29 14:06:33 UTC
Fixed in git master. Thanks for reporting.
Comment 2 Christian Persch 2011-08-29 14:15:38 UTC
Does that mean one now has to a) select a folder, and b) click Save, instead of just b) click Save, when saving a copy of a document?
Comment 3 Carlos Garcia Campos 2011-08-29 14:23:20 UTC
Yes, it seems so.
Comment 4 Christian Persch 2011-10-31 21:33:24 UTC
Reopening.

Now, every time I want to save a copy of a pdf opened from the web browser, I can't just press return (after maybe adjusting the filename), but have to select the folder to save to, when I always save to the same folder (~/Dokumente). This is a clear worsening of usability; IMO this needs to be reverted.
Comment 5 Federico Mena Quintero 2011-10-31 21:59:46 UTC
The problem with saving by default to some place is that a) the default may not be correct (i.e. I store downloaded papers under ~/Documents/Articles/authors-last-name), and b) your default directory becomes a dumpster.

That said, Evince calls its command "Save a copy".  Most "Save as" commands should use gtk_file_chooser_set_filename() with the full path+basename.  For most programs (e.g. GIMP), this is so that you can write out a "foobar-modified.jpg" in the same folder as the original file.

However, Evince may be a bit different - AFAIK, PDFs are read-only (I don't know the details of PDFs with forms or things like that).  If "Save a copy" is meant to be "put this somewhere else", maybe you want to move the file instead?

(To properly file PDFs that get launched from a browser, I do the "Show in file manager" dance and move the file to its proper place...)
Comment 6 Christian Persch 2011-10-31 22:51:21 UTC
(In reply to comment #5)
> The problem with saving by default to some place is that a) the default may not
> be correct (i.e. I store downloaded papers under
> ~/Documents/Articles/authors-last-name), and b) your default directory becomes
> a dumpster.

True. But for a), setting the last folder as default save-to folder does not prevent you from choosing a *different* folder than the default; it just forces *everyone* to select *a* folder when having a default and using that may do fine, and with no time lost to locate the desired folder (at least in my case it's located in the sidebar) and select it. Also, even if you do want to create a new folder ~/Documents/Articles/last-name, defaulting to ~/Documents/Articles will still save you having to select that folder first.

> That said, Evince calls its command "Save a copy".  Most "Save as" commands
> should use gtk_file_chooser_set_filename() with the full path+basename.  For
> most programs (e.g. GIMP), this is so that you can write out a
> "foobar-modified.jpg" in the same folder as the original file.

Yes, it appears that evince's SaveAs is overloaded. First the usual "save a modified copy" e.g. when you've filled in a pdf form, and this 'downloaded pdf opened from browser' use case, which in pre-computer terms is just 'filing the paper away'.

Using the full path to the existing file by default would be useless since that's in /tmp where I definitely do not want to store it permanently :-)
 
> However, Evince may be a bit different - AFAIK, PDFs are read-only (I don't
> know the details of PDFs with forms or things like that).  If "Save a copy" is
> meant to be "put this somewhere else", maybe you want to move the file instead?

Yes, a move from /tmp to its destination would suffice instead of a copy, but /tmp is getting cleaned up periodically anyway.

> (To properly file PDFs that get launched from a browser, I do the "Show in file
> manager" dance and move the file to its proper place...)

Now that's even more time-consuming :-)
Comment 7 Christian Persch 2012-07-06 17:18:09 UTC
Created attachment 218194 [details] [review]
shell: Store and restore current folder when opening or saving file

Remember the folder last used to open or save a document, attachment
or image.
Comment 8 Carlos Garcia Campos 2012-07-07 08:55:23 UTC
Review of attachment 218194 [details] [review]:

I never liked the idea of not remembering the last folder used, so I like this approach, but the bug title says the opposite: "Don't set the current folder while saving/opening a file" so please, change the title, or open a new bug or simply don't include a link to the bug in the commit message.
Comment 9 Christian Persch 2012-07-07 15:34:49 UTC
Right, I forgot to change the title when I reopened this bug. I'll just remove the link from the commit msg.

Pushed to master! :-) :-)

WONTFIX as for the original request in comment 0.