This commit is contained in:
fieldOfView 2016-06-08 16:45:35 +02:00
commit 2d63ce889f
2 changed files with 5 additions and 26 deletions

View File

@ -36,7 +36,7 @@ class ExtruderManager(QObject):
if not UM.Application.getInstance().getGlobalContainerStack(): if not UM.Application.getInstance().getGlobalContainerStack():
return None #No active machine, so no active extruder. return None #No active machine, so no active extruder.
try: 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. 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 return None

View File

@ -104,7 +104,7 @@ Item
anchors.leftMargin: model.index * (extruderSelection.width / machineExtruderCount.properties.value) anchors.leftMargin: model.index * (extruderSelection.width / machineExtruderCount.properties.value)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: parent.width / machineExtruderCount.properties.value width: parent.width / machineExtruderCount.properties.value
text: model.text text: model.name
exclusiveGroup: extruderMenuGroup; exclusiveGroup: extruderMenuGroup;
checkable: true; checkable: true;
checked: base.currentExtruderIndex == index checked: base.currentExtruderIndex == index
@ -138,10 +138,11 @@ Item
} }
} }
ExclusiveGroup { id: extruderMenuGroup; } ExclusiveGroup { id: extruderMenuGroup; }
ListView{ ListView
{
id: extrudersList id: extrudersList
property var index: 0 property var index: 0
model: extrudersListModel model: Cura.ExtrudersModel {}
delegate: wizardDelegate delegate: wizardDelegate
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left 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 { Rectangle {
id: variantRow id: variantRow
anchors.top: extruderSelection.visible ? extruderSelection.bottom : machineSelectionRow.bottom anchors.top: extruderSelection.visible ? extruderSelection.bottom : machineSelectionRow.bottom