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
FileLauncherGidBuilder builder() static nothrowGet builder for [gtk.file_launcher.FileLauncher] Returns: New builder objectbool alwaysAsk() @property nothrowGet `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) @property nothrowSet `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.void file(gio.file.File propval) @property nothrowSet `file` property. Params: propval = The file to launch.bool writable() @property nothrowGet `writable` property. Returns: Whether to make the file writable for the handler.void writable(bool propval) @property nothrowSet `writable` property. Params: propval = Whether to make the file writable for the handler.bool getAlwaysAsk() nothrowReturns whether to ask the user to choose an app for opening the file. Returns: `TRUE` if always asking for appbool getWritable() nothrowReturns whether to make the file writable for the handler. Returns: `TRUE` if the file will be made writablevoid launch(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowLaunch 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) nothrowLaunch 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) nothrowSets 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.Constructors
this(gio.file.File file = null)Creates a new [gtk.file_launcher.FileLauncher] object.Fluent builder implementation template for gtk.file_launcher.FileLauncher
Methods
T alwaysAsk(bool propval) nothrowSet `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) nothrowSet `file` property. Params: propval = The file to launch. Returns: Builder instance for fluent chainingT writable(bool propval) nothrowSet `writable` property. Params: propval = Whether to make the file writable for the handler. Returns: Builder instance for fluent chainingFluent builder for gtk.file_launcher.FileLauncher
Methods