Only emit signal when the active extruder actually changes

This commit is contained in:
Jaime van Kessel 2017-01-24 13:14:10 +01:00
parent 858886d6b7
commit 4e8fb254f6

View File

@ -96,8 +96,9 @@ class ExtruderManager(QObject):
# \param index The index of the new active extruder. # \param index The index of the new active extruder.
@pyqtSlot(int) @pyqtSlot(int)
def setActiveExtruderIndex(self, index): def setActiveExtruderIndex(self, index):
self._active_extruder_index = index if self._active_extruder_index != index:
self.activeExtruderChanged.emit() self._active_extruder_index = index
self.activeExtruderChanged.emit()
@pyqtProperty(int, notify = activeExtruderChanged) @pyqtProperty(int, notify = activeExtruderChanged)
def activeExtruderIndex(self): def activeExtruderIndex(self):