mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 20:19:32 +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")
|
catalog = i18nCatalog("cura")
|
||||||
from cura.Settings.GlobalStack import GlobalStack
|
from cura.Settings.GlobalStack import GlobalStack
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from PyQt6.QtCore import QVariantList
|
||||||
|
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.Machines.MaterialNode import MaterialNode
|
from cura.Machines.MaterialNode import MaterialNode
|
||||||
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
||||||
@ -581,6 +583,10 @@ class MachineManager(QObject):
|
|||||||
def activeMachine(self) -> Optional["GlobalStack"]:
|
def activeMachine(self) -> Optional["GlobalStack"]:
|
||||||
return self._global_container_stack
|
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)
|
@pyqtProperty(str, notify = activeStackChanged)
|
||||||
def activeStackId(self) -> str:
|
def activeStackId(self) -> str:
|
||||||
if self._active_container_stack:
|
if self._active_container_stack:
|
||||||
|
@ -27,24 +27,17 @@ Cura.Menu
|
|||||||
{
|
{
|
||||||
text: model.hotend_name
|
text: model.hotend_name
|
||||||
checkable: true
|
checkable: true
|
||||||
property var activeMachine: Cura.MachineManager.activeMachine
|
|
||||||
checked:
|
checked:
|
||||||
{
|
{
|
||||||
if (activeMachine === null)
|
const extruder = Cura.MachineManager.activeMachineExtruders[extruderIndex];
|
||||||
{
|
if (!extruder) return false;
|
||||||
return false
|
return extruder.variant.name == model.hotend_name;
|
||||||
}
|
|
||||||
var extruder = activeMachine.extruderList[extruderIndex]
|
|
||||||
return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name)
|
|
||||||
}
|
}
|
||||||
enabled:
|
enabled:
|
||||||
{
|
{
|
||||||
if (activeMachine === null)
|
const extruder = Cura.MachineManager.activeMachineExtruders[extruderIndex];
|
||||||
{
|
if (!extruder) return false;
|
||||||
return false
|
return extruder.isEnabled;
|
||||||
}
|
|
||||||
var extruder = activeMachine.extruderList[extruderIndex]
|
|
||||||
return (extruder === undefined) ? false : extruder.isEnabled
|
|
||||||
}
|
}
|
||||||
onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)
|
onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)
|
||||||
}
|
}
|
||||||
@ -52,5 +45,4 @@ Cura.Menu
|
|||||||
onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) }
|
onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) }
|
||||||
onObjectRemoved: function(index, object) {nozzleMenu.removeItem(object)}
|
onObjectRemoved: function(index, object) {nozzleMenu.removeItem(object)}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user