mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 22:55:53 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
d5d09f32b7
@ -22,7 +22,7 @@ class ExtruderManager(QObject):
|
|||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self._extruder_trains = { } #Per machine, a dictionary of extruder container stack IDs.
|
self._extruder_trains = { } #Per machine, a dictionary of extruder container stack IDs.
|
||||||
self._active_extruder_index = 0
|
self._active_extruder_index = -1
|
||||||
UM.Application.getInstance().globalContainerStackChanged.connect(self._addCurrentMachineExtruders)
|
UM.Application.getInstance().globalContainerStackChanged.connect(self._addCurrentMachineExtruders)
|
||||||
|
|
||||||
## Gets the unique identifier of the currently active extruder stack.
|
## Gets the unique identifier of the currently active extruder stack.
|
||||||
@ -66,6 +66,10 @@ class ExtruderManager(QObject):
|
|||||||
self._active_extruder_index = index
|
self._active_extruder_index = index
|
||||||
self.activeExtruderChanged.emit()
|
self.activeExtruderChanged.emit()
|
||||||
|
|
||||||
|
@pyqtProperty(int, notify = activeExtruderChanged)
|
||||||
|
def activeExtruderIndex(self):
|
||||||
|
return self._active_extruder_index
|
||||||
|
|
||||||
def getActiveExtruderStack(self):
|
def getActiveExtruderStack(self):
|
||||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||||
if global_container_stack:
|
if global_container_stack:
|
||||||
|
@ -13,7 +13,7 @@ Column
|
|||||||
id: base;
|
id: base;
|
||||||
|
|
||||||
property int totalHeightHeader: childrenRect.height
|
property int totalHeightHeader: childrenRect.height
|
||||||
property int currentExtruderIndex: -1;
|
property int currentExtruderIndex:ExtruderManager.activeExtruderIndex;
|
||||||
|
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ Column
|
|||||||
{
|
{
|
||||||
base.currentExtruderIndex = -1;
|
base.currentExtruderIndex = -1;
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
ExtruderManager.setActiveExtruderIndex(0);
|
ExtruderManager.setActiveExtruderIndex(base.currentExtruderIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user