diff --git a/src/UBUVoiceAssistant/GUI/link_mycroft.py b/src/UBUVoiceAssistant/GUI/link_mycroft.py index c2bc08e..2b9863a 100644 --- a/src/UBUVoiceAssistant/GUI/link_mycroft.py +++ b/src/UBUVoiceAssistant/GUI/link_mycroft.py @@ -132,7 +132,8 @@ def hide_all_elements(self): def closeEvent(self, event: QtGui.QCloseEvent) -> None: if self.done: - self.closed_signal.emit() # type: ignore + self.closed_signal.emit() + time.sleep(2) # type: ignore event.accept() else: self.close_window = MessageBox(_("Are you sure?")) diff --git a/src/UBUVoiceAssistant/GUI/main.py b/src/UBUVoiceAssistant/GUI/main.py index fab579b..750e92b 100644 --- a/src/UBUVoiceAssistant/GUI/main.py +++ b/src/UBUVoiceAssistant/GUI/main.py @@ -44,6 +44,7 @@ def __init__(self): self.btnLogin.clicked.connect(self.on_login) self.update_texts() self.mycroft_started = False + self.finished = False self.timer = QtCore.QTimer() self.timer.timeout.connect(self.check_mycroft_started) self.show() @@ -138,15 +139,18 @@ def check_mycroft_started(self): self.timer.stop() self.starting_window.done = True self.starting_window.close() + print("Pairing file:", path.isfile(path.expanduser("~/.mycroft/identity/identity2.json"))) if not path.isfile(path.expanduser("~/.mycroft/identity/identity2.json")): self.new_window = LinkMycroft(self.bus) self.new_window.show() self.hide() self.new_window.closed_signal.connect(self.check_mycroft_started) else: - self.new_window = ChatWindow(self.bus, self.ws) - self.new_window.show() - self.hide() + if not self.finished: + self.new_window = ChatWindow(self.bus, self.ws) + self.new_window.show() + self.hide() + self.finished = True def set_reconnect_1s(self, event = None): print("Set reconnect time")