## ThunarApplication ThunarApplication |

## Functions

ThunarApplication * | thunar_application_get ()
void | thunar_application_quit ()
gboolean | thunar_application_get_daemon ()
void | thunar_application_set_daemon ()
GList * | thunar_application_get_windows ()
gboolean | thunar_application_has_windows ()
void | thunar_application_close_all_windows ()
void | thunar_application_take_window ()
GtkWidget * | thunar_application_open_window ()
gboolean | thunar_application_bulk_rename ()
gboolean | thunar_application_process_filenames ()
void | thunar_application_rename_file ()
void | thunar_application_create_file ()
void | thunar_application_create_file_from_template ()
void | thunar_application_copy_to ()
void | thunar_application_copy_into ()
void | thunar_application_link_into ()
void | thunar_application_move_into ()
void | thunar_application_move_files ()
gboolean | thunar_application_unlink_files ()
void | thunar_application_trash ()
void | thunar_application_creat ()
void | thunar_application_mkdir ()
void | thunar_application_empty_trash ()
void | thunar_application_restore_files ()
ThunarThumbnailCache * | thunar_application_get_thumbnail_cache ()

## Properties

gboolean | daemon | Read / Write

## Types and Values

enum | ThunarApplicationProcessAction

## Object Hierarchy

        GObject
        ╰── GApplication
            ╰── GtkApplication
                ╰── ThunarApplication

## Description

## Functions

### thunar_application_get ()

    ThunarApplication *
    thunar_application_get (void);

Returns the global shared ThunarApplication instance. This method takes a reference on the global instance for the caller, so you must call `g_object_unref()` on it when done.

#### Returns

the shared ThunarApplication instance.

### thunar_application_quit ()

    void
    thunar_application_quit (ThunarApplication *application);

Attempts to exit daemon mode(required if application is on hold) and leaves the gtk main loop

#### Parameters

application | a ThunarApplication. |

### thunar_application_get_daemon ()

    gboolean
    thunar_application_get_daemon (ThunarApplication *application);

Returns `TRUE` if `application` is in daemon mode.

#### Parameters

application | a ThunarApplication. |

#### Returns

`TRUE` if `application` is in daemon mode.

### thunar_application_set_daemon ()

    void
    thunar_application_set_daemon (ThunarApplication *application,
                                   gboolean daemon);

If `daemon` is `TRUE`, `application` will be set into daemon mode.

#### Parameters

application | a ThunarApplication. |
daemonize | `TRUE` to set `application` into daemon mode. |

### thunar_application_get_windows ()

    GList *
    thunar_application_get_windows (ThunarApplication *application);

Returns the list of regular ThunarWindows currently handled by `application` . The returned list is owned by the caller and must be freed using `g_list_free()`.

#### Parameters

application | a ThunarApplication. |

#### Returns

the list of regular ThunarWindows in `application` .

### thunar_application_has_windows ()

    gboolean
    thunar_application_has_windows (ThunarApplication *application);

Returns `TRUE` if `application` controls atleast one window.

#### Parameters

application | a ThunarApplication. |

#### Returns

`TRUE` if `application` controls atleast one window.

### thunar_application_close_all_windows ()

    void
    thunar_application_close_all_windows (ThunarApplication *application);

Closes all ThunarWindows currently handled by `application` .

#### Parameters

application | a ThunarApplication. |

### thunar_application_take_window ()

    void
    thunar_application_take_window (ThunarApplication *application,
                                    GtkWindow *window);

Lets `application` take over control of the specified `window` . `application` will not exit until the last controlled GtkWindow is closed by the user.

If the `window` has no transient window, it will also create a new GtkWindowGroup for this window. This will make different windows work independant (think gtk_dialog_run).

#### Parameters

application | a ThunarApplication. |
window | a GtkWindow. |

### thunar_application_open_window ()

    GtkWidget *
    thunar_application_open_window (ThunarApplication *application,
                                    ThunarFile *directory,
                                    GdkScreen *screen,
                                    const gchar *startup_id,
                                    gboolean force_new_window);

Opens a new ThunarWindow (or tab if preferred) for `application` , displaying the given `directory` .

#### Parameters

application | a ThunarApplication. |
directory | the directory to open. |
screen | the GdkScreen on which to open the window or `NULL` to open on the default screen. |
startup_id | startup id from startup notification passed along with dbus to make focus stealing work properly. |
force_new_window | set this flag to force a new window, even if misc-open-new-window-as-tab is set |

#### Returns

the newly allocated ThunarWindow.

### thunar_application_bulk_rename ()

    gboolean
    thunar_application_bulk_rename (ThunarApplication *application,
                                    const gchar *working_directory,
                                    gchar **filenames,
                                    gboolean standalone,
                                    GdkScreen *screen,
                                    const gchar *startup_id,
                                    GError **error);

Tries to popup the bulk rename dialog.

#### Parameters

