Replies: 4 comments
-
This should not be marked as a bug, but I have no idea how to change that. More of an incomplete-design we never finished before the ship sailed a decade ago. |
Beta Was this translation helpful? Give feedback.
-
@chergert: For anything that is not a bug, you can go to https://github.com/flatpak/xdg-desktop-portal/discussions/new/choose. The most relevant (obvious) choice for a feature request is "Idea". Maintainers can convert a bug into a "discussion". |
Beta Was this translation helpful? Give feedback.
-
Took the liberty to convert to a discussion |
Beta Was this translation helpful? Give feedback.
-
I have a use case for this. In the Inform programming environment, users can give their Inform programs extra capabilities by installing extensions into their project. Previously, these extensions came in the form of text files, named I would like to be able to create a file dialog that will allow the user to pick an extension to install into their project, no matter whether it is a folder, a text file, or a zip file. |
Beta Was this translation helpful? Give feedback.
-
Operating System
Fedora 40
XDG Desktop Portal version
1.18
XDG Desktop Portal version (Other)
No response
Desktop Environment
GNOME
Desktop Environment (Other)
No response
Expected Behavior
Currently we do not have API in the portal that allows for selecting either a file or a directory. In fact, this has been a problem since the beginning when we moved to
GtkFileChooserNative
in GTK.Apparently we did not have a bug open for this because the discussion on it predates the issue tracker for, at the time, xdg-app.
GNOME Builder allows you to select either a project directory or a file to open using the file-chooser. If the file-filter contains
inode/directory
, it dynamically switches toSELECT_FOLDER
instead ofOPEN
. This way you can just open a project directory or, alternatively, select a project file to open (CMakeLists.txt, configure.ac, meson.build, etc etc).We've never had a way to do this via the FilePortal and now that GTK is moving towards
GtkFileDialog
which encodes this functionality as async functions, that becomes even harder.One thought is that we could encoded this behavior in the actual implementations, and simply change their mode based on the file-filter being
inode/directory
.Current Behavior
As above
Steps to Reproduce
Try to use
org.freedesktop.portal.FileChooser.*
API to select a folder or open a file.Anything else we should know?
No response
Beta Was this translation helpful? Give feedback.
All reactions