Skip to main content
`Ctrl`+`K`

# `AbstractDataFileDialog`

This module contains an `AbstractDataFileDialog`.

class AbstractDataFileDialog(parent=None)

  Bases: `QDialog`

  The AbstractFileDialog provides a generic GUI to create a custom dialog allowing to access to file resources like HDF5 files or HDF5 datasets.

  The dialog contains:

  - Shortcuts: It provides few links to have a fast access of browsing

      locations.

  - Browser: It provides a display to browse throw the file system and inside

      HDF5 files or fabio files. A file format selector is provided.

  - URL: Display the URL available to reach the data using

      `silx.io.get_data()`, `silx.io.open()`.

  - Data selector: A widget to apply a sub selection of the browsed dataset.

      This widget can be provided, else nothing will be used.

  - Data preview: A widget to preview the selected data, which is the result

      of the filter from the data selector. This widget can be provided, else nothing will be used.

  - Preview’s toolbar: Provides tools used to custom data preview or data

      selector. This widget can be provided, else nothing will be used.

  - Buttons to validate the dialog

  done(self, a0: int)
  hasPendingEvents()

    Returns true if the dialog have asynchronous tasks working on the background.

  viewMode()

    Returns the current view mode.

    Return type:

      qt.QFileDialog.ViewMode

  setViewMode(mode)

    Set the current view mode.

    Parameters:

      mode (qt.QFileDialog.ViewMode) – The new view mode

  setDirectory(path)

    Sets the data dialog’s current directory.

  selectedFile()

    Returns the file path containing the selected data.

    Return type:

      str

  selectFile(filename)

    Sets the data dialog’s current file.

  selectUrl(url)

    Sets the data dialog’s current data url.

    Parameters:

      url (Union[str,DataUrl]) – URL identifying a data (it can be a DataUrl object)

  selectedUrl()

    Returns the URL from the file system to the data.

    If the dialog is not validated, the path can be an intermediat selected path, or an invalid path.

    Return type:

      str

  selectedDataUrl()

    Returns the URL as a `DataUrl` from the file system to the data.

    If the dialog is not validated, the path can be an intermediat selected path, or an invalid path.

    Return type:

      DataUrl

  directory()

    Returns the path from the current browsed directory.

    Return type:

      str

  selectedNameFilter()

    Returns the filter that the user selected in the file dialog.

  history()

    Returns the browsing history of the filedialog as a list of paths.

    Return type:

      List<str>

  setSidebarUrls(urls)

    Sets the urls that are located in the sidebar.

  sidebarUrls()

    Returns a list of urls that are currently in the sidebar.

  restoreState(state)

    Restores the dialogs’s layout, history and current directory to the state specified.

    Parameters:

      state (qt.QByteArray) – Stream containing the new state

    Return type:

      bool

  saveState()

    Saves the state of the dialog’s layout, history and current directory.

    Return type:

      qt.QByteArray