application | a ThunarApplication. |
working_directory | the default working directory for the bulk rename dialog. |
filenames | the list of file names that should be renamed or the empty list to start with an empty rename dialog. The file names can either be absolute paths, supported URIs or relative file names to `working_directory` . |
standalone | `TRUE` to display the bulk rename dialog like a standalone application. |
screen | the GdkScreen on which to rename the `filenames` or `NULL` to use the default GdkScreen. |
startup_id | startup notification id to properly finish startup notification and focus the window when focus stealing is enabled or `NULL`. |
error | return location for errors or `NULL`. |

#### Returns

`TRUE` if the dialog was opened successfully, otherwise `FALSE`.

### thunar_application_process_filenames ()

    gboolean
    thunar_application_process_filenames (ThunarApplication *application,
                                          const gchar *working_directory,
                                          gchar **filenames,
                                          GdkScreen *screen,
                                          const gchar *startup_id,
                                          GError **error,
                                          ThunarApplicationProcessAction action);

Tells `application` to process the given `filenames` and launch them appropriately.

#### Parameters

application | a ThunarApplication. |
working_directory | the working directory relative to which the `filenames` should be interpreted. |
filenames | a list of supported URIs or filenames. If a filename is specified it can be either an absolute path or a path relative to the `working_directory` . |
screen | the GdkScreen on which to process the `filenames` , or `NULL` to use the default screen. |
startup_id | startup id to finish startup notification and properly focus the window when focus stealing is enabled or `NULL`. |
error | return location for errors or `NULL`. |
action | action to invoke on the files |

#### Returns

`TRUE` on success, `FALSE` if `error` is set.

### thunar_application_rename_file ()

    void
    thunar_application_rename_file (ThunarApplication *application,
                                    ThunarFile *file,
                                    GdkScreen *screen,
                                    const gchar *startup_id,
                                    ThunarOperationLogMode log_mode);

Prompts the user to rename the `file` .

#### Parameters

application | a ThunarApplication. |
file | a ThunarFile to be renamed. |
screen | the GdkScreen on which to open the window or `NULL` to open on the default screen. |
startup_id | startup id from startup notification passed along with dbus to make focus stealing work properly. |
log_mode | a ThunarOperationLogMode to control logging of the operation |

### thunar_application_create_file ()

    void
    thunar_application_create_file (ThunarApplication *application,
                                    ThunarFile *parent_directory,
                                    const gchar *content_type,
                                    GdkScreen *screen,
                                    const gchar *startup_id,
                                    ThunarOperationLogMode log_mode);

Prompts the user to create a new file or directory in `parent_directory` . The `content_type` defines the icon and other elements in the filename prompt dialog.

#### Parameters

application | a ThunarApplication. |
parent_directory | the ThunarFile of the parent directory. |
content_type | the content type of the new file. |
screen | the GdkScreen on which to open the window or `NULL` to open on the default screen. |
startup_id | startup id from startup notification passed along with dbus to make focus stealing work properly. |
log_mode | a ThunarOperationLogMode to control logging |

### thunar_application_create_file_from_template ()

    void
    thunar_application_create_file_from_template
                                   (ThunarApplication *application,
                                    ThunarFile *parent_directory,
                                    ThunarFile *template_file,
                                    GdkScreen *screen,
                                    const gchar *startup_id,
                                    ThunarOperationLogMode log_mode);

Prompts the user to create a new file or directory in `parent_directory` from an existing `template_file` which predefines the name and extension in the create dialog.

#### Parameters

application | a ThunarApplication. |
parent_directory | the ThunarFile of the parent directory. |
template_file | the ThunarFile of the template. |
screen | the GdkScreen on which to open the window or `NULL` to open on the default screen. |
startup_id | startup id from startup notification passed along with dbus to make focus stealing work properly. |
log_mode | a ThunarOperationLogMode to control logging |

### thunar_application_copy_to ()

    void
    thunar_application_copy_to (ThunarApplication *application,
                                gpointer parent,
                                GList *source_file_list,
                                GList *target_file_list,
                                ThunarOperationLogMode log_mode,
                                GClosure *new_files_closure);

Copies all files from `source_file_list` to their locations specified in `target_file_list` .

`source_file_list` and `target_file_list` must be of the same length.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
source_file_list | the lst of GFiles that should be copied. |
target_file_list | the list of GFiles where files should be copied to. |
log_mode | a ThunarOperationLogMode controlling the logging of the operation. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |

### thunar_application_copy_into ()

    void
    thunar_application_copy_into (ThunarApplication *application,
                                  gpointer parent,
                                  GList *source_file_list,
                                  GFile *target_file,
                                  ThunarOperationLogMode log_mode,
                                  GClosure *new_files_closure);

Copies all files referenced by the `source_file_list` to the directory referenced by `target_file` . This method takes care of all user interaction.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
source_file_list | the list of GFiles that should be copied. |
target_file | the GFile to the target directory. |
log_mode | a ThunarOperationLogMode controlling the logging of the operation. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |

