mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Use globalStackExtruderIds instead of extruderIds. extruderIds notifys change before the extruders change when doing a machine swap. Fixing this will take a long time so this is a workaround. If you are reading this 🙏 good luck fixing it 🙏
CURA-9793
This commit is contained in:
parent
f601229390
commit
443252ae10
4 changed files with 10 additions and 3 deletions
|
@ -63,6 +63,13 @@ class ExtruderManager(QObject):
|
||||||
# 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.globalStackExtrudersChanged.emit()
|
self.globalStackExtrudersChanged.emit()
|
||||||
|
|
||||||
|
@pyqtProperty("QVariantMap", notify = globalStackExtrudersChanged)
|
||||||
|
def globalStackExtruderIds(self) -> Dict[str, str]:
|
||||||
|
# The extruderIds property notifys changed before the extruders are changed on switching machines
|
||||||
|
# trying to fix this broke to many things. This is a workaround. Don't use this unless you need to read
|
||||||
|
# extruderIds directly after a machine update.
|
||||||
|
return self.extruderIds
|
||||||
|
|
||||||
@pyqtProperty(str, notify = activeExtruderChanged)
|
@pyqtProperty(str, notify = activeExtruderChanged)
|
||||||
def activeExtruderStackId(self) -> Optional[str]:
|
def activeExtruderStackId(self) -> Optional[str]:
|
||||||
"""Gets the unique identifier of the currently active extruder stack.
|
"""Gets the unique identifier of the currently active extruder stack.
|
||||||
|
|
|
@ -54,7 +54,7 @@ Cura.ComboBox {
|
||||||
property UM.SettingPropertyProvider propertyProvider: UM.SettingPropertyProvider
|
property UM.SettingPropertyProvider propertyProvider: UM.SettingPropertyProvider
|
||||||
{
|
{
|
||||||
id: propertyProvider
|
id: propertyProvider
|
||||||
containerStackId: updateAllExtruders ? Cura.ExtruderManager.extruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id
|
containerStackId: updateAllExtruders ? Cura.ExtruderManager.globalStackExtruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id
|
||||||
watchedProperties: ["value" , "options"]
|
watchedProperties: ["value" , "options"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ RowLayout
|
||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
{
|
{
|
||||||
id: propertyProvider
|
id: propertyProvider
|
||||||
containerStackId: updateAllExtruders ? Cura.ExtruderManager.extruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id
|
containerStackId: updateAllExtruders ? Cura.ExtruderManager.globalStackExtruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id
|
||||||
watchedProperties: ["value"]
|
watchedProperties: ["value"]
|
||||||
storeIndex: 0
|
storeIndex: 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ UM.TextField
|
||||||
{
|
{
|
||||||
id: propertyProvider
|
id: propertyProvider
|
||||||
watchedProperties: ["value", "validationState", "resolve"]
|
watchedProperties: ["value", "validationState", "resolve"]
|
||||||
containerStackId: updateAllExtruders ? Cura.ExtruderManager.extruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id
|
containerStackId: updateAllExtruders ? Cura.ExtruderManager.globalStackExtruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue