Ensured that sidebar has the right properties to show again

CL-541
This commit is contained in:
Jaime van Kessel 2017-11-27 14:42:45 +01:00
parent 7d9af8e345
commit 52a137a68c
4 changed files with 48 additions and 7 deletions

View file

@ -21,6 +21,7 @@ class PrinterOutputModel(QObject):
nameChanged = pyqtSignal()
headPositionChanged = pyqtSignal()
keyChanged = pyqtSignal()
typeChanged = pyqtSignal()
def __init__(self, output_controller: "PrinterOutputController", number_of_extruders: int = 1, parent=None):
super().__init__(parent)
@ -35,6 +36,17 @@ class PrinterOutputModel(QObject):
self._printer_state = "unknown"
self._type = ""
@pyqtProperty(str, notify = typeChanged)
def type(self):
return self._type
def updateType(self, type):
if self._type != type:
self._type = type
self.typeChanged.emit()
@pyqtProperty(str, notify=keyChanged)
def key(self):
return self._key