mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Don't show possibly incorrect materials in print monitor
This commit is contained in:
parent
02c1a8d069
commit
ab50ac0d89
2 changed files with 22 additions and 2 deletions
|
@ -46,6 +46,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
self.addRoleName(self.IndexRole, "index")
|
self.addRoleName(self.IndexRole, "index")
|
||||||
|
|
||||||
self._add_global = False
|
self._add_global = False
|
||||||
|
self._simple_names = False
|
||||||
|
|
||||||
self._active_extruder_stack = None
|
self._active_extruder_stack = None
|
||||||
|
|
||||||
|
@ -70,6 +71,21 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
def addGlobal(self):
|
def addGlobal(self):
|
||||||
return self._add_global
|
return self._add_global
|
||||||
|
|
||||||
|
## Set the simpleNames property.
|
||||||
|
def setSimpleNames(self, simple_names):
|
||||||
|
if simple_names != self._simple_names:
|
||||||
|
self._simple_names = simple_names
|
||||||
|
self.simpleNamesChanged.emit()
|
||||||
|
self._updateExtruders()
|
||||||
|
|
||||||
|
## Emitted when the simpleNames property changes.
|
||||||
|
simpleNamesChanged = pyqtSignal()
|
||||||
|
|
||||||
|
## Whether or not the model should show all definitions regardless of visibility.
|
||||||
|
@pyqtProperty(bool, fset = setSimpleNames, notify = simpleNamesChanged)
|
||||||
|
def simpleNames(self):
|
||||||
|
return self._simple_names
|
||||||
|
|
||||||
def _onActiveExtruderChanged(self):
|
def _onActiveExtruderChanged(self):
|
||||||
manager = ExtruderManager.getInstance()
|
manager = ExtruderManager.getInstance()
|
||||||
active_extruder_stack = manager.getActiveExtruderStack()
|
active_extruder_stack = manager.getActiveExtruderStack()
|
||||||
|
@ -119,7 +135,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
for extruder in manager.getMachineExtruders(global_container_stack.getId()):
|
for extruder in manager.getMachineExtruders(global_container_stack.getId()):
|
||||||
extruder_name = extruder.getName()
|
extruder_name = extruder.getName()
|
||||||
material = extruder.findContainer({ "type": "material" })
|
material = extruder.findContainer({ "type": "material" })
|
||||||
if material:
|
if material and not self._simple_names:
|
||||||
extruder_name = "%s (%s)" % (material.getName(), extruder_name)
|
extruder_name = "%s (%s)" % (material.getName(), extruder_name)
|
||||||
position = extruder.getMetaDataEntry("position", default = "0") # Get the position
|
position = extruder.getMetaDataEntry("position", default = "0") # Get the position
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -14,7 +14,11 @@ Column
|
||||||
id: printMonitor
|
id: printMonitor
|
||||||
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||||
|
|
||||||
Cura.ExtrudersModel { id: extrudersModel }
|
Cura.ExtrudersModel
|
||||||
|
{
|
||||||
|
id: extrudersModel
|
||||||
|
simpleNames: true
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue