UriLauncher#

Added in version 4.10.

class UriLauncher(**properties: Any)#

Superclasses: Object

A GtkUriLauncher object collects the arguments that are needed to open a uri with an application.

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 launch function.

To launch a file, use FileLauncher.

Constructors#

class UriLauncher
classmethod new(uri: str | None = None) UriLauncher#

Creates a new GtkUriLauncher object.

Added in version 4.10.

Parameters:

uri – the uri to open

Methods#

class UriLauncher
get_uri() str | None#

Gets the uri that will be opened.

Added in version 4.10.

launch(parent: Window | None = None, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) None#

Launch an application to open the uri.

This may present an app chooser dialog to the user.

Added in version 4.10.

Parameters:
  • parent – the parent GtkWindow

  • cancellable – a GCancellable to cancel the operation

  • callback – a callback to call when the operation is complete

  • user_data – data to pass to callback

launch_finish(result: AsyncResult) bool#

Finishes the launch call and returns the result.

Added in version 4.10.

Parameters:

result – a GAsyncResult

set_uri(uri: str | None = None) None#

Sets the uri that will be opened.

Added in version 4.10.

Parameters:

uri – the uri

Properties#

class UriLauncher
props.uri: str#

The type of the None singleton.

Added in version 4.10.