Class: Gtk::FileLauncher

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Gtk::FileLauncher

Creates a new GtkFileLauncher object.

Parameters:

  • file (Gio::File)

    the file to open

Instance Method Details

#always_askBoolean

Returns whether to ask the user to choose an app for opening the file.

Returns:

  • (Boolean)

    TRUE if always asking for app

#always_ask=(always_ask) ⇒ Boolean

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.

Parameters:

  • always_ask (Boolean)

Returns:

  • (Boolean)

    always-ask

  • (Boolean)

    always-ask

#always_ask?Boolean

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:

  • (Boolean)

    always-ask

#fileGio::File

The file to launch.

Returns:

  • (Gio::File)

    file

#file=(file) ⇒ Gio::File

The file to launch.

Parameters:

  • file (Gio::File)

Returns:

  • (Gio::File)

    file

  • (Gio::File)

    file

#launch(parent, cancellable, callback, user_data) ⇒ nil

Launch an application to open the file.

This may present an app chooser dialog to the user.

The callback will be called when the operation is completed. It should call [methodGtk.FileLauncher.launch_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#launch_finish(result) ⇒ Boolean

Finishes the [methodGtk.FileLauncher.launch] call and returns the result.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Boolean)

    TRUE if an application was launched, or FALSE and error is set

#open_containing_folder(parent, cancellable, callback, user_data) ⇒ nil

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.

The callback will be called when the operation is completed. It should call [methodGtk.FileLauncher.open_containing_folder_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#open_containing_folder_finish(result) ⇒ Boolean

Finishes the [methodGtk.FileLauncher.open_containing_folder] call and returns the result.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Boolean)

    TRUE if an application was launched, or FALSE and error is set

#writableBoolean

Returns whether to make the file writable for the handler.

Returns:

  • (Boolean)

    TRUE if the file will be made writable

#writable=(writable) ⇒ Boolean

Whether to make the file writable for the handler.

Parameters:

  • writable (Boolean)

Returns:

  • (Boolean)

    writable

  • (Boolean)

    writable

#writable?Boolean

Whether to make the file writable for the handler.

Returns:

  • (Boolean)

    writable