Skip to content
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

implement 'OS::shell_show_in_explore()' for FilesystemDock and expose… #65890

Conversation

Daylily-Zeleen
Copy link
Contributor

@Daylily-Zeleen Daylily-Zeleen commented Sep 16, 2022

Implement 'OS::shell_show_in_explore()' for FilesystemDock and expose to GDScript.

Currently only implement for Windows, because I only have a windows device.
On other platforms, it will fallback to origin action.

I hope someone can implement for other platforms.

QQ.20220916183403.mp4

@Daylily-Zeleen Daylily-Zeleen requested review from a team as code owners September 16, 2022 10:35
@YuriSizov
Copy link
Contributor

YuriSizov commented Sep 16, 2022

What would be the benefit of this instead of using it as we currently do and let the operating system handle the file protocol scheme as it sees fit?

@KoBeWi
Copy link
Member

KoBeWi commented Sep 16, 2022

Seems like it closes godotengine/godot-proposals#3251
You made a typo in the method name though, it should be "explorer" not "explore".

@Daylily-Zeleen
Copy link
Contributor Author

This only effective for the popop mune's item Show in file manager.
If a folder has many files, this can help you find target file more quickly.

@Daylily-Zeleen
Copy link
Contributor Author

Oh ....my garbage English....
Let me fix it

@akien-mga
Copy link
Member

akien-mga commented Sep 16, 2022

Seems like it closes godotengine/godot-proposals#3251

I think if that's the use case for it, something like this is better than adding a whole new method:
godotengine/godot-proposals#3251 (comment)

@bruvzg
Copy link
Member

bruvzg commented Sep 16, 2022

On other platforms, it will fallback to origin action.

On macOS, you can use the following code, no idea if there's a universal equivalent for Linux:

NSArray* urls = [NSArray arrayWithObjects:[NSString stringWithUTF8String:p_uri.utf8().get_data()], nullptr];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:urls];

… to GDScript

fix methods names

implement 'OS::shell_show_in_explore()' for FilesystemDock and expose to GDScript

fix methods names
@Daylily-Zeleen
Copy link
Contributor Author

On other platforms, it will fallback to origin action.

On macOS, you can use the following code, no idea if there's a universal equivalent for Linux:

NSArray* urls = [NSArray arrayWithObjects:[NSString stringWithUTF8String:p_uri.utf8().get_data()], nullptr];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:urls];

I can't debug on macos so I can't be responsible for this

@Daylily-Zeleen
Copy link
Contributor Author

Seems like it closes godotengine/godot-proposals#3251

I think if that's the use case for it, something like this is better than adding a whole new method: godotengine/godot-proposals#3251 (comment)

I think this new method is a util for Plugin developer.

@Daylily-Zeleen
Copy link
Contributor Author

I still can't squash commts, so I will close this one and open a new pr.

@Daylily-Zeleen
Copy link
Contributor Author

Repalced by #65906

@Daylily-Zeleen Daylily-Zeleen deleted the daylily_zeleen/shell_show_in_explore branch September 29, 2022 11:15
@aaronfranke aaronfranke removed this from the 4.x milestone Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants