mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 08:55:54 +08:00
Use different signal for triggering update to extrduderIds. **This is a hack**. Actually fixing this problem could take days.
CURA-9793
This commit is contained in:
parent
0bdb04ccf6
commit
d8cf234a17
@ -46,17 +46,22 @@ class ExtruderManager(QObject):
|
|||||||
self._selected_object_extruders = [] # type: List[Union[str, "ExtruderStack"]]
|
self._selected_object_extruders = [] # type: List[Union[str, "ExtruderStack"]]
|
||||||
|
|
||||||
Selection.selectionChanged.connect(self.resetSelectedObjectExtruders)
|
Selection.selectionChanged.connect(self.resetSelectedObjectExtruders)
|
||||||
Application.getInstance().globalContainerStackChanged.connect(self.emitExtrudersChanged) # When the machine is swapped we must update the active machine extruders
|
Application.getInstance().globalContainerStackChanged.connect(self.emitGlobalStackExtrudersChanged) # When the machine is swapped we must update the active machine extruders
|
||||||
|
|
||||||
extrudersChanged = pyqtSignal()
|
# Don't use this unless you are reading from ExtruderManager.extruderIds when receiving the signal
|
||||||
|
globalStackExtrudersChanged = pyqtSignal()
|
||||||
|
|
||||||
|
# This signal actually emits before the global stacks extruders are updated, changing this behaviour breaks too many things
|
||||||
|
# Use globalStackExtrudersChanged = pyqtSignal() if you want a trigger when the extrduerIds property changes.
|
||||||
|
extrudersChanged = pyqtSignal(QVariant)
|
||||||
"""Signal to notify other components when the list of extruders for a machine definition changes."""
|
"""Signal to notify other components when the list of extruders for a machine definition changes."""
|
||||||
|
|
||||||
activeExtruderChanged = pyqtSignal()
|
activeExtruderChanged = pyqtSignal()
|
||||||
"""Notify when the user switches the currently active extruder."""
|
"""Notify when the user switches the currently active extruder."""
|
||||||
|
|
||||||
def emitExtrudersChanged(self):
|
def emitGlobalStackExtrudersChanged(self):
|
||||||
# The emit function can't be directly connected to another signal. This wrapper function is required.
|
# The emit function can't be directly connected to another signal. This wrapper function is required.
|
||||||
self.extrudersChanged.emit()
|
self.globalStackExtrudersChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, notify = activeExtruderChanged)
|
@pyqtProperty(str, notify = activeExtruderChanged)
|
||||||
def activeExtruderStackId(self) -> Optional[str]:
|
def activeExtruderStackId(self) -> Optional[str]:
|
||||||
@ -381,6 +386,8 @@ class ExtruderManager(QObject):
|
|||||||
extruders_changed = True
|
extruders_changed = True
|
||||||
|
|
||||||
self.fixSingleExtrusionMachineExtruderDefinition(global_stack)
|
self.fixSingleExtrusionMachineExtruderDefinition(global_stack)
|
||||||
|
if extruders_changed:
|
||||||
|
self.extrudersChanged.emit(global_stack_id)
|
||||||
|
|
||||||
# After 3.4, all single-extrusion machines have their own extruder definition files instead of reusing
|
# After 3.4, all single-extrusion machines have their own extruder definition files instead of reusing
|
||||||
# "fdmextruder". We need to check a machine here so its extruder definition is correct according to this.
|
# "fdmextruder". We need to check a machine here so its extruder definition is correct according to this.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user