CURA-4870 Remove dinamic connections to the signals in the machine

model. The model is still updated when the container changed.
This commit is contained in:
Diego Prado Gesto 2018-03-13 10:35:48 +01:00
parent b3f9679a5f
commit fa2b5f141c

View file

@ -42,18 +42,9 @@ class MachineManagementModel(ListModel):
if isinstance(container, ContainerStack): if isinstance(container, ContainerStack):
self._update() self._update()
## Handler for container name change events.
def _onContainerNameChanged(self):
self._update()
## Private convenience function to reset & repopulate the model. ## Private convenience function to reset & repopulate the model.
def _update(self): def _update(self):
items = [] items = []
# Remove all connections
for container in self._local_container_stacks:
container.nameChanged.disconnect(self._onContainerNameChanged)
for container in self._network_container_stacks:
container.nameChanged.disconnect(self._onContainerNameChanged)
# Get first the network enabled printers # Get first the network enabled printers
network_filter_printers = {"type": "machine", "um_network_key": "*", "hidden": "False"} network_filter_printers = {"type": "machine", "um_network_key": "*", "hidden": "False"}
@ -65,7 +56,6 @@ class MachineManagementModel(ListModel):
if container.getBottom(): if container.getBottom():
metadata["definition_name"] = container.getBottom().getName() metadata["definition_name"] = container.getBottom().getName()
container.nameChanged.connect(self._onContainerNameChanged)
items.append({"name": metadata["connect_group_name"], items.append({"name": metadata["connect_group_name"],
"id": container.getId(), "id": container.getId(),
"metadata": metadata, "metadata": metadata,
@ -81,7 +71,6 @@ class MachineManagementModel(ListModel):
if container.getBottom(): if container.getBottom():
metadata["definition_name"] = container.getBottom().getName() metadata["definition_name"] = container.getBottom().getName()
container.nameChanged.connect(self._onContainerNameChanged)
items.append({"name": container.getName(), items.append({"name": container.getName(),
"id": container.getId(), "id": container.getId(),
"metadata": metadata, "metadata": metadata,