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 153828 - Filechooser does not remember state
Filechooser does not remember state
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.4.x
Other All
: Normal minor
: Medium API
Assigned To: gtk-bugs
Federico Mena Quintero
: 144033 144036 161162 170138 170294 302053 310574 323997 331313 332270 339440 341132 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-09-27 10:14 UTC by Lemmit Kaplinski
Modified: 2009-02-27 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
save the folder open/closed state with the file chooser settings (7.64 KB, patch)
2007-01-05 15:48 UTC, Peter Teichman
committed Details | Review
Save dialog (36.38 KB, image/jpeg)
2007-01-18 01:06 UTC, younker
  Details
patch (1.34 KB, patch)
2007-01-18 10:25 UTC, Yevgen Muntyan
none Details | Review

Description Lemmit Kaplinski 2004-09-27 10:14:18 UTC
When saving a file, the filechooser does not remember the last state it was in.
By state I mean - if the little trianlge next to "Browse for other folders" has
been clicked or not.

I prefer using the filebrowser component that is available in the expanded view
and currently I have to open it manually every time. I would expect the
filechooser to remember its state from one invocation to the other.

Other information:
Comment 1 Federico Mena Quintero 2004-12-15 01:05:17 UTC
*** Bug 161162 has been marked as a duplicate of this bug. ***
Comment 2 Federico Mena Quintero 2004-12-15 01:06:05 UTC
As in the duplicate, "saving state" should probably also save the dialog size,
the position of the paned's handle, etc.
Comment 3 Gabor Farkas 2004-12-15 08:53:31 UTC
i'll ask the question here too: is there a quick way to change the default-size
of the filechooser? gconf? change some DEFINEs in the source-code?

or is it using some kind of use-the-default-size-of-the-parent-"class" thing?
Comment 4 Morten Welinder 2005-04-27 01:56:11 UTC
*** Bug 170294 has been marked as a duplicate of this bug. ***
Comment 5 Federico Mena Quintero 2005-04-28 20:11:45 UTC
*** Bug 302053 has been marked as a duplicate of this bug. ***
Comment 6 Federico Mena Quintero 2005-04-28 23:49:03 UTC
*** Bug 170138 has been marked as a duplicate of this bug. ***
Comment 7 Federico Mena Quintero 2005-04-29 00:02:24 UTC
*** Bug 144036 has been marked as a duplicate of this bug. ***
Comment 8 Federico Mena Quintero 2005-12-13 17:48:59 UTC
*** Bug 323997 has been marked as a duplicate of this bug. ***
Comment 9 Reinout van Schouwen 2005-12-15 15:57:29 UTC
*** Bug 144033 has been marked as a duplicate of this bug. ***
Comment 10 Björn Lindqvist 2005-12-15 18:12:38 UTC
Since my bug #323997 was filed as a dupe, let me restate my proposal here:
Revert to a non-stateful Save as-dialog. Atleast until the problem with the
current design is solved (which I argued that it was unlikely that they could be).
Comment 11 Andrei Yurkevich 2005-12-15 22:30:50 UTC
Shouldn't the application that pops up the file chooser remember its size and
resize it when creating one - just like they set the initial folder for
filechoosers they open? I would prefer this way since if we remember the size
for any filechooser, problems/annoyances may occur with resizing different
filechoosers with previews, etc. For that reason, simply adding some API for
setting the initial filechooser state and reading it after it's dismissed should
be pretty much enough. Same goes to show/hide other folders expander.
Comment 12 Marc Koschewski 2005-12-16 08:59:52 UTC
I think it's crappy to force a developer to handle that stuff. We have ONE file
chooser (from a user-perspective - even if it has some visual differences - the
purpose is the same). And I - from a user-perspective - expect that it keeps the
size, visuals (and location) I used the last time. Moreover, there's too much
effort to update a thousand file-chooser calls instead of updating the
file-chhoser itself. 
Comment 13 John Richard Moser 2006-02-14 16:08:36 UTC
It would not be consistent for Application X to invoke System Function A in A(X) way and Application Y to invoke System Function A in A(Y) way.

What I mean is, if the file chooser is stated to "Browse" mode by default, it should be stated that way across all applications.

