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 538784 - Don't update Chooser Entry when clicking on folder in CREATE_FOLDER
Don't update Chooser Entry when clicking on folder in CREATE_FOLDER
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2008-06-17 15:19 UTC by Olle Bergkvist
Modified: 2008-06-18 22:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix it (1.05 KB, patch)
2008-06-17 15:53 UTC, Olle Bergkvist
none Details | Review

Description Olle Bergkvist 2008-06-17 15:19:27 UTC
When using the file chooser in CREATE_FOLDER mode (to create a new folder):

User wants to create folder FooBar, in the Videos subfolder of his home directory. 

1. User writes FooBar in the chooser entry at the top of the window. 
2. User double-clicks on subfolder Videos to go to Videos and create FooBar there instead. 
3. Chooser entry is set to Videos instead. This is incorrect. It should be like in SAVE mode, not changed when double/single clicking on subfolder. 
4. The chooser entry is erased. This happens in update_chooser_entry in gtkfilechooserdefault.c:6780. 

Patch follows in next comment, one sec...
Comment 1 Olle Bergkvist 2008-06-17 15:53:27 UTC
Created attachment 112916 [details] [review]
Patch to fix it

Here is a patch. It's quite simple, the code explains itself. 

The bool change_entry is set to FALSE if we're in CREATE_FOLDER mode. The entry isn't changed. 

However this introduces the new problem that it's harder to name the new folder after an existing folder. I guess that's still better than what we have now. 

But this might need some extra input. And not just patch reviewing, but input from users on how they want the file chooser to behave.
Comment 2 Federico Mena Quintero 2008-06-18 22:38:36 UTC
Thanks!  I've committed this to trunk and gtk-2-12.

Next time, please use "diff -up" so that the diff will have function names in the hunks - makes the patch easier to read :)

2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>

	http://bugzilla.gnome.org/show_bug.cgi?id=538784 - Don't change
	the filename in the name entry in CREATE_FOLDER mode when changing
	folders, so that you can enter a new subfolder name, double-click on a
	folder to change to it, and close the dialog.

	* gtk/gtkfilechooserdefault.c (update_chooser_entry): Don't change
	the filename in the entry in CREATE_FOLDER mode, either.