Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2016-09-13 11:54:48 +02:00
commit 4088cc0f7e
4 changed files with 33 additions and 2 deletions

View file

@ -24,6 +24,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
def __init__(self, device_id, parent = None):
super().__init__(device_id = device_id, parent = parent)
self._container_registry = UM.Settings.ContainerRegistry.getInstance()
self._target_bed_temperature = 0
self._bed_temperature = 0
self._num_extruders = 1
@ -276,6 +277,21 @@ class PrinterOutputDevice(QObject, OutputDevice):
def materialIds(self):
return self._material_ids
@pyqtProperty("QVariantList", notify = materialIdChanged)
def materialNames(self):
result = []
for material_id in self._material_ids:
if material_id is None:
result.append(i18n_catalog.i18nc("@item:material", "No material loaded"))
continue
containers = self._container_registry.findInstanceContainers(type = "material", guid = material_id)
if containers:
result.append(containers[0].getName())
else:
result.append(i18n_catalog.i18nc("@item:material", "Unknown material"))
return result
## Protected setter for the current material id.
# /param index Index of the extruder
# /param material_id id of the material

View file

@ -361,6 +361,18 @@ class MachineManager(QObject):
return False
## Delete a user setting from the global stack and all extruder stacks.
# \param key \type{str} the name of the key to delete
@pyqtSlot(str)
def clearUserSettingAllCurrentStacks(self, key):
if not self._global_container_stack:
return
self._global_container_stack.getTop().removeInstance(key)
for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()):
stack.getTop().removeInstance(key)
## Check if the global profile does not contain error states
# Note that the _active_stack_valid is cached due to performance issues
# Calling _checkStackForErrors on every change is simply too expensive