Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:loading_status_templates #151

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading