mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 00:55:51 +08:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
2d63ce889f
@ -36,7 +36,7 @@ class ExtruderManager(QObject):
|
||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||
return None #No active machine, so no active extruder.
|
||||
try:
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)]
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().getId()][str(self._active_extruder_index)]
|
||||
except KeyError: #Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
|
||||
return None
|
||||
|
||||
|
@ -104,7 +104,7 @@ Item
|
||||
anchors.leftMargin: model.index * (extruderSelection.width / machineExtruderCount.properties.value)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width / machineExtruderCount.properties.value
|
||||
text: model.text
|
||||
text: model.name
|
||||
exclusiveGroup: extruderMenuGroup;
|
||||
checkable: true;
|
||||
checked: base.currentExtruderIndex == index
|
||||
@ -138,10 +138,11 @@ Item
|
||||
}
|
||||
}
|
||||
ExclusiveGroup { id: extruderMenuGroup; }
|
||||
ListView{
|
||||
ListView
|
||||
{
|
||||
id: extrudersList
|
||||
property var index: 0
|
||||
model: extrudersListModel
|
||||
model: Cura.ExtrudersModel {}
|
||||
delegate: wizardDelegate
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
@ -149,28 +150,6 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
ListModel
|
||||
{
|
||||
id: extrudersListModel
|
||||
Component.onCompleted: populateExtruderModel()
|
||||
}
|
||||
Connections
|
||||
{
|
||||
id: machineChange
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged: populateExtruderModel()
|
||||
}
|
||||
|
||||
function populateExtruderModel()
|
||||
{
|
||||
extrudersListModel.clear();
|
||||
for(var extruder = 0; extruder < machineExtruderCount.properties.value ; extruder++) {
|
||||
extrudersListModel.append({
|
||||
text: catalog.i18nc("@label", "Extruder %1").arg(extruder + 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: variantRow
|
||||
anchors.top: extruderSelection.visible ? extruderSelection.bottom : machineSelectionRow.bottom
|
||||
|
Loading…
x
Reference in New Issue
Block a user