mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 12:09:13 +08:00
Merge branch 'CURA-11299' of github.com:Ultimaker/Cura into 5.6
This commit is contained in:
commit
fc3d150b39
@ -48,6 +48,8 @@ from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
if TYPE_CHECKING:
|
||||
from PyQt6.QtCore import QVariantList
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Machines.MaterialNode import MaterialNode
|
||||
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
||||
@ -581,6 +583,10 @@ class MachineManager(QObject):
|
||||
def activeMachine(self) -> Optional["GlobalStack"]:
|
||||
return self._global_container_stack
|
||||
|
||||
@pyqtProperty("QVariantList", notify=activeVariantChanged)
|
||||
def activeMachineExtruders(self) -> Optional["QVariantList"]:
|
||||
return self._global_container_stack.extruderList if self._global_container_stack else None
|
||||
|
||||
@pyqtProperty(str, notify = activeStackChanged)
|
||||
def activeStackId(self) -> str:
|
||||
if self._active_container_stack:
|
||||
|
@ -27,24 +27,17 @@ Cura.Menu
|
||||
{
|
||||
text: model.hotend_name
|
||||
checkable: true
|
||||
property var activeMachine: Cura.MachineManager.activeMachine
|
||||
checked:
|
||||
{
|
||||
if (activeMachine === null)
|
||||
{
|
||||
return false
|
||||
}
|
||||
var extruder = activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name)
|
||||
const extruder = Cura.MachineManager.activeMachineExtruders[extruderIndex];
|
||||
if (!extruder) return false;
|
||||
return extruder.variant.name == model.hotend_name;
|
||||
}
|
||||
enabled:
|
||||
{
|
||||
if (activeMachine === null)
|
||||
{
|
||||
return false
|
||||
}
|
||||
var extruder = activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : extruder.isEnabled
|
||||
const extruder = Cura.MachineManager.activeMachineExtruders[extruderIndex];
|
||||
if (!extruder) return false;
|
||||
return extruder.isEnabled;
|
||||
}
|
||||
onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)
|
||||
}
|
||||
@ -52,5 +45,4 @@ Cura.Menu
|
||||
onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) }
|
||||
onObjectRemoved: function(index, object) {nozzleMenu.removeItem(object)}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user