Gtk.FileLauncher¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.FileLauncher(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Asynchronous API to open a file with an application.
GtkFileLauncher
collects the arguments that are needed to open the file.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 [method`Gtk`.FileLauncher.launch] function.
To launch uris that don’t represent files, use [class`Gtk`.UriLauncher].
New in version 4.10.
- classmethod new(file)[source]¶
- Parameters:
- Returns:
the new
GtkFileLauncher
- Return type:
Creates a new
GtkFileLauncher
object.New in version 4.10.
- get_always_ask()[source]¶
- Returns:
true if always asking the user
- Return type:
Returns whether to ask the user which app to use.
New in version 4.12.
- get_writable()[source]¶
- Returns:
true if the file will be made writable
- Return type:
Returns whether to make the file writable for the handler.
New in version 4.14.
- launch(parent, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parent windowcancellable (
Gio.Cancellable
orNone
) – a cancellable to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
Launches an application to open the file.
This may present an app chooser dialog to the user.
New in version 4.10.
- launch_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – the result- Raises:
- Returns:
true if an application was launched
- Return type:
Finishes the [method`Gtk`.FileLauncher.launch] call and returns the result.
New in version 4.10.
- open_containing_folder(parent, cancellable, callback, *user_data)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – the parent windowcancellable (
Gio.Cancellable
orNone
) – a cancellable to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
Launches a file manager to show the file in its parent directory.
This is only supported for native files. It will fail if file is e.g. a http:// uri.
New in version 4.10.
- open_containing_folder_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – the result- Raises:
- Returns:
true if an application was launched
- Return type:
Finishes the [method`Gtk`.FileLauncher.open_containing_folder] call and returns the result.
New in version 4.10.
- set_always_ask(always_ask)[source]¶
- Parameters:
always_ask (
bool
) – whether to always ask
Sets whether to always ask the user which app to use.
If false, the file might be opened with a default app or the previous choice.
New in version 4.12.
Property Details¶
- Gtk.FileLauncher.props.always_ask¶
- Name:
always-ask
- Type:
- Default Value:
- Flags:
Whether to ask the user to choose an app for opening the file. If
FALSE
, the file might be opened with a default app or the previous choice.New in version 4.12.
- Gtk.FileLauncher.props.file¶
- Name:
file
- Type:
- Default Value:
- Flags:
The file to launch.
New in version 4.10.