mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 09:17:50 -06:00
WIP: Fix NozzleMenu warning on non-notifiable bindings
This commit is contained in:
parent
1e0a078af8
commit
4468f4d620
2 changed files with 17 additions and 2 deletions
|
@ -1302,6 +1302,12 @@ class MachineManager(QObject):
|
|||
def createMachineManager():
|
||||
return MachineManager()
|
||||
|
||||
@pyqtSlot(int, result = "QVariant")
|
||||
def getExtruder(self, position: int):
|
||||
if self._global_container_stack:
|
||||
return self._global_container_stack.extruders.get(str(position))
|
||||
return None
|
||||
|
||||
@deprecated("Use ExtruderStack.material = ... and it won't be necessary", "2.7")
|
||||
def _updateMaterialContainer(self, definition: "DefinitionContainer", stack: "ContainerStack", variant_container: Optional["InstanceContainer"] = None, preferred_material_name: Optional[str] = None) -> InstanceContainer:
|
||||
if not definition.getMetaDataEntry("has_materials"):
|
||||
|
@ -1357,7 +1363,6 @@ class MachineManager(QObject):
|
|||
#
|
||||
# New
|
||||
#
|
||||
|
||||
@pyqtProperty("QVariant", notify = rootMaterialChanged)
|
||||
def currentRootMaterialId(self):
|
||||
# initial filling the current_root_material_id
|
||||
|
|
|
@ -19,6 +19,16 @@ Menu
|
|||
id: nozzleModel
|
||||
}
|
||||
|
||||
property var extruderStack: Cura.MachineManager.getExtruder(extruderIndex)
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged: {
|
||||
menu.extruderStack = Cura.MachineManager.getExtruder(extruderIndex)
|
||||
}
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: nozzleModel
|
||||
|
@ -27,7 +37,7 @@ Menu
|
|||
{
|
||||
text: model.hotend_name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine.extruders[extruderIndex].variant.name == model.hotend_name
|
||||
checked: extruderStack.variant.name == model.hotend_name
|
||||
exclusiveGroup: group
|
||||
onTriggered: {
|
||||
Cura.MachineManager.setVariantGroup(extruderIndex, model.container_node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue