mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
getting id of definition when none was found no longer causes exception
CURA-1278
This commit is contained in:
parent
f24b56dc85
commit
6d25d21126
3 changed files with 6 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue