-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select the file after opening system file explorer #3251
Comments
Note that this requires OS-specific code to be implemented: On Windows, a |
How jank is this? Acceptable? Error OS_Windows::shell_open(String p_uri) {
if (p_uri.begins_with("file://")) {
String explorer_param = "/select," + p_uri;
ShellExecute(nullptr, nullptr, "explorer.exe", (LPCSTR)(explorer_param.utf8().get_data()), nullptr, SW_SHOWNORMAL);
} else {
ShellExecuteW(nullptr, nullptr, (LPCWSTR)(p_uri.utf16().get_data()), nullptr, nullptr, SW_SHOWNORMAL);
}
return OK;
} I also had to comment out this part to get it to work, otherwise it just kept opening to select the folder. This may impact other platforms...? case FILE_SHOW_IN_EXPLORER: {
// Show the file/folder in the OS explorer.
String fpath = path;
if (path == "Favorites") {
fpath = p_selected[0];
}
/*if (!fpath.ends_with("/")) {
fpath = fpath.get_base_dir();
}*/
String dir = ProjectSettings::get_singleton()->globalize_path(fpath);
OS::get_singleton()->shell_open(String("file://") + dir);
} break; |
The API to use in macOS is |
Implemented by godotengine/godot#69698 |
Describe the project you are working on
A big project with many folders and files.
Describe the problem or limitation you are having in your project
It happens quite often that I need to open some directory looking for specific file. However when I use the Show in File Manager option, it only opens the directory. I have to find the file again, which often is more difficult than from within the editor due to the
*.import
litter.Describe the feature / enhancement and how it helps to overcome the problem or limitation
When I click the Show in File Manager option in filesystem dock, it should not only open the directory, but also select the file.
See also godotengine/godot#26364
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It needs some platform-specific code.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not really.
Is there a reason why this should be core and not an add-on in the asset library?
It's about editor filesystem dock usability.
The text was updated successfully, but these errors were encountered: