Skip to content

Commit

Permalink
rm dead code + handle homescreen edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Nov 4, 2024
1 parent 0150d74 commit 9cf3144
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions ovos_gui/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9cf3144

Please sign in to comment.