Emit activeStackChanged as documented when containers in the active stack change

This fixes updating the intent models when you switch nozzles. Among other things, probably.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-09-12 17:27:30 +02:00
parent 603f18ebc9
commit f4a2f3efa6
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 5 additions and 1 deletions

View file

@ -45,6 +45,7 @@ class QualityProfilesDropDownMenuModel(ListModel):
application.globalContainerStackChanged.connect(self._onChange) application.globalContainerStackChanged.connect(self._onChange)
machine_manager.activeQualityGroupChanged.connect(self._onChange) machine_manager.activeQualityGroupChanged.connect(self._onChange)
machine_manager.activeStackChanged.connect(self._onChange)
machine_manager.extruderChanged.connect(self._onChange) machine_manager.extruderChanged.connect(self._onChange)
self._layer_height_unit = "" # This is cached self._layer_height_unit = "" # This is cached

View file

@ -46,7 +46,6 @@ catalog = i18nCatalog("cura")
from cura.Settings.GlobalStack import GlobalStack from cura.Settings.GlobalStack import GlobalStack
if TYPE_CHECKING: if TYPE_CHECKING:
from cura.CuraApplication import CuraApplication from cura.CuraApplication import CuraApplication
from cura.Settings.CuraContainerStack import CuraContainerStack
from cura.Machines.MaterialNode import MaterialNode from cura.Machines.MaterialNode import MaterialNode
from cura.Machines.QualityChangesGroup import QualityChangesGroup from cura.Machines.QualityChangesGroup import QualityChangesGroup
from cura.Machines.QualityGroup import QualityGroup from cura.Machines.QualityGroup import QualityGroup
@ -265,7 +264,11 @@ class MachineManager(QObject):
def _onActiveExtruderStackChanged(self) -> None: def _onActiveExtruderStackChanged(self) -> None:
self.blurSettings.emit() # Ensure no-one has focus. self.blurSettings.emit() # Ensure no-one has focus.
if self._active_container_stack is not None:
self._active_container_stack.pyqtContainersChanged.disconnect(self.activeStackChanged) # Unplug from the old one.
self._active_container_stack = ExtruderManager.getInstance().getActiveExtruderStack() self._active_container_stack = ExtruderManager.getInstance().getActiveExtruderStack()
if self._active_container_stack is not None:
self._active_container_stack.pyqtContainersChanged.connect(self.activeStackChanged) # Plug into the new one.
def __emitChangedSignals(self) -> None: def __emitChangedSignals(self) -> None:
self.activeQualityChanged.emit() self.activeQualityChanged.emit()