Fix updating extruder names on machine switch

The extruder name is asked from the extruder manager, so that the signal from extruder manager properly updates it once the new name is available.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-13 11:57:01 +01:00
parent 77f07bbc1d
commit 34dccfd6a6
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 11 additions and 1 deletions

View file

@ -103,6 +103,16 @@ class ExtruderManager(QObject):
def activeExtruderIndex(self):
return self._active_extruder_index
## Gets the extruder name of an extruder of the currently active machine.
#
# \param index The index of the extruder whose name to get.
@pyqtSlot(int, result = str)
def getExtruderName(self, index):
try:
return list(self.getActiveExtruderStacks())[index].getName()
except IndexError:
return ""
def getActiveExtruderStack(self):
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
if global_container_stack: