gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.FileDialog

Contents

- Exported types
- Methods
  - getAcceptLabel
  - getDefaultFilter
  - getFilters
  - getInitialFile
  - getInitialFolder
  - getInitialName
  - getModal
  - getTitle
  - new
  - open
  - openFinish
  - openMultiple
  - openMultipleFinish
  - openMultipleTextFiles
  - openMultipleTextFilesFinish
  - openTextFile
  - openTextFileFinish
  - save
  - saveFinish
  - saveTextFile
  - saveTextFileFinish
  - selectFolder
  - selectFolderFinish
  - selectMultipleFolders
  - selectMultipleFoldersFinish
  - setAcceptLabel
  - setDefaultFilter
  - setFilters
  - setInitialFile
  - setInitialFolder
  - setInitialName
  - setModal
  - setTitle
- Properties
  - acceptLabel
  - defaultFilter
  - filters
  - initialFile
  - initialFolder
  - initialName
  - modal
  - title

Description

Asynchronous API to present a file chooser dialog.

`GtkFileDialog` collects the arguments that are needed to present the dialog to the user, such as a title for the dialog and whether it should be modal.

The dialog is shown with `fileDialogOpen`, `fileDialogSave`, etc.

Since: 4.10

Synopsis

- newtype FileDialog = FileDialog (ManagedPtr FileDialog)
- class (GObject o, IsDescendantOf FileDialog o) => IsFileDialog o
- toFileDialog :: (MonadIO m, IsFileDialog o) => o -> m FileDialog
- fileDialogGetAcceptLabel :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m (Maybe Text)
- fileDialogGetDefaultFilter :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m (Maybe FileFilter)
- fileDialogGetFilters :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m (Maybe ListModel)
- fileDialogGetInitialFile :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m (Maybe File)
- fileDialogGetInitialFolder :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m (Maybe File)
- fileDialogGetInitialName :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m (Maybe Text)
- fileDialogGetModal :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m Bool
- fileDialogGetTitle :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> m Text
- fileDialogNew :: (HasCallStack, MonadIO m) => m FileDialog
- fileDialogOpen :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogOpenFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m File
- fileDialogOpenMultiple :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogOpenMultipleFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m ListModel
- fileDialogOpenMultipleTextFiles :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogOpenMultipleTextFilesFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m (ListModel, Text)
- fileDialogOpenTextFile :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogOpenTextFileFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m (File, Text)
- fileDialogSave :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogSaveFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m File
- fileDialogSaveTextFile :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogSaveTextFileFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m (File, Text, Text)
- fileDialogSelectFolder :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogSelectFolderFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m File
- fileDialogSelectMultipleFolders :: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileDialogSelectMultipleFoldersFinish :: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) => a -> b -> m ListModel
- fileDialogSetAcceptLabel :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> Maybe Text -> m ()
- fileDialogSetDefaultFilter :: (HasCallStack, MonadIO m, IsFileDialog a, IsFileFilter b) => a -> Maybe b -> m ()
- fileDialogSetFilters :: (HasCallStack, MonadIO m, IsFileDialog a, IsListModel b) => a -> Maybe b -> m ()
- fileDialogSetInitialFile :: (HasCallStack, MonadIO m, IsFileDialog a, IsFile b) => a -> Maybe b -> m ()
- fileDialogSetInitialFolder :: (HasCallStack, MonadIO m, IsFileDialog a, IsFile b) => a -> Maybe b -> m ()
- fileDialogSetInitialName :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> Maybe Text -> m ()
- fileDialogSetModal :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> Bool -> m ()
- fileDialogSetTitle :: (HasCallStack, MonadIO m, IsFileDialog a) => a -> Text -> m ()
- clearFileDialogAcceptLabel :: (MonadIO m, IsFileDialog o) => o -> m ()
- constructFileDialogAcceptLabel :: (IsFileDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getFileDialogAcceptLabel :: (MonadIO m, IsFileDialog o) => o -> m (Maybe Text)
- setFileDialogAcceptLabel :: (MonadIO m, IsFileDialog o) => o -> Text -> m ()
- clearFileDialogDefaultFilter :: (MonadIO m, IsFileDialog o) => o -> m ()
- constructFileDialogDefaultFilter :: (IsFileDialog o, MonadIO m, IsFileFilter a) => a -> m (GValueConstruct o)
- getFileDialogDefaultFilter :: (MonadIO m, IsFileDialog o) => o -> m (Maybe FileFilter)
- setFileDialogDefaultFilter :: (MonadIO m, IsFileDialog o, IsFileFilter a) => o -> a -> m ()
- clearFileDialogFilters :: (MonadIO m, IsFileDialog o) => o -> m ()
- constructFileDialogFilters :: (IsFileDialog o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o)
- getFileDialogFilters :: (MonadIO m, IsFileDialog o) => o -> m (Maybe ListModel)
- setFileDialogFilters :: (MonadIO m, IsFileDialog o, IsListModel a) => o -> a -> m ()
- clearFileDialogInitialFile :: (MonadIO m, IsFileDialog o) => o -> m ()
- constructFileDialogInitialFile :: (IsFileDialog o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getFileDialogInitialFile :: (MonadIO m, IsFileDialog o) => o -> m (Maybe File)
- setFileDialogInitialFile :: (MonadIO m, IsFileDialog o, IsFile a) => o -> a -> m ()
- clearFileDialogInitialFolder :: (MonadIO m, IsFileDialog o) => o -> m ()
- constructFileDialogInitialFolder :: (IsFileDialog o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getFileDialogInitialFolder :: (MonadIO m, IsFileDialog o) => o -> m (Maybe File)
- setFileDialogInitialFolder :: (MonadIO m, IsFileDialog o, IsFile a) => o -> a -> m ()
- clearFileDialogInitialName :: (MonadIO m, IsFileDialog o) => o -> m ()
- constructFileDialogInitialName :: (IsFileDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getFileDialogInitialName :: (MonadIO m, IsFileDialog o) => o -> m (Maybe Text)
- setFileDialogInitialName :: (MonadIO m, IsFileDialog o) => o -> Text -> m ()
- constructFileDialogModal :: (IsFileDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFileDialogModal :: (MonadIO m, IsFileDialog o) => o -> m Bool
- setFileDialogModal :: (MonadIO m, IsFileDialog o) => o -> Bool -> m ()
- constructFileDialogTitle :: (IsFileDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getFileDialogTitle :: (MonadIO m, IsFileDialog o) => o -> m Text
- setFileDialogTitle :: (MonadIO m, IsFileDialog o) => o -> Text -> m ()

# Exported types

newtype FileDialog Source #

Memory-managed wrapper type.

Constructors

FileDialog (ManagedPtr FileDialog) |

#### Instances

Instances details

Eq FileDialog Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog Methods (==) :: FileDialog -> FileDialog -> Bool Source # (/=) :: FileDialog -> FileDialog -> Bool Source #
GObject FileDialog Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog
ManagedPtrNewtype FileDialog Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog Methods toManagedPtr :: FileDialog -> ManagedPtr FileDialog Source #
TypedObject FileDialog Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog Methods glibType :: IO GType Source #
HasParentTypes FileDialog Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog
IsGValue (Maybe FileDialog) Source # | Convert `FileDialog` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.FileDialog Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe FileDialog -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe FileDialog) Source #
type ParentTypes FileDialog Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog type ParentTypes FileDialog = '[Object]

class (GObject o, IsDescendantOf FileDialog o) => IsFileDialog o Source #

Type class for types which can be safely cast to `FileDialog`, for instance with `toFileDialog`.

#### Instances

Instances details

(GObject o, IsDescendantOf FileDialog o) => IsFileDialog o Source # |
Instance details Defined in GI.Gtk.Objects.FileDialog

toFileDialog :: (MonadIO m, IsFileDialog o) => o -> m FileDialog Source #

Cast to `FileDialog`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, open, openFinish, openMultiple, openMultipleFinish, openMultipleTextFiles, openMultipleTextFilesFinish, openTextFile, openTextFileFinish, ref, refSink, runDispose, save, saveFinish, saveTextFile, saveTextFileFinish, selectFolder, selectFolderFinish, selectMultipleFolders, selectMultipleFoldersFinish, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getAcceptLabel, getData, getDefaultFilter, getFilters, getInitialFile, getInitialFolder, getInitialName, getModal, getProperty, getQdata, getTitle.

#### Setters

setAcceptLabel, setData, setDataFull, setDefaultFilter, setFilters, setInitialFile, setInitialFolder, setInitialName, setModal, setProperty, setTitle.

## getAcceptLabel

fileDialogGetAcceptLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m (Maybe Text) | Returns: the label shown on the file chooser's accept button

Retrieves the text used by the dialog on its accept button.

Since: 4.10

## getDefaultFilter

fileDialogGetDefaultFilter Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m (Maybe FileFilter) | Returns: the default filter

Gets the filter that will be selected by default in the file chooser dialog.

Since: 4.10

## getFilters

fileDialogGetFilters Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m (Maybe ListModel) | Returns: the filters, as a list model of `FileFilter`

Gets the filters that will be offered to the user in the file chooser dialog.

Since: 4.10

## getInitialFile

fileDialogGetInitialFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m (Maybe File) | Returns: the file

Gets the file that will be initially selected in the file chooser dialog.

Since: 4.10

## getInitialFolder

fileDialogGetInitialFolder Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m (Maybe File) | Returns: the folder

Gets the folder that will be set as the initial folder in the file chooser dialog.

Since: 4.10

## getInitialName

fileDialogGetInitialName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m (Maybe Text) | Returns: the name

Gets the filename that will be initially selected.

Since: 4.10

## getModal

fileDialogGetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m Bool | Returns: true if the file chooser dialog is modal

Returns whether the file chooser dialog blocks interaction with the parent window while it is presented.

Since: 4.10

## getTitle

fileDialogGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> m Text | Returns: the title

Returns the title that will be shown on the file chooser dialog.

Since: 4.10

## new

fileDialogNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m FileDialog | Returns: the new `GtkFileDialog`

Creates a new `GtkFileDialog` object.

Since: 4.10

## open

fileDialogOpen Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a file dialog
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a file chooser dialog to the user.

The file chooser dialog will be set up to select a single file.

The `callback` will be called when the dialog is closed.

Since: 4.10

## openFinish

fileDialogOpenFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a file dialog
-> b | `result`: the result
-> m File | Returns: the file that was selected (Can throw `GError`)

Finishes the `fileDialogOpen` call.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

## openMultiple

fileDialogOpenMultiple Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a file dialog
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a file chooser dialog to the user.

The file chooser dialog will be set up to select multiple files.

The file chooser dialog will initially be opened in the directory FileDialog:initialFolder.

The `callback` will be called when the dialog is closed.

Since: 4.10

## openMultipleFinish

fileDialogOpenMultipleFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a file dialog
-> b | `result`: the result
-> m ListModel | Returns: the files that were selected, as a list model of `File` (Can throw `GError`)

Finishes the `fileDialogOpen` call.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

## openMultipleTextFiles

fileDialogOpenMultipleTextFiles Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a file dialog
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a file chooser dialog to the user.

The file chooser dialog will be set up to select multiple files.

The file chooser dialog will initially be opened in the directory FileDialog:initialFolder.

In contrast to `fileDialogOpen`, this function lets the user select the text encoding for the files, if possible.

The `callback` will be called when the dialog is closed.

Since: 4.18

## openMultipleTextFilesFinish

fileDialogOpenMultipleTextFilesFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a file dialog
-> b | `result`: the result
-> m (ListModel, Text) | Returns: the files that were selected, as a list model of `File` (Can throw `GError`)

Finishes the `fileDialogOpen` call.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.18

## openTextFile

fileDialogOpenTextFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a `GtkFileDialog`
-> Maybe b | `parent`: the parent `GtkWindow`
-> Maybe c | `cancellable`: a `GCancellable` to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Initiates a file selection operation by presenting a file chooser dialog to the user.

In contrast to `fileDialogOpen`, this function lets the user select the text encoding for the file, if possible.

The `callback` will be called when the dialog is closed.

Since: 4.18

## openTextFileFinish

fileDialogOpenTextFileFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a `GtkFileDialog`
-> b | `result`: a `GAsyncResult`
-> m (File, Text) | Returns: the file that was selected (Can throw `GError`)

Finishes the `fileDialogOpenTextFile` call and returns the resulting file and text encoding.

If the user has explicitly selected a text encoding to use for the file, then `encoding` will be set to a codeset name that is suitable for passing to `iconv_open()`. Otherwise, it will be `NULL`.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.18

## save

fileDialogSave Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a file dialog
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a file chooser dialog to the user.

The file chooser dialog will be save mode.

The `callback` will be called when the dialog is closed.

Since: 4.10

## saveFinish

fileDialogSaveFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a file dialog
-> b | `result`: the result
-> m File | Returns: the file that was selected (Can throw `GError`)

Finishes the `fileDialogSave` call.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

## saveTextFile

fileDialogSaveTextFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a `GtkFileDialog`
-> Maybe b | `parent`: the parent `GtkWindow`
-> Maybe c | `cancellable`: a `GCancellable` to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Initiates a file save operation by presenting a file chooser dialog to the user.

In contrast to `fileDialogSave`, this function lets the user select the text encoding and line endings for the text file, if possible.

The `callback` will be called when the dialog is closed.

Since: 4.18

## saveTextFileFinish

fileDialogSaveTextFileFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a `GtkFileDialog`
-> b | `result`: a `GAsyncResult`
-> m (File, Text, Text) | Returns: the file that was selected. (Can throw `GError`)

Finishes the `fileDialogSaveTextFile` call and returns the resulting file, text encoding and line endings.

If the user has explicitly selected a text encoding to use for the file, then `encoding` will be set to a codeset name that is suitable for passing to `iconv_open()`. Otherwise, it will be `NULL`.

The `lineEnding` will be set to one of "\n", "\r\n", "\r" or "", where the latter means to preserve existing line endings.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.18

## selectFolder

fileDialogSelectFolder Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a file dialog
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a file chooser dialog to the user.

The file chooser dialog will be set up to select a single folder.

If you pass `initialFolder`, the file chooser dialog will initially be opened in the parent directory of that folder, otherwise, it will be in the directory FileDialog:initialFolder.

The `callback` will be called when the dialog is closed.

Since: 4.10

## selectFolderFinish

fileDialogSelectFolderFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a file dialog
-> b | `result`: the result
-> m File | Returns: the folder that was selected (Can throw `GError`)

Finishes the `fileDialogSelectFolder` call.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

## selectMultipleFolders

fileDialogSelectMultipleFolders Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a file dialog
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a file chooser dialog to the user.

The file chooser dialog will be set up to allow selecting multiple folders.

The file chooser dialog will initially be opened in the directory FileDialog:initialFolder.

The `callback` will be called when the dialog is closed.

Since: 4.10

## selectMultipleFoldersFinish

fileDialogSelectMultipleFoldersFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsAsyncResult b) |
=> a | `self`: a file dialog
-> b | `result`: the result
-> m ListModel | Returns: the folders that were selected, as a list model of `File` (Can throw `GError`)

Finishes the `fileDialogSelectMultipleFolders` call.

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

## setAcceptLabel

fileDialogSetAcceptLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> Maybe Text | `acceptLabel`: the new accept label
-> m () |

Sets the label shown on the file chooser's accept button.

Leaving the accept label unset or setting it as `NULL` will fall back to a default label, depending on what API is used to launch the file dialog.

Since: 4.10

## setDefaultFilter

fileDialogSetDefaultFilter Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsFileFilter b) |
=> a | `self`: a file dialog
-> Maybe b | `filter`: the file filter
-> m () |

Sets the filter that will be selected by default in the file chooser dialog.

If set to `NULL`, the first item in FileDialog:filters will be used as the default filter. If that list is empty, the dialog will be unfiltered.

Since: 4.10

## setFilters

fileDialogSetFilters Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsListModel b) |
=> a | `self`: a file dialog
-> Maybe b | `filters`: a list model of `FileFilter`
-> m () |

Sets the filters that will be offered to the user in the file chooser dialog.

Since: 4.10

## setInitialFile

fileDialogSetInitialFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsFile b) |
=> a | `self`: a file dialog
-> Maybe b | `file`: a file
-> m () |

Sets the file that will be initially selected in the file chooser dialog.

This function is a shortcut for calling both `fileDialogSetInitialFolder` and `fileDialogSetInitialName` with the directory and name of `file`, respectively.

Since: 4.10

## setInitialFolder

fileDialogSetInitialFolder Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a, IsFile b) |
=> a | `self`: a file dialog
-> Maybe b | `folder`: a file
-> m () |

Sets the folder that will be set as the initial folder in the file chooser dialog.

Since: 4.10

## setInitialName

fileDialogSetInitialName Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> Maybe Text | `name`: a string
-> m () |

Sets the filename that will be initially selected.

For save dialogs, `name` will usually be pre-entered into the name field.

If a file with this name already exists in the directory set via FileDialog:initialFolder, the dialog will preselect it.

Since: 4.10

## setModal

fileDialogSetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> Bool | `modal`: the new value
-> m () |

Sets whether the file chooser dialog blocks interaction with the parent window while it is presented.

Since: 4.10

## setTitle

fileDialogSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileDialog a) |
=> a | `self`: a file dialog
-> Text | `title`: the new title
-> m () |

