mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
4088cc0f7e
4 changed files with 33 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue