diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index f6bd77a..79068fd 100755 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -64,7 +64,15 @@ class MainWindow(QtWidgets.QMainWindow): self.info_box = InfoBox() self.client = WrappedClient(self) - self.client.connection_error.connect(self.bail) + + def handle_connection_error(): + self.info_box.display_info_box( + "Connection Error", "Thermostat connection lost. Is it unplugged?" + ) + + self.bail() + + self.client.connection_error.connect(handle_connection_error) self.thermostat = Thermostat( self, self.client, self.report_refresh_spin.value()