mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-10 00:59:02 +08:00
Add a method to get the id of the current user profile
CURA-1668
This commit is contained in:
parent
cc7369c594
commit
8608468802
@ -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…
x
Reference in New Issue
Block a user