Add functionality to tab-autocomplete folders in the file browser file field. Ability to autocomplete .blend files and their sub folders while linking. If only one match of a blend or a folder is found, it is opened, which applies to wildcards in the file field now.
Details
- Reviewers
Brecht Van Lommel (brecht) Andrea Weikert (elubie) - Maniphest Tasks
- T37485: Tab completion does not work when appending
- Commits
- rBS9c5fb7b2e7ec: Fix T37485: autocomplete while appending and autocomplete folder behaviour.
rB9c5fb7b2e7ec: Fix T37485: autocomplete while appending and autocomplete folder behaviour.
Diff Detail
Event Timeline
Thanks! I'll do a proper review tomorrow, ran out of time today.
| source/blender/editors/space_file/file_ops.c | ||
|---|---|---|
| 1287 | The code style guide says to put the } one a separate line. | |
The code and functionality look good to me, but is there any way you could keep the focus in the text field after entering a directory instead of having to click it again? That would make browsing by just typing much faster.
I don't know off hand how to do that exactly, but if you can't figure out how, feel free to ask me to help with that.
Code overall looks good (the small style issue Brecht already mentioned), just one thing I'd like you to check whether there is a better way to determine when to stop expanding. Curretly you rely on the fact that the path two levels up exists. Maybe you could check whether that actually is a .blend file (similar to BLO_is_a_library - maybe you could refactor out common functionality there and avoid passing in a group which you don't need at this point)
I agree with Brecht that keeping the focus in the text field would be nice but not sure if that is easily possible - still maybe worth trying.
I'll take a closer look on Friday and might have some time during the weekend to help as well.
Changed the hacky lib depth checking code to use BLO_is_a_dir. Refactor might be an option, but currently BLO_is_a_dir still uses the strings for internal operations, it is used with temporary char[]s in another place too though.
Still have to figure out the focus issue, won't be able to do that all by myself probably though
Looking good to me so far. Keeping open to investigate what needs to be done to keep the focus in the text edit.
I looked into keeping focus and it turned out somewhat complicated and required some refactoring to solve nicely, so went ahead and implemented it myself.
See D29: File Browser: autocomplete now keeps focus in the file text field when using it to enter a directory. for details.
I think this revision can be committed as is.
To be clear, I think this D20 revision can be committed without the keeping focus thing, and then that can be improved in a follow up commit.
Closed by commit rB9c5fb7b2e7ec (authored by @Henrik Aarnio (hjaarnio), committed by @Brecht Van Lommel (brecht)).