Sets the title that will be shown on the file chooser dialog.

Since: 4.10

# Properties

## acceptLabel

Label for the file chooser's accept button.

Since: 4.10

clearFileDialogAcceptLabel :: (MonadIO m, IsFileDialog o) => o -> m () Source #

Set the value of the “`accept-label`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #acceptLabel

constructFileDialogAcceptLabel :: (IsFileDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`accept-label`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogAcceptLabel :: (MonadIO m, IsFileDialog o) => o -> m (Maybe Text) Source #

Get the value of the “`accept-label`” property. When overloading is enabled, this is equivalent to

    get fileDialog #acceptLabel

setFileDialogAcceptLabel :: (MonadIO m, IsFileDialog o) => o -> Text -> m () Source #

Set the value of the “`accept-label`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #acceptLabel := value ]

## defaultFilter

The default filter.

This filter is initially active in the file chooser dialog.

If the default filter is `NULL`, the first filter of FileDialog:filters is used as the default filter. If that property contains no filter, the dialog will be unfiltered.

If FileDialog:filters is not `NULL`, the default filter should be part of the list. If it is not, the dialog may choose to not make it available.

Since: 4.10

clearFileDialogDefaultFilter :: (MonadIO m, IsFileDialog o) => o -> m () Source #

Set the value of the “`default-filter`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #defaultFilter

constructFileDialogDefaultFilter :: (IsFileDialog o, MonadIO m, IsFileFilter a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`default-filter`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogDefaultFilter :: (MonadIO m, IsFileDialog o) => o -> m (Maybe FileFilter) Source #

Get the value of the “`default-filter`” property. When overloading is enabled, this is equivalent to

    get fileDialog #defaultFilter

setFileDialogDefaultFilter :: (MonadIO m, IsFileDialog o, IsFileFilter a) => o -> a -> m () Source #

Set the value of the “`default-filter`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #defaultFilter := value ]

## filters

The list of filters.

See FileDialog:defaultFilter about how these two properties interact.

Since: 4.10

clearFileDialogFilters :: (MonadIO m, IsFileDialog o) => o -> m () Source #

Set the value of the “`filters`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #filters

constructFileDialogFilters :: (IsFileDialog o, MonadIO m, IsListModel a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`filters`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogFilters :: (MonadIO m, IsFileDialog o) => o -> m (Maybe ListModel) Source #

Get the value of the “`filters`” property. When overloading is enabled, this is equivalent to

    get fileDialog #filters

setFileDialogFilters :: (MonadIO m, IsFileDialog o, IsListModel a) => o -> a -> m () Source #

Set the value of the “`filters`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #filters := value ]

## initialFile

The initial file.

This file is initially selected in the file chooser dialog

This is a utility property that sets both FileDialog:initialFolder and FileDialog:initialName.

Since: 4.10

clearFileDialogInitialFile :: (MonadIO m, IsFileDialog o) => o -> m () Source #

Set the value of the “`initial-file`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #initialFile

constructFileDialogInitialFile :: (IsFileDialog o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`initial-file`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogInitialFile :: (MonadIO m, IsFileDialog o) => o -> m (Maybe File) Source #

Get the value of the “`initial-file`” property. When overloading is enabled, this is equivalent to

    get fileDialog #initialFile

setFileDialogInitialFile :: (MonadIO m, IsFileDialog o, IsFile a) => o -> a -> m () Source #

Set the value of the “`initial-file`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #initialFile := value ]

## initialFolder

The initial folder.

This is the directory that is initially opened in the file chooser dialog.

Since: 4.10

clearFileDialogInitialFolder :: (MonadIO m, IsFileDialog o) => o -> m () Source #

Set the value of the “`initial-folder`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #initialFolder

constructFileDialogInitialFolder :: (IsFileDialog o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`initial-folder`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogInitialFolder :: (MonadIO m, IsFileDialog o) => o -> m (Maybe File) Source #

Get the value of the “`initial-folder`” property. When overloading is enabled, this is equivalent to

    get fileDialog #initialFolder

setFileDialogInitialFolder :: (MonadIO m, IsFileDialog o, IsFile a) => o -> a -> m () Source #

Set the value of the “`initial-folder`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #initialFolder := value ]

## initialName

The initial name.

This is the name of the file that is initially selected in the file chooser dialog.

Since: 4.10

clearFileDialogInitialName :: (MonadIO m, IsFileDialog o) => o -> m () Source #

Set the value of the “`initial-name`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #initialName

constructFileDialogInitialName :: (IsFileDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`initial-name`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogInitialName :: (MonadIO m, IsFileDialog o) => o -> m (Maybe Text) Source #

Get the value of the “`initial-name`” property. When overloading is enabled, this is equivalent to

    get fileDialog #initialName

setFileDialogInitialName :: (MonadIO m, IsFileDialog o) => o -> Text -> m () Source #

Set the value of the “`initial-name`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #initialName := value ]

## modal

Whether the file chooser dialog is modal.

Since: 4.10

constructFileDialogModal :: (IsFileDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`modal`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogModal :: (MonadIO m, IsFileDialog o) => o -> m Bool Source #

Get the value of the “`modal`” property. When overloading is enabled, this is equivalent to

    get fileDialog #modal

setFileDialogModal :: (MonadIO m, IsFileDialog o) => o -> Bool -> m () Source #

Set the value of the “`modal`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #modal := value ]

## title

A title that may be shown on the file chooser dialog.

Since: 4.10

constructFileDialogTitle :: (IsFileDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`title`” property. This is rarely needed directly, but it is used by `new`.

getFileDialogTitle :: (MonadIO m, IsFileDialog o) => o -> m Text Source #

Get the value of the “`title`” property. When overloading is enabled, this is equivalent to

    get fileDialog #title

setFileDialogTitle :: (MonadIO m, IsFileDialog o) => o -> Text -> m () Source #

Set the value of the “`title`” property. When overloading is enabled, this is equivalent to

    set fileDialog [ #title := value ]