GNOME Bugzilla – Bug 663573
Rework GtkFileChooserEntry
Last modified: 2011-12-16 19:11:42 UTC
I've just pushed a filechooserentry branch to GTK: http://git.gnome.org/browse/gtk+/log/?h=filechooserentry It goes best together with the code from bug 663570 which speeds up enumerations considerably. I had the following goals in mind when redoing this branch (somewhat in order of importance): - Make the tab key work consistently. In current code it sometimes fails to work. This is either for speed reasons (the directory is not completely loaded yet when pressing the tab key) or due to the tab key not completing, but moving focus. - Emulate bash The code should behave like bash, so completion behavior learned in the terminal is applicable to the file chooser. There's of course some additional things we have (asyncness, selections and the completion popup), so I didn't make a 1:1 copy, but at least key sequences with the tab key should translate 1:1. - Integrate with modern APIs The current code was written before a bunch of the current features existed and duplicates a lot of things, often in slightly different behaviors. So I tried to use things like gio, GtkEntryCompletion and GtkFileSystemModel more. As a bonus, that would reduce the amount of code.
This works really well! Good job! I've found a few problems - in order of importance: - Save mode in recent-files mode used to flame you if you typed "foo" and then Enter without selecting a folder. Now it just confirms /home/federico/foo. I *think* this may be due to the entry starting with a base_folder of $HOME, whereas previously it had NULL. - Save mode should only do explicit completion (requiring you to press Tab), not autocompletion like it is now. - Hitting Tab should bring up the completion list, even if there is no file part yet. For example, type /usr/lib/[TAB] sometimes makes the list that pops up after typing the last / disappear - it should leave the list there, or if the list is not present, it should pop it up. Fix the first two and it's ready for merging, I'll say. This works really nicely. If possible, pressing Tab additional times should make the completion list scroll. As discussed on IRC some weeks ago, this probably needs to go in GtkEntryCompletion or something.
*** Bug 632394 has been marked as a duplicate of this bug. ***
Fixed the issues you pointed out and pushed to master so it hits the 3.3.6 release.