Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Settings.Models.InstanceContainersModel.InstanceContainersModel Class Reference
Inheritance diagram for UM.Settings.Models.InstanceContainersModel.InstanceContainersModel:
UM.Qt.ListModel.ListModel

Public Member Functions

None __init__ (self, parent=None)
None setSectionProperty (self, str property_name)
str sectionProperty (self)
None setFilter (self, Dict[str, str] filter_dict)
Dict[str, str] filter (self)
None setFilterList (self, List[Dict[str, str]] filter_list)
List[Dict[str, str]] filterList (self)
List[str] getFileNameFilters (self, str io_type)
QUrl getDefaultPath (self)
Public Member Functions inherited from UM.Qt.ListModel.ListModel
None __init__ (self, parent=None)
int count (self)
int rowCount (self, parent=None)
 addRoleName (self, int role, str name)
 roleNames (self)
 data (self, index, role)
Dict[str, Any] getItem (self, int index)
List[Dict[str, Any]] items (self)
None setItems (self, List[Dict[str, Any]] items)
 appendItem (self, Dict[str, Any] item)
None insertItem (self, int index, Dict[str, Any] item)
None removeItem (self, int index)
None clear (self)
None setProperty (self, int index, str property, Any value)
None sort (self, Callable[[Any], float] fun, Optional[str] key=None, reverse=False)
int find (self, str key, Any value)

Static Public Attributes

int NameRole = Qt.ItemDataRole.UserRole + 1
int IdRole = Qt.ItemDataRole.UserRole + 2
int MetaDataRole = Qt.ItemDataRole.UserRole + 3
int ReadOnlyRole = Qt.ItemDataRole.UserRole + 4
int SectionRole = Qt.ItemDataRole.UserRole + 5
 sectionPropertyChanged = pyqtSignal()
 filterChanged = pyqtSignal()
Static Public Attributes inherited from UM.Qt.ListModel.ListModel
 itemsChanged = pyqtSignal()

Protected Member Functions

None _onContainerChanged (self, ContainerInterface container)
None _update (self)
Generator[Dict[str, Any], None, None] _recomputeItems (self)
Tuple[Dict[str, InstanceContainer], Dict[str, Dict[str, Any]]] _fetchInstanceContainers (self)
List[Tuple[str, Dict[str, Any]]] _getIOPlugins (self, str io_type)
List[Any] _sortKey (self, Dict[str, Any] item)
None _updateMetaData (self, InstanceContainer container)
None _onContainerLoadComplete (self, str container_id)

Protected Attributes

dict _instance_containers = {}
dict _instance_containers_metadata = {}
str _section_property = ""
 _onContainerChanged
 _onContainerLoadComplete
 _container_change_timer = QTimer()
 _update
list _filter_dicts = []
 _updateMetaData
Protected Attributes inherited from UM.Qt.ListModel.ListModel
list _items = []
dict _role_names = {}

Detailed Description

Model that holds instance containers. By setting the filter property the instances held by this model can be
changed.

Member Function Documentation

◆ _fetchInstanceContainers()

Tuple[Dict[str, InstanceContainer], Dict[str, Dict[str, Any]]] UM.Settings.Models.InstanceContainersModel.InstanceContainersModel._fetchInstanceContainers ( self)
protected
Fetch the list of containers to display.

This method is intended to be overridable by subclasses.

:return: A tuple of an ID-to-instance mapping that includes all fully loaded containers, and
an ID-to-metadata mapping that includes the containers of which only the metadata is known.

◆ _getIOPlugins()

List[Tuple[str, Dict[str, Any]]] UM.Settings.Models.InstanceContainersModel.InstanceContainersModel._getIOPlugins ( self,
str io_type )
protected
Gets a list of profile reader or writer plugins

:return: List of tuples of (plugin_id, meta_data).

◆ _onContainerChanged()

None UM.Settings.Models.InstanceContainersModel.InstanceContainersModel._onContainerChanged ( self,
ContainerInterface container )
protected
Handler for container added / removed events from registry

◆ _onContainerLoadComplete()

None UM.Settings.Models.InstanceContainersModel.InstanceContainersModel._onContainerLoadComplete ( self,
str container_id )
protected
If a container has loaded fully (rather than just metadata) we need to
move it from the dict of metadata to the dict of full containers.

◆ _recomputeItems()

Generator[Dict[str, Any], None, None] UM.Settings.Models.InstanceContainersModel.InstanceContainersModel._recomputeItems ( self)
protected
Computes the items that need to be in this list model.

This does not set the items in the list itself. It is intended to be
overwritten by subclasses that add their own roles to the model.

◆ _update()

None UM.Settings.Models.InstanceContainersModel.InstanceContainersModel._update ( self)
protected
Private convenience function to reset & repopulate the model.

◆ getFileNameFilters()

List[str] UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.getFileNameFilters ( self,
str io_type )
Gets a list of the possible file filters that the plugins have registered they can read or write.
The convenience meta-filters "All Supported Types" and "All Files" are added when listing readers,
but not when listing writers.

:param io_type: Name of the needed IO type
:return: A list of strings indicating file name filters for a file dialog.

◆ setFilter()

None UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.setFilter ( self,
Dict[str, str] filter_dict )
Set the filter of this model based on a string.

:param filter_dict: :type{Dict} Dictionary to do the filtering by.

◆ setFilterList()

None UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.setFilterList ( self,
List[Dict[str, str]] filter_list )
Set a list of filters to use when fetching containers.

:param filter_list: List of filter dicts to fetch multiple sets of
containers. The final result is the union of these sets.

The documentation for this class was generated from the following file:
  • UM/Settings/Models/InstanceContainersModel.py