mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Add a method to get the id of the current user profile
CURA-1668
This commit is contained in:
parent
cc7369c594
commit
8608468802
1 changed files with 8 additions and 1 deletions
|
@ -105,7 +105,7 @@ class MachineManagerModel(QObject):
|
|||
|
||||
@pyqtSlot(str, str)
|
||||
def addMachine(self, name, definition_id):
|
||||
definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id=definition_id)
|
||||
definitions = UM.Settings.ContainerRegistry.getInstance().findDefinitionContainers(id = definition_id)
|
||||
if definitions:
|
||||
definition = definitions[0]
|
||||
name = self._createUniqueName("machine", "", name, definition.getName())
|
||||
|
@ -205,6 +205,13 @@ class MachineManagerModel(QObject):
|
|||
def isGlobalStackValid(self):
|
||||
return self._global_stack_valid
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeUserProfileId(self):
|
||||
if self._global_container_stack:
|
||||
return self._global_container_stack.getTop().getId()
|
||||
|
||||
return ""
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeMachineName(self):
|
||||
if self._global_container_stack:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue