Struct gtk4::builders::FileDialogBuilder
source · pub struct FileDialogBuilder { /* private fields */ }
v4_10
only.Expand description
A builder-pattern type to construct FileDialog
objects.
Implementations§
source§impl FileDialogBuilder
impl FileDialogBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new FileDialogBuilder
.
sourcepub fn build(self) -> FileDialog
pub fn build(self) -> FileDialog
Build the FileDialog
.
sourcepub fn accept_label(self, accept_label: &str) -> Self
pub fn accept_label(self, accept_label: &str) -> Self
Label for the file chooser’s accept button.
sourcepub fn default_filter(self, default_filter: &FileFilter) -> Self
pub fn default_filter(self, default_filter: &FileFilter) -> Self
The default filter, that is, the filter that is initially active in the file chooser dialog.
If the default filter is None
, the first filter of property::FileDialog::filters
is used as the default filter. If that property contains no filter, the dialog will
be unfiltered.
If property::FileDialog::filters
is not None
, the default filter should be part
of the list. If it is not, the dialog may choose to not make it available.
sourcepub fn filters(self, filters: &impl IsA<ListModel>) -> Self
pub fn filters(self, filters: &impl IsA<ListModel>) -> Self
The list of filters.
See property::FileDialog::default-filter
about how those two properties interact.
sourcepub fn initial_file(self, initial_file: &impl IsA<File>) -> Self
pub fn initial_file(self, initial_file: &impl IsA<File>) -> Self
The inital file, that is, the file that is initially selected in the file chooser dialog
This is a utility property that sets both property::FileDialog::initial-folder
and
property::FileDialog::initial-name
.
sourcepub fn initial_folder(self, initial_folder: &impl IsA<File>) -> Self
pub fn initial_folder(self, initial_folder: &impl IsA<File>) -> Self
The inital folder, that is, the directory that is initially opened in the file chooser dialog
sourcepub fn initial_name(self, initial_name: &str) -> Self
pub fn initial_name(self, initial_name: &str) -> Self
The inital name, that is, the filename that is initially selected in the file chooser dialog.
sourcepub fn shortcut_folders(self, shortcut_folders: &impl IsA<ListModel>) -> Self
pub fn shortcut_folders(self, shortcut_folders: &impl IsA<ListModel>) -> Self
The list of shortcut folders.
Trait Implementations§
source§impl Clone for FileDialogBuilder
impl Clone for FileDialogBuilder
source§fn clone(&self) -> FileDialogBuilder
fn clone(&self) -> FileDialogBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more