neurochat.nc_uigetfiles module

Provides the GUI and functionalities for manually selecting files.

This module implements UiGetFiles Class for NeuroChaT.

@author: Md Nurul Islam; islammn at tcd dot ie

class neurochat.nc_uigetfiles.UiGetFiles(parent=None, filters=['.pdf', '.ps'])[source]

Bases: PyQt5.QtWidgets.QDialog

A class to get files using a QDialog widget.

Parameters:
  • parent – Parent widget if any
  • filters (list of str) – File filters for manual selection
parent

Parent widget

filters

Approved filters

Type:list of str
current_filter

Currently set filter

Type:str
files

List of selected files

Type:list
DOWN = 1
UP = -1
add_items()[source]

Called if the add button is clicked.

Adds selected model item to the right side selected file box if that passes the filter.

Parameters:None
Returns:None
behaviour_ui()[source]

Set up the behaviour of UiGetFiles class.

close_dialog()[source]

Close the widget for file selection.

Parameters:None
Returns:None
dir_changed(value)[source]

Called if the subdirectory combo-box in the widget is changed.

This to updates the list of new subdirectories.

Parameters:value – Newly set item number in the combo-box of subdirectories.
Returns:None
done_merge()[source]

Set the list of files and closes the widget.

Parameters:None
Returns:None
filter_changed(value)[source]

Called if the filter changed to update for the new selection.

Parameters:value – Currently set filter
Returns:None
get_files()[source]

Return the list of files.

Parameters:None
Returns:list – List of selected files
hierarchy_changed()[source]

Called if the directory hierarchy is changed.

Parameters:None
Returns:None
item_activated(qind)[source]

Called if any of the items in the list of files is double-clicked.

Parameters:quind – Indix of new model item
Returns:None
line_edited(value)[source]

Called if the directory text box in the widget is changed.

This updates the list of new subdirectories.

Parameters:value – Newly set text in the directory box.
Returns:None
move_items(direction='down')[source]

Move item in the item model by changing their indices.

Parameters:direction (str) – Direction of moving ‘down’ or ‘up’
Returns:None
remove_items()[source]

Remove the item which is added to the selection list.

Updates the item model.

Parameters:None
Returns:None
setup_ui()[source]

Set up the elements of UiGetFiles class.

update_list(directory)[source]

Update the list of folders and set the item for the scrollable list.

Parameters:directory – New directory whose folders and files are listed
Returns:None