mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Materials & variants are now correctly checked when active
CURA-1278
This commit is contained in:
parent
5dbe0bdc03
commit
dd24e488a8
3 changed files with 16 additions and 5 deletions
|
@ -77,6 +77,12 @@ class MachineManagerModel(QObject):
|
|||
if material:
|
||||
return material.getName()
|
||||
|
||||
@pyqtProperty(str, notify=activeMaterialChanged)
|
||||
def activeMaterialId(self):
|
||||
material = Application.getInstance().getGlobalContainerStack().findContainer({"type": "material"})
|
||||
if material:
|
||||
return material.getId()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setActiveMaterial(self, material_id):
|
||||
containers = ContainerRegistry.getInstance().findInstanceContainers(id=material_id)
|
||||
|
@ -99,6 +105,13 @@ class MachineManagerModel(QObject):
|
|||
if variant:
|
||||
return variant.getName()
|
||||
|
||||
@pyqtProperty(str, notify = activeVariantChanged)
|
||||
def activeVariantId(self):
|
||||
variant = Application.getInstance().getGlobalContainerStack().findContainer({"type": "variant"})
|
||||
if variant:
|
||||
return variant.getId()
|
||||
|
||||
|
||||
@pyqtSlot(str, str)
|
||||
def renameMachine(self, machine_id, new_name):
|
||||
containers = ContainerRegistry.getInstance().findContainerStacks(id = machine_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue