Ensure that the display matches with the backend active extruder data

This commit is contained in:
Jaime van Kessel 2016-07-06 14:09:08 +02:00
parent bf53baccee
commit a5ba68bae3
2 changed files with 6 additions and 2 deletions

View file

@ -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:

View file

@ -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);
} }
} }