mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-03 17:24:21 +08:00
getting id of definition when none was found no longer causes exception
CURA-1278
This commit is contained in:
parent
f24b56dc85
commit
6d25d21126
@ -158,7 +158,10 @@ class MachineManagerModel(QObject):
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeDefinitionId(self):
|
||||
return Application.getInstance().getGlobalContainerStack().getBottom().id
|
||||
definition = Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
if definition:
|
||||
return definition.id
|
||||
return None
|
||||
|
||||
@pyqtSlot(str, str)
|
||||
def renameMachine(self, machine_id, new_name):
|
||||
@ -166,10 +169,6 @@ class MachineManagerModel(QObject):
|
||||
if containers:
|
||||
containers[0].setName(new_name)
|
||||
|
||||
@pyqtProperty(str, notify=globalContainerChanged)
|
||||
def activeMachineDefinitionId(self):
|
||||
return Application.getInstance().getGlobalContainerStack().getContainers()[-1].getId()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def removeMachine(self, machine_id):
|
||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||
|
@ -198,7 +198,7 @@ UM.MainWindow
|
||||
filter:
|
||||
{
|
||||
"type": "variant",
|
||||
"definition": Cura.MachineManager.activeMachineDefinitionId //Only show variants of this machine
|
||||
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
|
@ -149,7 +149,7 @@ Item
|
||||
filter:
|
||||
{
|
||||
"type": "variant",
|
||||
"definition": Cura.MachineManager.activeMachineDefinitionId //Only show variants of this machine
|
||||
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||
}
|
||||
}
|
||||
MenuItem
|
||||
|
Loading…
x
Reference in New Issue
Block a user