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:
A
GtkFileLauncher
object collects the arguments that are needed to open a file 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 [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 for app- Return type:
Returns whether to ask the user to choose an app for opening the file.
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 parentGtkWindow
cancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
Launch 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
) – aGAsyncResult
- Raises:
- Returns:
TRUE
if an application was launched, orFALSE
and error is set- 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 parentGtkWindow
cancellable (
Gio.Cancellable
orNone
) – aGCancellable
to cancel the operationcallback (
Gio.AsyncReadyCallback
orNone
) – a callback to call when the operation is complete
Launch a file manager to show the file in its parent directory.
This is only supported 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
) – aGAsyncResult
- Raises:
- Returns:
TRUE
if an application was launched, orFALSE
and error is set- 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
) – agboolean
Sets whether to awlays 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.
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.