From 9cf3144289f7b49ae009a892fc979b7eab805d6c Mon Sep 17 00:00:00 2001 From: miro Date: Mon, 4 Nov 2024 17:23:34 +0000 Subject: [PATCH] rm dead code + handle homescreen edge case --- ovos_gui/namespace.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index 0243643..5113aa8 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -429,14 +429,9 @@ def __init__(self, core_bus: MessageBusClient): self.idle_display_skill = _get_idle_display_config() self.active_extension = _get_active_gui_extension() self._system_res_dir = join(dirname(__file__), "res", "gui") - self._ready_event = Event() self._init_gui_file_share() self._define_message_handlers() - @property - def _active_homescreen(self) -> str: - return Configuration().get('gui', {}).get('idle_display_skill') - def _init_gui_file_share(self): """ Initialize optional GUI file collection. if `gui_file_path` is @@ -461,20 +456,6 @@ def _define_message_handlers(self): self.core_bus.on("gui.page_gained_focus", self.handle_page_gained_focus) self.core_bus.on("mycroft.gui.screen.close", self.handle_namespace_global_back) - # 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() - def handle_clear_namespace(self, message: Message): """ Handles a request to remove a namespace. @@ -890,7 +871,8 @@ def handle_namespace_global_back(self, message: Optional[Message]): @param message: the event sent by the GUI """ if not self.active_namespaces: - LOG.error("received 'back' signal but there are no active namespaces") + LOG.debug("received 'back' signal but there are no active namespaces, attempting to show homescreen") + self.core_bus.emit(Message("homescreen.manager.show_active")) return namespace_name = self.active_namespaces[0].skill_id