Questions about a unified API for file choosers (and platform/toolkit integration)
Roman Hargrave
roman at hargrave.info
Sun Mar 26 18:18:31 UTC 2017
On Sun, 26 Mar 2017 14:10:25 +0100
Thomas Kluyver <thomas at kluyver.me.uk> wrote:
> On Thu, Mar 23, 2017, at 10:30 PM, Roman Hargrave wrote:
> > Now, if there were a toolkit-agnostic set of interfaces for applications
> > to call in to in order to prompt the user with the native file picker
> > instead of that which the toolkits use would have the advantage of insuring
> > that any settings applied by their desktop environment follow through to the
> > application experience, thus allowing users to, for instance, not be subjected
> > to, for instance GTK file picker if they would prefer to use the Qt picker.
>
> Flatpak has a system of 'portals', so that a sandboxed application can
> ask the user to select a file which the application wouldn't otherwise
> have access to. From the description, it sounds like the UI you see will
> depend on your desktop environment, not on the application's toolkit,
> which seems like what you want.
>
> https://github.com/flatpak/flatpak/wiki/Portals
>
> I don't know whether this interface is available to applications not
> running in Flatpak, though.
>
> Thomas
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/xdg
This is the general idea, yes, minus the sandbox portions (e.g. moving the file
in to the sandbox when selected, and whatnot). For the reason that these are not
so much for toolkit-agnostic operation (that's just a convenient side-effect) but
so that applications don't have as much control over file-related things.
That being said, I think that for non-sandboxed (e.g. non-flatpak)
applications, a linkable API would be preferable to the session bus-based solution,
just for simplicity, even though dbus and friends are omnipresent (I even found
it on an old embedded ebook reader, in some form).
--
Roman Hargrave
http://hargrave.info
roman at hargrave.info
$ fortune -s linuxcookie linux cookie
"Because he's a character who's looking for his own identity, [He-Man is]
an interesting role for an actor."
-- Dolph Lundgren, "actor"
More information about the xdg
mailing list