Gtk.UriLauncher¶
class — extends GObject.Object
Asynchronous API to open a uri with an application.
GtkUriLauncher collects the arguments that are needed to open the uri.
Depending on system configuration, user preferences and available APIs, this may or may not show an app chooser dialog or launch the default application right away.
The operation is started with the UriLauncher.launch function.
To launch a file, use FileLauncher.
Constructors¶
new¶
Creates a new GtkUriLauncher object.
Parameters:
uri— the uri to open
Methods¶
can_launch¶
Returns whether the launcher is likely to succeed in launching an application for its uri.
This can be used to disable controls that trigger the launcher when they are known not to work.
Parameters:
parent— the parent window
get_uri¶
Gets the uri that will be opened.
launch¶
def launch(self, parent: Window | None = ..., cancellable: Gio.Cancellable | None = ..., callback: Gio.AsyncReadyCallback | None = ...) -> None
Launches an application to open the uri.
This may present an app chooser dialog to the user.
Parameters:
parent— the parent windowcancellable— a cancellable to cancel the operationcallback— a callback to call when the operation is complete
launch_finish¶
Finishes the UriLauncher.launch call and
returns the result.
Parameters:
result— the result
set_uri¶
Sets the uri that will be opened.
Parameters:
uri— the uri
Properties¶
uri¶
The uri to launch.