GUI: changed sdisplay_error to display_status - allows messages like disconnected and connected to be parsed to the user
This commit is contained in:
@@ -391,6 +391,8 @@ class MainWindow(QMainWindow):
|
||||
self.daq.fluorimeter_spectrum_update.connect(self.fluor_panel.update_plot)
|
||||
self.daq.fluorimeter_spectrum_update.connect(lambda: self.fluor_panel_dock.setVisible(True))
|
||||
|
||||
self.daq.status_message.connect(self.display_status)
|
||||
|
||||
register_tutorials(self, self.tutorial_manager)
|
||||
|
||||
def start_text_tutorial(self) -> None:
|
||||
@@ -522,9 +524,13 @@ class MainWindow(QMainWindow):
|
||||
self.video_tab.setCurrentIndex(0)
|
||||
|
||||
@Slot(str)
|
||||
def display_error(self, msg: str):
|
||||
self.status_bar.setStyleSheet("color: red;")
|
||||
self.status_bar.showMessage(f'<span style="color: red; "> {msg} </span>', 10000)
|
||||
def display_status(self, msg: str, is_error: bool = True):
|
||||
if is_error:
|
||||
self.status_bar.setStyleSheet("color: red;")
|
||||
self.status_bar.showMessage(f'<span style="color: red; "> {msg} </span>', 10000)
|
||||
else:
|
||||
self.status_bar.setStyleSheet("color: green;")
|
||||
self.status_bar.showMessage(f'<span style="color: green; "> {msg} </span>', 10000)
|
||||
|
||||
def cleanup(self):
|
||||
if self.camera_thread is not None:
|
||||
|
||||
Reference in New Issue
Block a user