Personally I think this should be a configuration option, because memorizing the last state seems semi-random when the actions you take in Application X affect the behavior of Application Y.  A change to the configuration of System Function A is expected to change Applications X and Y.
Comment 14 Marc Koschewski 2006-02-14 16:37:08 UTC
GNOME overall lacks config options. I doubt this one will turn into being configurable. :/
Comment 15 Andrei Yurkevich 2006-02-14 17:14:07 UTC
Having filechooser that keeps it state globally is wrong - think of user opening some files in her Music folder, and then opening some document in a word processor. Presenting the file chooser in Music folder would be wrong then, since she always opens stuff inside Documents folder in word processor, and Music in her media player.
Same to saving - she might just drop files to the Work folder with their names as-is from the word processor, so a "minimized" filechooser that only asks for a folder and is not expanded by default is ok, but when she is saving stuff from the web browser, she always wants to save them under different names (web is a mess, you know) so she would like to have an expanded filechooser by default in web browser.
Thus, the right way(tm) would be remembering the last state of the filechooser on a per-application basis, just like the positions of Nautilus windows are remembered and restored - we're after spatial desktop after all.
Comment 16 Marc Koschewski 2006-02-15 13:31:25 UTC
By 'state' I just meant ...

- size
- position

Optionally

- 'Remember working directory'

could be a checkbox within the dialog.
Comment 17 Federico Mena Quintero 2006-02-24 22:12:12 UTC
*** Bug 332270 has been marked as a duplicate of this bug. ***
Comment 18 Calum Benson 2006-04-27 15:52:59 UTC
FWIW, I agree with comment  #15... no user-visible config ought to be necessary here, it should just work.

Another consideration is whether to also save "working folder state" separately for Open, Save etc. dialogs in the same application... sometimes I get annoyed when apps use the same "most recently used" folder for both opening and saving, and sometimes I get annoyed when they don't :)  (But I always get annoyed when they ignore it altogether and default to "Documents" or something).  I guess the main thing is to pick something sensible and apply it consistently.
Comment 19 Andrei Yurkevich 2006-06-04 23:23:56 UTC
Seems like GtkFileChooserSettings [1] can be used to address this issue. Here is my proposal:

1. A new property is added to the GtkFileChooser interface that identifies the filechooser. Thus, to create a filechooser that restores its state you simply provide an identification to the filechooser when creating it:

  GtkFileChooser *chooser = g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG,
                                          "action", action,
                                          "identification", "org.gnome.Application.SaveDocumentAs",
                                          NULL);

2. When such filechooser that has non-NULL "identification" property is destroyed, its GtkFileChooserSettings are saved to the appropriate location (~/.config/gtk-2.0/gtkfilechooser/org.gnome.Application.SaveDocumentAs).

3. When the filechooser with this identification is constructed next time, its saved state is read from that file and the filechooser gets updated accordingly.

[1] http://mail.gnome.org/archives/gtk-devel-list/2006-April/msg00016.html
Comment 20 Mantas Kriaučiūnas 2006-11-23 12:37:57 UTC
It seems bug #310574 is duplicate of this bug
Comment 21 sam tygier 2006-12-09 19:23:07 UTC
http://gentoo-wiki.com/HOWTO_Beautify_GNOME has a patch to change the default to expanded.
Comment 22 Peter Teichman 2007-01-05 15:48:28 UTC
Created attachment 79453 [details] [review]
save the folder open/closed state with the file chooser settings
Comment 23 Peter Teichman 2007-01-05 15:50:23 UTC
The above patch resolves part of this bug - it saves the expander state along with the other file chooser settings.  It doesn't add any other saved state.

It should apply cleanly against current 2.10 CVS.
Comment 24 Federico Mena Quintero 2007-01-05 17:12:23 UTC
Very nice!  Thanks, Peter.  Can you please commit it to HEAD and gtk-2-10?  As an exercise, I leave it to you to translate that into svn's terminology ;)
Comment 25 Yevgen Muntyan 2007-01-09 04:00:12 UTC
Can't it be done without filechooser flashing and resizing randomly? Now it at least flashes (yuo can see expander expanding quickly); and sometimes it resizes back to small size after expanding.
Comment 26 Yevgen Muntyan 2007-01-09 04:05:55 UTC
Or how about finally making some gtk_file_chooser_set_expanded() public, so application developer may actually fix this thing, since it's already admitted that "always collapsed" is not what a user may want? Then one could also save size of Save dialog (it's not as critical as size of Open dialog, which thank to don't know whom can be saved, but would be still nice).
Comment 27 younker 2007-01-18 01:03:48 UTC
with the new release of gtk, gtk_file_chooser can save it folder open/closed state now, but can we add another feature to allow save the dialog size for open and save, by default the size of save dialog is a bit smaller than I need. in the content pane, I can only get three items. 

