From d8c6eb17d731364e3f1a113e2ad20f8ce29c97ef Mon Sep 17 00:00:00 2001 From: miro Date: Mon, 21 Oct 2024 13:15:08 +0100 Subject: [PATCH] fix:no wait for ready dont wait for mycroft.ready message, display homescreen ASAP --- ovos_gui/namespace.py | 15 ++++++++++++--- ovos_gui/service.py | 10 ---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index 0c4ca5e..3aeb009 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -480,13 +480,22 @@ def _define_message_handlers(self): self.core_bus.on("mycroft.gui.connected", self.handle_client_connected) self.core_bus.on("gui.page_interaction", self.handle_page_interaction) self.core_bus.on("gui.page_gained_focus", self.handle_page_gained_focus) - self.core_bus.on("mycroft.skills.trained", self.handle_ready) self.core_bus.on("mycroft.gui.screen.close", self.handle_namespace_global_back) + self.core_bus.on("gui.volunteer_page_upload", self.handle_gui_pages_available) + + # TODO - deprecate this, only needed for gui bus upload + # Bus is connected, check if the skills service is ready + resp = self.core_bus.wait_for_response( + Message("mycroft.skills.is_ready", + context={"source": "gui", "destination": ["skills"]})) + if resp and resp.data.get("status"): + LOG.debug("Skills service already running") + self._ready_event.set() + else: + self.core_bus.on("mycroft.skills.trained", self.handle_ready) def handle_ready(self, message): self._ready_event.set() - self.core_bus.on("gui.volunteer_page_upload", - self.handle_gui_pages_available) def handle_gui_pages_available(self, message: Message): """ diff --git a/ovos_gui/service.py b/ovos_gui/service.py index ac34451..377d46f 100644 --- a/ovos_gui/service.py +++ b/ovos_gui/service.py @@ -63,16 +63,6 @@ def run(self): self.extension_manager = ExtensionsManager("EXTENSION_SERVICE", self.bus) self.namespace_manager = NamespaceManager(self.bus) - - # Bus is connected, check if the skills service is ready - resp = self.bus.wait_for_response( - Message("mycroft.skills.is_ready", - context={"source": "gui", "destination": ["skills"]})) - if resp and resp.data.get("status"): - LOG.debug("Skills service already running") - self.namespace_manager.handle_ready(resp) - self.extension_manager.homescreen_manager.set_mycroft_ready(resp) - self.status.set_ready() LOG.info(f"GUI Service Ready")