-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add NativeFileDialog
class
#60603
Add NativeFileDialog
class
#60603
Conversation
I have an issue with this PR is that it collides with the purpose of #60501 as two of its purposes are to provide unified interaction with the desktop and, for Linux/BSD specifically, a DBus client for desktop services. The former might or might not apply with every communication you do with the desktop, but the latter should not be ignored as the But I don't want this to let you down as you can still do changes to this and take parts from Portable File Dialogs and use them with |
This implementation won't solve the issue with file system access by sandboxed macOS applications. It's probably won't work from a sandboxed macOS app at all. Sandboxed macOS apps can access most of the file system only via system file dialog, and require cookies to be saved to preserve access right across sessions. See #47499 for limited native file dialog implementation, done specifically for this purpose. |
@bruvzg @spindlebink should we start a discussion/thread on RocketChat? |
I am not against this, I think it looks interesting but I have two recommendations:
|
This is pretty much the extent of PFD's functionality as far as file dialogs go. It also supports notifications, I think, but I haven't tied into them here as my goal was to do as close a representation of FileDialog as I could for now. |
Ok I tested this PR and I have some feedbacks :
|
It can be solved by always adding a slash to the end of the path. |
By using the comments of this PR: godotengine/godot#60603
By using the comments of this PR: godotengine/godot#60603
Here's a simpler SVG that also doesn't have elements off-screen! |
These have now been merged (for 4.2?) so we have another way of accessing native file dialogues via the FileDialog.use_native_dialog property and the same has also been implemented for linux in #80104. So it seems all the functionality of this PR has now been implemented in a different way and this can be closed? |
Closing as superseded by the aforementioned PRs. |
This PR adds a
NativeFileDialog
class, interface modeled afterFileDialog
, which wraps a header-only cross-platform dialog library to display native file dialogs to the user.Most features of
FileDialog
are present inNativeFileDialog
, except for theControl
-specific ones and a couple of others that didn't make sense with the wrapper nature.I've also provided a rather bad but at least present icon for the class and a class reference that I think covers the whole class. Future versions need better error checking, and I'd also like to eventually tie into the other features of the library I hooked into, which supports notifications and modal dialogs as well, although those'll be separate components/classes.
This is my first real PR, so I'd appreciate any notes regarding either code or otherwise. I hope to contribute more frequently.
Relevant issue: godotengine/godot-proposals#1123
Edit: Had a chat with @YakoYakoYokuYoku about some related PRs (#60501 and #47499) and the current proposal is for this implementation of
NativeFileDialog
to serve as an API template and preliminary implementation until eventual platform-specific implementations can be written usingTrayBroker
or a permutation of it.