gtk.file_launcher

Module for [FileLauncher] class

Types 3

A [gtk.file_launcher.FileLauncher] 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 [gtk.file_launcher.FileLauncher.launch] function. This API follows the GIO async pattern, and the result can be obtained by calling [gtk.file_launcher.FileLauncher.launchFinish].

To launch uris that don't represent files, use [gtk.uri_launcher.UriLauncher].

Methods
GType _gType() @property
FileLauncher self()Returns `this`, for use in `with` statements.
FileLauncherGidBuilder builder()Get builder for [gtk.file_launcher.FileLauncher] Returns: New builder object
bool alwaysAsk() @propertyGet `alwaysAsk` property. Returns: 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.
void alwaysAsk(bool propval) @propertySet `alwaysAsk` property. Params: propval = 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.
gio.file.File file() @propertyGet `file` property. Returns: The file to launch.
void file(gio.file.File propval) @propertySet `file` property. Params: propval = The file to launch.
bool writable() @propertyGet `writable` property. Returns: Whether to make the file writable for the handler.
void writable(bool propval) @propertySet `writable` property. Params: propval = Whether to make the file writable for the handler.
bool getAlwaysAsk()Returns whether to ask the user to choose an app for opening the file. Returns: `TRUE` if always asking for app
gio.file.File getFile()Gets the file that will be opened. Returns: the file
bool getWritable()Returns whether to make the file writable for the handler. Returns: `TRUE` if the file will be made writable
void launch(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Launch an application to open the file.
bool launchFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_launcher.FileLauncher.launch] call and returns the result.
void openContainingFolder(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Launch a file manager to show the file in its parent directory.
bool openContainingFolderFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_launcher.FileLauncher.openContainingFolder] call and returns the result.
void setAlwaysAsk(bool alwaysAsk)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.
void setFile(gio.file.File file = null)Sets the file that will be opened.
void setWritable(bool writable)Sets whether to make the file writable for the handler.
Constructors
this(void * ptr, Flag!"Take" take)
this(gio.file.File file = null)Creates a new [gtk.file_launcher.FileLauncher] object.
Methods
T alwaysAsk(bool propval)Set `alwaysAsk` property. Params: propval = 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. Returns: B...
T file(gio.file.File propval)Set `file` property. Params: propval = The file to launch. Returns: Builder instance for fluent chaining
T writable(bool propval)Set `writable` property. Params: propval = Whether to make the file writable for the handler. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.file_launcher.FileLauncher]