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)
|
@pyqtProperty(str, notify = globalContainerChanged)
|
||||||
def activeDefinitionId(self):
|
def activeDefinitionId(self):
|
||||||
return Application.getInstance().getGlobalContainerStack().getBottom().id
|
definition = Application.getInstance().getGlobalContainerStack().getBottom()
|
||||||
|
if definition:
|
||||||
|
return definition.id
|
||||||
|
return None
|
||||||
|
|
||||||
@pyqtSlot(str, str)
|
@pyqtSlot(str, str)
|
||||||
def renameMachine(self, machine_id, new_name):
|
def renameMachine(self, machine_id, new_name):
|
||||||
@ -166,10 +169,6 @@ class MachineManagerModel(QObject):
|
|||||||
if containers:
|
if containers:
|
||||||
containers[0].setName(new_name)
|
containers[0].setName(new_name)
|
||||||
|
|
||||||
@pyqtProperty(str, notify=globalContainerChanged)
|
|
||||||
def activeMachineDefinitionId(self):
|
|
||||||
return Application.getInstance().getGlobalContainerStack().getContainers()[-1].getId()
|
|
||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def removeMachine(self, machine_id):
|
def removeMachine(self, machine_id):
|
||||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id)
|
UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||||
|
@ -198,7 +198,7 @@ UM.MainWindow
|
|||||||
filter:
|
filter:
|
||||||
{
|
{
|
||||||
"type": "variant",
|
"type": "variant",
|
||||||
"definition": Cura.MachineManager.activeMachineDefinitionId //Only show variants of this machine
|
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
@ -149,7 +149,7 @@ Item
|
|||||||
filter:
|
filter:
|
||||||
{
|
{
|
||||||
"type": "variant",
|
"type": "variant",
|
||||||
"definition": Cura.MachineManager.activeMachineDefinitionId //Only show variants of this machine
|
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MenuItem
|
MenuItem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user