-
public void add_filter (FileFilter filter)
Adds filter to the list of filters that the user can select between. When a filter is
selected, only files that are passed by that filter are displayed.
-
public bool add_shortcut_folder (string folder) throws Error
Adds a folder to be displayed with the shortcut folders in a file chooser. Note that shortcut folders
do not get saved, as they are provided by the application. For example, you can use this to add a "/usr/share/mydrawprogram/Clipart"
folder to the volume list.
-
public bool add_shortcut_folder_uri (string uri) throws Error
Adds a folder URI to be displayed with the shortcut folders in a file chooser. Note that shortcut
folders do not get saved, as they are provided by the application. For example, you can use this to add a
"file:///usr/share/mydrawprogram/Clipart" folder to the volume list.
-
public FileChooserAction get_action ()
Gets the type of operation that the file chooser is performing; see
set_action.
-
public bool get_create_folders ()
-
public string get_current_folder ()
-
public weak File get_current_folder_file ()
-
public string get_current_folder_uri ()
-
public bool get_do_overwrite_confirmation ()
Queries whether a file chooser is set to confirm for overwriting when the user types a file name that
already exists.
-
public weak Widget get_extra_widget ()
-
public weak File get_file ()
Gets the File for the currently selected
file in the file selector. If multiple files are selected, one of the files will be returned at random.
-
public string get_filename ()
Gets the filename for the currently selected file in the file selector. If multiple files are
selected, one of the filenames will be returned at random.
-
public SList<string> get_filenames ()
Lists all the selected files and subfolders in the current folder of chooser. The
returned names are full absolute paths. If files in the current folder cannot be represented as local filenames they will be
ignored. (See get_uris)
-
public SList<File> get_files ()
Lists all the selected files and subfolders in the current folder of chooser as
File. An internal function, see
get_uris.
-
public weak FileFilter get_filter ()
-
public bool get_local_only ()
Gets whether only local files can be selected in the file selector. See
set_local_only
-
public weak File get_preview_file ()
Gets the File that should be previewed in a
custom preview Internal function, see get_preview_uri.
-
public string get_preview_filename ()
Gets the filename that should be previewed in a custom preview widget. See
set_preview_widget.
-
public string get_preview_uri ()
-
public weak Widget get_preview_widget ()
-
public bool get_preview_widget_active ()
-
public bool get_select_multiple ()
-
public bool get_show_hidden ()
Gets whether hidden files and folders are displayed in the file selector. See
set_show_hidden.
-
public string get_uri ()
Gets the URI for the currently selected file in the file selector. If multiple files are selected, one
of the filenames will be returned at random.
-
public SList<string> get_uris ()
Lists all the selected files and subfolders in the current folder of chooser. The
returned names are full absolute URIs.
-
public bool get_use_preview_label ()
Gets whether a stock label should be drawn with the name of the previewed file. See
set_use_preview_label.
-
public SList<weak FileFilter> list_filters ()
-
public SList<string>? list_shortcut_folder_uris ()
-
public SList<string>? list_shortcut_folders ()
-
public void remove_filter (FileFilter filter)
Removes filter from the list of filters that the user can select between.
-
public bool remove_shortcut_folder (string folder) throws Error
Removes a folder from a file chooser's list of shortcut folders.
-
public bool remove_shortcut_folder_uri (string uri) throws Error
Removes a folder URI from a file chooser's list of shortcut folders.
-
public void select_all ()
Selects all the files in the current folder of a file chooser.
-
public bool select_file (File file) throws Error
Selects the file referred to by file. An internal function. See
_gtk_file_chooser_select_uri().
-
public bool select_filename (string filename)
Selects a filename. If the file name isn't in the current folder of chooser, then the
current folder of chooser will be changed to the folder containing filename.
-
public bool select_uri (string uri)
Selects the file to by uri. If the URI doesn't refer to a file in the current folder of
chooser, then the current folder of chooser will be changed to the folder containing filename
.
-
public void set_action (FileChooserAction action)
Sets the type of operation that the chooser is performing; the user interface is adapted to suit the
selected action. For example, an option to create a new folder might be shown if the action is
SAVE but not if the action is
OPEN.
-
public void set_create_folders (bool create_folders)
Sets whether file choser will offer to create new folders. This is only relevant if the action is not
set to be OPEN.
-
public bool set_current_folder (string filename)
Sets the current folder for chooser from a local filename. The user will be shown the
full contents of the current folder, plus user interface elements for navigating to other folders.
-
public bool set_current_folder_file (File file) throws Error
-
public bool set_current_folder_uri (string uri)
Sets the current folder for chooser from an URI. The user will be shown the full contents
of the current folder, plus user interface elements for navigating to other folders.
-
public void set_current_name (string name)
Sets the current name in the file selector, as if entered by the user. Note that the name passed in
here is a UTF-8 string rather than a filename. This function is meant for such uses as a suggested name in a "Save As..." dialog.
-
public void set_do_overwrite_confirmation (bool do_overwrite_confirmation)
Sets whether a file chooser in SAVE
mode will present a confirmation dialog if the user types a file name that already exists. This is false by default.
-
public void set_extra_widget (Widget extra_widget)
Sets an application-supplied widget to provide extra options to the user.
-
public bool set_file (File file) throws Error
Sets file as the current filename for the file chooser, by changing to the file's parent
folder and actually selecting the file in list. If the chooser is in
SAVE mode, the file's base name will also appear in the dialog's
file name entry.
-
public bool set_filename (string filename)
Sets filename as the current filename for the file chooser, by changing to the file's
parent folder and actually selecting the file in list. If the chooser is in
SAVE mode, the file's base name will also appear in the dialog's
file name entry.
-
public void set_filter (FileFilter filter)
Sets the current filter; only the files that pass the filter will be displayed. If the user-selectable
list of filters is non-empty, then the filter should be one of the filters in that list. Setting the current filter when the list of
filters is empty is useful if you want to restrict the displayed set of files without letting the user change it.
-
public void set_local_only (bool local_only)
Sets whether only local files can be selected in the file selector. If local_only is
true (the default), then the selected file are files are guaranteed to be accessible through the operating systems
native file file system and therefore the application only needs to worry about the filename functions in
FileChooser, like
get_filename, rather than the URI functions like get_uri,
-
public void set_preview_widget (Widget preview_widget)
Sets an application-supplied widget to use to display a custom preview of the currently selected file.
To implement a preview, after setting the preview widget, you connect to the
update_preview signal, and call
get_preview_filename or
get_preview_uri on each change. If you can display a preview of
the new file, update your widget and set the preview active using
set_preview_widget_active. Otherwise, set the preview
inactive.
-
public void set_preview_widget_active (bool active)
Sets whether the preview widget set by
set_preview_widget should be shown for the current filename.
When active is set to false, the file chooser may display an internally generated preview of the current file or it may
display no preview at all. See set_preview_widget for more
details.
-
public void set_select_multiple (bool select_multiple)
Sets whether multiple files can be selected in the file selector. This is only relevant if the action
is set to be OPEN or
SELECT_FOLDER.
-
public void set_show_hidden (bool show_hidden)
Sets whether hidden files and folders are displayed in the file selector.
-
public bool set_uri (string uri)
Sets the file referred to by uri as the current file for the file chooser, by changing to
the URI's parent folder and actually selecting the URI in the list. If the chooser is
SAVE mode, the URI's base name will also appear in the dialog's file
name entry.
-
public void set_use_preview_label (bool use_label)
Sets whether the file chooser should display a stock label with the name of the file that is being
previewed; the default is true. Applications that want to draw the whole preview area themselves should set this to
false and display the name themselves in their preview widget.
-
public void unselect_all ()
Unselects all the files in the current folder of a file chooser.
-
public void unselect_file (File file)
Unselects the file referred to by file. If the file is not in the current directory, does
not exist, or is otherwise not currently selected, does nothing.
-
public void unselect_filename (string filename)
Unselects a currently selected filename. If the filename is not in the current directory, does not
exist, or is otherwise not currently selected, does nothing.
-
public void unselect_uri (string uri)
Unselects the file referred to by uri. If the file is not in the current directory, does
not exist, or is otherwise not currently selected, does nothing.