Commit Graph

10 Commits

Author SHA1 Message Date
Matthias Clasen
4b404f0dea Add g_openuri_portal_open_uri_async
This avoids a roundtrip through GFile and
thus works with random uri schemes.
2023-01-14 14:32:51 -05:00
Matthias Clasen
0c1c0524c7 openuri: Some reshuffling
This is in preparation of adding a method
that takes a uri instead of a GFile.
2023-01-14 14:32:51 -05:00
Matthias Clasen
6efd1a9dad Pass an activation token to OpenURI
The OpenURI portal can take an activation_token
nowadays. So it give one.
2023-01-04 16:39:24 -05:00
Benjamin Otte
977fedfdf1 dialog: GTK_DIALOG_ERROR_ABORTED => GTK_DIALOG_ERROR_CANCELLED
This is done via the GCancellable, so let's call it cancelling.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8957302bd4 dialog: GTK_DIALOG_ERROR_CANCELLED => GTK_DIALOG_ERROR_DISMISSED
The term "cancelling" is used with GCancellable, a user clicking a close
button is not that.
User input is usually described as "dismissing", so we use that term.
2022-12-24 07:56:57 -05:00
Matthias Clasen
42cd230d44 openuriportal: Better error handling
Nested async calls are always a challenge.

Hopefully, things are straightened out now,
and we report GTK_DIALOG_ERROR errors for
the cases we care about.
2022-12-09 11:05:48 -05:00
Matthias Clasen
bc8e19fcd0 openuriportal: Add a check function
Add private API to check whether the portal
is available.
2022-12-09 11:05:48 -05:00
Matthias Clasen
ae29fee903 openuriportal: Support OpenDirectory
This required an extra argument. Update all callers.
2022-12-09 11:05:48 -05:00
Matthias Clasen
7ad0bae12f openuriportal: Cosmetics
There were some copy-paste errors.
2022-12-09 11:05:48 -05:00
Matthias Clasen
17819ad4f6 filechooser: Improve "Open in File Manager"
Just relying on GAppInfo leads to suboptimal
results. Instead, call either the OpenURI portal
or the org.freedesktop.FileManager1 interface
directly, and only fall back to GAppInfo.

The wrapper code for the OpenURI portal is taken
from gio, with small adjustments.

Fixes: #5260
2022-10-19 15:01:21 -04:00