AbstractDataFileDialog

This module contains an AbstractDataFileDialog.

class silx.gui.dialog.AbstractDataFileDialog.AbstractDataFileDialog(parent=None)[source]

Bases: PyQt4.QtGui.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

hasPendingEvents()[source]

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

viewMode()[source]

Returns the current view mode.

Return type:qt.QFileDialog.ViewMode
setViewMode(mode)[source]

Set the current view mode.

Parameters:mode (qt.QFileDialog.ViewMode) – The new view mode
setDirectory(path)[source]

Sets the data dialog’s current directory.

selectedFile()[source]

Returns the file path containing the selected data.

Return type:str
selectFile(filename)[source]

Sets the data dialog’s current file.

selectUrl(url)[source]

Sets the data dialog’s current data url.

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

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()[source]

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()[source]

Returns the path from the current browsed directory.

Return type:str
selectedNameFilter()[source]

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

history()[source]

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

Return type:List<str>
setSidebarUrls(urls)[source]

Sets the urls that are located in the sidebar.

sidebarUrls()[source]

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

restoreState(state)[source]

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()[source]

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

Return type:qt.QByteArray