Fixed connection label state

CL-541
This commit is contained in:
Jaime van Kessel 2018-01-08 13:44:20 +01:00
parent df1bf419d9
commit 99de75a3fd
3 changed files with 8 additions and 1 deletions

View file

@ -64,6 +64,12 @@ class PrinterOutputDevice(QObject, OutputDevice):
self._connection_state = ConnectionState.closed self._connection_state = ConnectionState.closed
self._address = ""
@pyqtProperty(str, constant = True)
def address(self):
return self._address
def materialHotendChangedMessage(self, callback): def materialHotendChangedMessage(self, callback):
Logger.log("w", "materialHotendChangedMessage needs to be implemented, returning 'Yes'") Logger.log("w", "materialHotendChangedMessage needs to be implemented, returning 'Yes'")
callback(QMessageBox.Yes) callback(QMessageBox.Yes)

View file

@ -44,6 +44,7 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
self._serial = None # type: Optional[Serial] self._serial = None # type: Optional[Serial]
self._serial_port = serial_port self._serial_port = serial_port
self._address = serial_port
self._timeout = 3 self._timeout = 3

View file

@ -44,7 +44,7 @@ Item
Label Label
{ {
text: outputDevice != null ? outputDevice.connectionText : catalog.i18nc("@info:status", "The printer is not connected.") text: outputDevice != null ? "" : catalog.i18nc("@info:status", "The printer is not connected.")
color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") color: outputDevice != null && outputDevice.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
font: UM.Theme.getFont("very_small") font: UM.Theme.getFont("very_small")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap