def console_disconnect(self) -> None: """Turn the console log to OS command line (stdout).""" logger.info("Disconnect from GUI console.") XStream.back() self.console_connect_button.setEnabled(True) self.console_disconnect_button.setEnabled(False) logger.info("Disconnect from GUI console.")
def console_connect(self) -> None: """Turn the OS command line (stdout) log to console.""" logger.info("Connect to GUI console.") XStream.stdout().message_written.connect(self.__append_to_console) self.console_connect_button.setEnabled(False) self.console_disconnect_button.setEnabled(True) logger.info("Connect to GUI console.")
def closeEvent(self, event: QCloseEvent) -> None: """Close event to avoid user close the window accidentally.""" if self.check_file_changed(): event.ignore() return if self.inputs_widget.inputs_play_shaft.isActive(): self.inputs_widget.inputs_play_shaft.stop() self.save_settings() XStream.back() logger.info("Exit") event.accept()