See the attached image for detail.
Comment 28 younker 2007-01-18 01:06:25 UTC
Created attachment 80561 [details]
Save dialog

The save dialog which only 3 items can be seen in the content pane. 
So I hope the size can be saved after I resize this dialog
Comment 29 Yevgen Muntyan 2007-01-18 10:25:45 UTC
Created attachment 80575 [details] [review]
patch

This patch fixes mentioned flashing and other dances caused by loading state in map().

Federico, could you comment on how you think all this stuff with state and everything should be? Somehow it was believed "filechooser does the right thing", now things seem to be better, it's great. Still, without you it's not going to fly anywhere. Random patches like one that was applied (to 2-10!) do no good; and they will silently break stuff of people who actually try to fix FileChooser behavior in applications (yes, there are silly people doing that).
Comment 30 Federico Mena Quintero 2007-01-23 03:19:43 UTC
(In reply to comment #29)
>
> This patch fixes mentioned flashing and other dances caused by loading state in
> map().

We need to do it in map() because some apps recycle the same instance of a file chooser, instead of creating one every time the user does File/{Open,Save}.

It's probably enough to do this:  in gtk_file_chooser_default_map(), move the call to settings_load() before the call to ::map() in the parent class.  Could you please test it that way?

> Federico, could you comment on how you think all this stuff with state and
> everything should be? Somehow it was believed "filechooser does the right
> thing", now things seem to be better, it's great. Still, without you it's not
> going to fly anywhere. Random patches like one that was applied (to 2-10!) do
> no good; and they will silently break stuff of people who actually try to fix
> FileChooser behavior in applications (yes, there are silly people doing that).

Applications should not have to do anything special to get a decent file chooser; that's why I don't want to expose APIs like gtk_file_chooser_set_expanded().  We may remove the expander in the future, or change the GUI in ways that are unrelated to the API.

As for remembering the size, I'm all for it.  Someone has to test disabling the hairy code that computes the sizes, add code to save the user-defined size, and test it with various apps that add different "extra" widgets.
Comment 31 Federico Mena Quintero 2007-01-25 17:17:42 UTC
*** Bug 331313 has been marked as a duplicate of this bug. ***
Comment 32 gnutter 2007-01-25 17:45:25 UTC
Bug 331313 went a little further with this logic and cleaned up the interface by hiding the redundant combo when the save dialogue is in it's expanded form.

This goes a long way to simplifying the interface and making it easier to assimilate what is presented since this is pure duplication and clutter when the expander is open.

patch was provided in that bug , have not tried applying it now but it should be a trivial mod if it does not apply.

Nice to see some movement on this.

Comment 33 Federico Mena Quintero 2007-01-25 19:53:21 UTC
*** Bug 339440 has been marked as a duplicate of this bug. ***
Comment 34 Federico Mena Quintero 2007-01-25 20:12:39 UTC
*** Bug 341132 has been marked as a duplicate of this bug. ***
Comment 35 Christian Persch 2007-02-02 19:10:38 UTC
This patch has apparently been committed; setting patch status accordingly.
Comment 36 Yevgen Muntyan 2007-06-17 21:29:47 UTC
Comment on attachment 80575 [details] [review]
patch

Marking patch as obsolete, it was hanging in patch list.
Comment 37 Federico Mena Quintero 2007-10-09 03:16:29 UTC
Why is this bug still open?
Comment 38 Federico Mena Quintero 2008-01-08 16:42:40 UTC
Closing due to inactivity.
Comment 39 Federico Mena Quintero 2009-02-27 19:57:20 UTC
*** Bug 310574 has been marked as a duplicate of this bug. ***