Page MenuHome

UI: Windows Platform File Browser System List
AcceptedPublic

Authored by Harley Acheson (harley) on Dec 13 2019, 12:30 AM.

Details

Summary

Since we can now use separate icons for the items in the File Browser lists, the following rounds out the "System" list for the Windows platform.

  • uses current SHGetKnownFolderPath (Vista+) rather than unsupported SHGetSpecialFolderPathW.
  • Includes more special folder locations, like Music and Downloads
  • Places the items in expected OS order
  • The display names are allowed to be translated

Will look like the following:

Diff Detail

Repository
rB Blender

Event Timeline

Seems to work just fine, just run it by the UI guys. cc:@William Reynish (billreynish)

This revision is now accepted and ready to land.Dec 13 2019, 1:28 AM
William Reynish (billreynish) requested changes to this revision.Dec 13 2019, 11:56 AM

This seems to make the same mistake as the equivalent macOS patch: It creates a *fixed* list of bookmarks rather than getting the list from the OS (The Windows Explorer in this case)

This revision now requires changes to proceed.Dec 13 2019, 11:56 AM

This seems to make the same mistake as the equivalent macOS patch: It creates a *fixed* list of bookmarks rather than getting the list from the OS (The Windows Explorer in this case)

No, my mistake on the Mac patch was in assuming that the list of strings that you supplied me was the entirety of your list. I’ll have another patch for that as soon as you supply any of the information requested.

Your mistake on this patch is assuming that Windows works like Mac. On Windows we want to include just the folders we desire. To simply enumerate all special folders (GetFolderIds) would include things like Sendto, roaming tiles, systemCertificates, user pinned, and literally dozens of other paths. There is no windows API call to just get a short list of “special folders” for this purpose. Instead we ask the OS for the folder locations of just the things we are interested in.

Cleaned up and reduced redundancy by adding a helper function to insert Windows special folders.

And added "Fonts" folder to the list:

Quieted a warning. And also now shows nicer icons in Bookmarks and Recents too:

This is fine with me, provided that the System list follows what you see in the Windows Explorer.

However, to me this really seems like it should be two independent patches: one to add icons and another to change the System panel contents.

This patch now also uses the same icons shown in the System list when viewing the same folder in the main list while in Thumbnail view.

For example:

Updated so that it is never possible to have a little file folder icon inside a larger one, something that might have happened with Macs.

This revision is now accepted and ready to land.Dec 19 2019, 1:26 AM

Updating to current state of master.

I think the correct Temp folder is BKE_tempdir_session(). At least on macOS, U.tempdir is not set by default.
And if, on macOS, we copy bookmarks from Finder then we don't need to add Temp.

And the user preferences U.tempdir, U.fontdir, U.textudir, ... can also be "known paths" with icons, I guess.

Yes, thanks.

The “tempdir” here was mostly a placeholder for “things common to all platforms go here” but yes, might be best to leave that out of this patch to simplify it. And possibly add a “home” icon as first item for root of user’s profile to keep similar to other platforms.

Separately we should set a default for tempdir on Mac. When I did similar for Windows I think I left a “todo” comment for other platforms. I might look for that in a few days and give you a nudge. LOL

Updated to current state of master.

Removed the entry for blender "temp" folder as we can deal with adding extras later.

Added an entry for "Home" pointing at profile root to be more consistent with expected lists on Mac and Linux.

Following shows the current state on Windows: