diff --git a/cura/ExtruderManager.py b/cura/ExtruderManager.py index b4d05d7e6c..c8a07a4000 100644 --- a/cura/ExtruderManager.py +++ b/cura/ExtruderManager.py @@ -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 diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 237746ac0d..75f5393d57 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -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