Uh oh!
There was an error while loading. Please reload this page.
File widgets: sort list in drag-and-drop operation - #66
Conversation
ctrueden
commented
Apr 8, 2022
I tested the current behavior on macOS, and dragging from Finder, the order is consistent with how the files are listed/sorted, which seems like a good thing to me. When sorted by "Date Modified" for example, I would expect the files to drop into Fiji in that same order: the order they appear listed in Finder. Which file systems provide files in an unsorted way? Perhaps we could sort only for those file systems? |
imagejan
commented
Apr 9, 2022
Thanks, @ctrueden, for testing. My use case was on Windows with a samba-mounted GPFS. I should have specified that I was dragging a single folder onto the Add folder content... button. In this case, you don't have an open Explorer window with a custom sorting. I can confirm that when dragging multiple selected files the order of the files is conserved from how they're listed in Explorer. So I guess the default sorting should be implemented for the folder content button only, which would be here: Do you agree? I can update this PR accordingly. |
ctrueden
commented
Apr 9, 2022
Yes, that seems right to me (although I didn't have time to test it).
Thanks! |
imagejan
commented
Apr 19, 2022
@ctrueden, I updated this pull request to only sort the file list when adding the (possibly filtered) content of an entire folder to the file list. (Sorry I didn't have a chance to test extensively with the samba-mounted file system yet because I'm currently traveling.) |
Some file systems provide files in an unsorted way, resulting in e.g. the
FileListWidgetcontaining an unordered list when folder content is added. This pull request aims to improve user experience by always sorting the list of files returned bySwingFileWidget.getFiles().