Skip to content

Commit

Permalink
refactor: drop custom QML (#58)
Browse files Browse the repository at this point in the history
move face template to ovos-gui, moving towards a non QT5 GUIs support
  • Loading branch information
JarbasAl authored Dec 26, 2024
1 parent 622f3e5 commit 5c55a0a
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 219 deletions.
40 changes: 2 additions & 38 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,48 +111,12 @@ def mark1_wake_up_animation(self, message: Message):
# GUI integration
def display_sleep_face(self) -> None:
"""Display the sleeping face depending on the platform."""
self.gui.show_page("resting", override_idle=True)
self.gui.show_face(awake=False, override_idle=True)
self.set_context("sleeping_state")

def display_waking_face(self) -> None:
"""Display the waking face depending on the platform."""
self.gui.remove_page("resting")
self.gui.show_page("awake", override_idle=5)
# TODO Screen not reverting after the specified 5 seconds.
# The following 2 lines shouldn't be needed. Remove when fixed.
time.sleep(5)
self.gui.release()

# TODO notifications api not yet merged
# merge this into ovos_workshop
def show_notification(self, content, action=None, noticetype="transient"):
"""Display a Notification on homepage in the GUI.
Arguments:
content (str): Main text content of a notification, Limited
to two visual lines.
action (str): Callback to any event registered by the skill
to perform a certain action when notification is
clicked.
noticetype (str):
transient: 'Default' displays a notification with a timeout.
sticky: displays a notification that sticks to the screen.
"""
self.bus.emit(
Message(
"homescreen.notification.set",
data={
"sender": self.skill_id,
"text": content,
"action": action,
"type": noticetype,
},
)
)

def handle_speak(self, message: Message):
if self.sleeping:
utt = message.data["utterance"]
self.show_notification(utt)
self.gui.show_face(awake=True, override_idle=5)

@intent_handler("naptime.intent")
def handle_go_to_sleep(self, message: Message):
Expand Down
133 changes: 0 additions & 133 deletions gui/qt5/Face.qml

This file was deleted.

16 changes: 0 additions & 16 deletions gui/qt5/awake.qml

This file was deleted.

3 changes: 0 additions & 3 deletions gui/qt5/face/Eyeball.svg

This file was deleted.

3 changes: 0 additions & 3 deletions gui/qt5/face/GreySmile.svg

This file was deleted.

3 changes: 0 additions & 3 deletions gui/qt5/face/Smile.svg

This file was deleted.

3 changes: 0 additions & 3 deletions gui/qt5/face/lid.svg

This file was deleted.

3 changes: 0 additions & 3 deletions gui/qt5/face/upper-lid.svg

This file was deleted.

16 changes: 0 additions & 16 deletions gui/qt5/resting.qml

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ovos-utils>=0.0.38
ovos-workshop>=0.0.15,<4.0.0
ovos-bus-client>=0.0.8,<2.0.0
ovos-bus-client>=1.2.0,<2.0.0

0 comments on commit 5c55a0a

Please sign in to comment.