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_ask ⇒ Boolean

Returns whether to ask the user which app to use.

Returns:

  • (Boolean) —

    true if always asking the user

#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

#file ⇒ Gio::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

Launches an application to open the file.

This may present an app chooser dialog to the user.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • cancellable (Gio::Cancellable) —

    a cancellable 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) —

    the result

Returns:

  • (Boolean) —

    true if an application was launched

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

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.

Parameters:

  • parent (Gtk::Window) —

    the parent window

  • cancellable (Gio::Cancellable) —

    a cancellable 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) —

    the result

Returns:

  • (Boolean) —

    true if an application was launched

#writable ⇒ Boolean

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