### thunar_application_link_into ()

    void
    thunar_application_link_into (ThunarApplication *application,
                                  gpointer parent,
                                  GList *source_file_list,
                                  GFile *target_file,
                                  ThunarOperationLogMode log_mode,
                                  GClosure *new_files_closure);

Symlinks all files referenced by the `source_file_list` to the directory referenced by `target_file` . This method takes care of all user interaction.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
source_file_list | the list of GFiles that should be symlinked. |
target_file | the target directory. |
log_mode | A ThunarOperationLogMode enum to control logging. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |

### thunar_application_move_into ()

    void
    thunar_application_move_into (ThunarApplication *application,
                                  gpointer parent,
                                  GList *source_file_list,
                                  GFile *target_file,
                                  ThunarOperationLogMode log_mode,
                                  GClosure *new_files_closure);

Moves all files referenced by the `source_file_list` to the directory referenced by `target_file` . This method takes care of all user interaction.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
source_file_list | the list of GFiles that should be moved. |
target_file | the target directory. |
log_mode | A ThunarOperationLogMode enum to control logging. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |

### thunar_application_move_files ()

    void
    thunar_application_move_files (ThunarApplication *application,
                                   gpointer parent,
                                   GList *source_file_list,
                                   GList *target_file_list,
                                   ThunarOperationLogMode log_mode,
                                   GClosure *new_files_closure);

Moves all the files in the source file list to the files given in the target file list.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
source_file_list | the list of GFiles that should be moved. |
target_file_list | the list of GFiles that the files should be moved to |
log_mode | a ThunarOperationLogMode controlling the logging of the operation. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |

### thunar_application_unlink_files ()

    gboolean
    thunar_application_unlink_files (ThunarApplication *application,
                                     gpointer parent,
                                     GList *file_list,
                                     gboolean permanently,
                                     gboolean warn);

Deletes all files in the `file_list` and takes care of all user interaction.

If the user pressed the shift key while triggering the delete action, the files will be deleted permanently (after confirming the action), otherwise the files will be moved to the trash.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
file_list | the list of ThunarFiles that should be deleted. |
permanently | whether to unlink the files permanently. |
warn | whether to warn the user if deleting permanently. |

#### Returns

TRUE if the trash/delete operation was canceled, FALSE otehrwise

### thunar_application_trash ()

    void
    thunar_application_trash (ThunarApplication *application,
                              gpointer parent,
                              GList *file_list,
                              ThunarOperationLogMode log_mode);

### thunar_application_creat ()

    void
    thunar_application_creat (ThunarApplication *application,
                              gpointer parent,
                              GList *file_list,
                              GFile *template_file,
                              GClosure *new_files_closure,
                              ThunarOperationLogMode log_mode);

Creates empty files for all GFiles listed in `file_list` . This method takes care of all user interaction.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
file_list | the list of files to create. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |
log_mode | a ThunarOperationLogMode to control logging |

### thunar_application_mkdir ()

    void
    thunar_application_mkdir (ThunarApplication *application,
                              gpointer parent,
                              GList *file_list,
                              GClosure *new_files_closure,
                              ThunarOperationLogMode log_mode);

Creates all directories referenced by the `file_list` . This method takes care of all user interaction.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
file_list | the list of directories to create. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |
log_mode | a ThunarOperationLogMode to control logging |

### thunar_application_empty_trash ()

    void
    thunar_application_empty_trash (ThunarApplication *application,
                                    gpointer parent,
                                    const gchar *startup_id);

Deletes all files and folders in the Trash after asking the user to confirm the operation.

#### Parameters

application | a ThunarApplication. |
parent | the parent, which can either be the associated GtkWidget, the screen on which display the progress and the confirmation, or `NULL`. |

### thunar_application_restore_files ()

    void
    thunar_application_restore_files (ThunarApplication *application,
                                      gpointer parent,
                                      GList *trash_file_list,
                                      GClosure *new_files_closure);

Restores all ThunarFiles in the `trash_file_list` to their original location.

#### Parameters

application | a ThunarApplication. |
parent | a GdkScreen, a GtkWidget or `NULL`. |
trash_file_list | a GList of ThunarFiles in the trash. |
new_files_closure | a GClosure to connect to the job's "new-files" signal, which will be emitted when the job finishes with the list of GFiles created by the job, or `NULL` if you're not interested in the signal. |

### thunar_application_get_thumbnail_cache ()

    ThunarThumbnailCache *
    thunar_application_get_thumbnail_cache
                                   (ThunarApplication *application);

## Types and Values

### enum ThunarApplicationProcessAction

#### Members

THUNAR_APPLICATION_LAUNCH_FILES |  |
THUNAR_APPLICATION_SELECT_FILES |  |

## Property Details

### The `“daemon”` property

      “daemon”                   gboolean

`TRUE` if the application should be run in daemon mode, in which case it will never terminate. `FALSE` if the application should terminate once the last window is closed.

Owner: ThunarApplication

Flags: Read / Write

Default value: FALSE