mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 23:19:13 +08:00
Remove deprecated currentExtruderPositions
CURA-6858
This commit is contained in:
parent
c62ff262ed
commit
227b76d6f0
@ -51,6 +51,10 @@ class ExtruderStack(CuraContainerStack):
|
|||||||
def getNextStack(self) -> Optional["GlobalStack"]:
|
def getNextStack(self) -> Optional["GlobalStack"]:
|
||||||
return super().getNextStack()
|
return super().getNextStack()
|
||||||
|
|
||||||
|
@pyqtProperty(int, constant = True)
|
||||||
|
def position(self) -> int:
|
||||||
|
return int(self.getMetaDataEntry("position"))
|
||||||
|
|
||||||
def setEnabled(self, enabled: bool) -> None:
|
def setEnabled(self, enabled: bool) -> None:
|
||||||
if self.getMetaDataEntry("enabled", True) == enabled: # No change.
|
if self.getMetaDataEntry("enabled", True) == enabled: # No change.
|
||||||
return # Don't emit a signal then.
|
return # Don't emit a signal then.
|
||||||
|
@ -1078,13 +1078,6 @@ class MachineManager(QObject):
|
|||||||
container = extruder.userChanges
|
container = extruder.userChanges
|
||||||
container.removeInstance(setting_name)
|
container.removeInstance(setting_name)
|
||||||
|
|
||||||
@pyqtProperty("QVariantList", notify = globalContainerChanged)
|
|
||||||
@deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2")
|
|
||||||
def currentExtruderPositions(self) -> List[str]:
|
|
||||||
if self._global_container_stack is None:
|
|
||||||
return []
|
|
||||||
return sorted(list(self._global_container_stack.extruders.keys()))
|
|
||||||
|
|
||||||
## Update _current_root_material_id when the current root material was changed.
|
## Update _current_root_material_id when the current root material was changed.
|
||||||
def _onRootMaterialChanged(self) -> None:
|
def _onRootMaterialChanged(self) -> None:
|
||||||
self._current_root_material_id = {}
|
self._current_root_material_id = {}
|
||||||
|
@ -143,27 +143,27 @@ UM.Dialog
|
|||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
model: Cura.MachineManager.currentExtruderPositions
|
model: Cura.MachineManager.activeMachine.extruderList
|
||||||
delegate: Column
|
delegate: Column
|
||||||
{
|
{
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
property string variantName:
|
property string variantName:
|
||||||
{
|
{
|
||||||
var extruder = Cura.MachineManager.activeMachine.extruderList[modelData]
|
var extruder = modelData
|
||||||
var variant_name = extruder.variant.name
|
var variant_name = extruder.variant.name
|
||||||
return (variant_name !== undefined) ? variant_name : ""
|
return (variant_name !== undefined) ? variant_name : ""
|
||||||
}
|
}
|
||||||
property string materialName:
|
property string materialName:
|
||||||
{
|
{
|
||||||
var extruder = Cura.MachineManager.activeMachine.extruderList[modelData]
|
var extruder = modelData
|
||||||
var material_name = extruder.material.name
|
var material_name = extruder.material.name
|
||||||
return (material_name !== undefined) ? material_name : ""
|
return (material_name !== undefined) ? material_name : ""
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: {
|
text: {
|
||||||
var extruder = Number(modelData)
|
var extruder = Number(modelData.position)
|
||||||
var extruder_id = ""
|
var extruder_id = ""
|
||||||
if(!isNaN(extruder))
|
if(!isNaN(extruder))
|
||||||
{
|
{
|
||||||
@ -171,7 +171,7 @@ UM.Dialog
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
extruder_id = modelData
|
extruder_id = modelData.position
|
||||||
}
|
}
|
||||||
|
|
||||||
return catalog.i18nc("@action:label", "Extruder %1").arg(extruder_id)
|
return catalog.i18nc("@action:label", "Extruder %1").arg(extruder_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user