Get how we name variants from the machine definition

CURA-2116
This commit is contained in:
fieldOfView 2016-08-16 10:18:57 +02:00
parent 6bcea1e309
commit 8c63216fdf
2 changed files with 27 additions and 2 deletions

View file

@ -731,6 +731,16 @@ class MachineManager(QObject):
return ""
## Gets how the active definition calls variants
# Caveat: per-definition-variant-title is currently not translated (though the fallback is)
@pyqtProperty(str, notify = globalContainerChanged)
def activeDefinitionVariantsName(self):
fallback_title = catalog.i18nc("@label", "Nozzle")
if self._global_container_stack:
return self._global_container_stack.getBottom().getMetaDataEntry("variants_name", fallback_title)
return fallback_title
@pyqtSlot(str, str)
def renameMachine(self, machine_id, new_name):
containers = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = machine_id)