Skip to content

Commit

Permalink
feat:loading_status_templates (#151)
Browse files Browse the repository at this point in the history
extracted from system PHAL for re-use and uncoupling of GUI resources from skills/plugins

companion PR OpenVoiceOS/ovos-gui#68
  • Loading branch information
JarbasAl authored Dec 26, 2024
1 parent d5b4ed4 commit 100dee6
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions ovos_bus_client/apis/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,46 @@ def remove_controlled_notification(self):
raise RuntimeError("bus not set, did you call self.bind() ?")
self.bus.emit(Message("ovos.notification.api.remove.controlled"))

def show_loading_animation(self, text: str,
override_idle: Union[int, bool] = None,
override_animations: bool = False):
"""
Display a GUI loading animation
Arguments:
text (str): Main text content.
override_idle (boolean, int):
True: Takes over the resting page indefinitely
(int): Delays resting page for the specified number of
seconds.
override_animations (boolean):
True: Disables showing all platform skill animations.
False: 'Default' always show animations.
"""
self["label"] = text
self.show_page("SYSTEM_Loading", override_idle, override_animations)

def show_status_animation(self, text: str, success: bool,
override_idle: Union[int, bool] = None,
override_animations: bool = False):
"""
Display a success/failure animation.
Arguments:
text (str): Main text content.
success (bool): Success (True) or Failure (False) animation
override_idle (boolean, int):
True: Takes over the resting page indefinitely
(int): Delays resting page for the specified number of
seconds.
override_animations (boolean):
True: Disables showing all platform skill animations.
False: 'Default' always show animations.
"""
self["status"] = "Enabled" if success else "Disabled" # string check in QML
self["label"] = text
self.show_page("SYSTEM_Status", override_idle, override_animations)

def show_text(self, text: str, title: Optional[str] = None,
override_idle: Union[int, bool] = None,
override_animations: bool = False):
Expand Down

0 comments on commit 100dee6

Please sign in to comment.