Skip to content

Commit

Permalink
feat:loading_status_templates (#48)
Browse files Browse the repository at this point in the history
* feat:loading_status_templates

companion PR OpenVoiceOS/ovos-bus-client#151

* feat:loading_status_templates

companion PR OpenVoiceOS/ovos-bus-client#151
  • Loading branch information
JarbasAl authored Dec 26, 2024
1 parent 867f1cc commit 62a8fe8
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 257 deletions.
32 changes: 13 additions & 19 deletions ovos_PHAL_plugin_system/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class SystemEventsPlugin(PHALPlugin):
def __init__(self, bus=None, config=None):
super().__init__(bus=bus, name="ovos-PHAL-plugin-system", config=config)
self.gui = GUIInterface(bus=self.bus, skill_id=self.name,
ui_directories={"qt5": join(dirname(__file__), "ui")},
config=self.config_core.get('gui'))
self.bus.on("system.ssh.status", self.handle_ssh_status)
self.bus.on("system.ssh.enable", self.handle_ssh_enable_request)
Expand Down Expand Up @@ -197,9 +196,7 @@ def on_done(message):

def handle_clock_sync(self, message: Message):
if message.data.get("display", True):
self.gui["status"] = "Enabled"
self.gui["label"] = "Clock Synchronized"
self.gui.show_page("Status")
self.gui.show_status_animation("Clock Synchronized", True)

def handle_ssh_enable_request(self, message: Message):
subprocess.call(f"systemctl enable {self.ssh_service}", shell=True)
Expand All @@ -208,9 +205,7 @@ def handle_ssh_enable_request(self, message: Message):

def handle_ssh_enabled(self, message: Message):
if message.data.get("display", True):
self.gui["status"] = "Enabled"
self.gui["label"] = "SSH Enabled"
self.gui.show_page("Status")
self.gui.show_status_animation("SSH Enabled", True)

def handle_ssh_disable_request(self, message: Message):
subprocess.call(f"systemctl stop {self.ssh_service}", shell=True)
Expand All @@ -220,17 +215,16 @@ def handle_ssh_disable_request(self, message: Message):
def handle_ssh_disabled(self, message: Message):
# ovos-shell does not want to display
if message.data.get("display", True):
self.gui["status"] = "Disabled"
self.gui["label"] = "SSH Disabled"
self.gui.show_page("Status")
self.gui.show_status_animation("SSH Disabled", False)

def handle_rebooting(self, message: Message):
"""
reboot has started
"""
if message.data.get("display", True):
self.gui.show_page("Reboot", override_animations=True,
override_idle=True)
self.gui.show_loading_animation("Rebooting",
override_animations=True,
override_idle=True)

def handle_reboot_request(self, message: Message):
"""
Expand All @@ -249,8 +243,9 @@ def handle_shutting_down(self, message: Message):
shutdown has started
"""
if message.data.get("display", True):
self.gui.show_page("Shutdown", override_animations=True,
override_idle=True)
self.gui.show_loading_animation("Shutting Down",
override_animations=True,
override_idle=True)

def handle_shutdown_request(self, message: Message):
"""
Expand Down Expand Up @@ -278,17 +273,16 @@ def handle_configure_language_request(self, message: Message):
# it is usually part of other groups of actions that may
# provide their own UI
if message.data.get("display", False):
self.gui["status"] = "Enabled"
self.gui["label"] = f"Language changed to {language_code}"
self.gui.show_page("Status")
self.gui.show_status_animation(f"Language changed to {language_code}", True)

self.bus.emit(Message('system.configure.language.complete',
{"lang": language_code}))

def handle_mycroft_restarting(self, message: Message):
if message.data.get("display", True):
self.gui.show_page("Restart", override_animations=True,
override_idle=True)
self.gui.show_loading_animation("Restarting",
override_animations=True,
override_idle=True)

def handle_mycroft_restart_request(self, message: Message):
service = self.core_service_name
Expand Down
56 changes: 0 additions & 56 deletions ovos_PHAL_plugin_system/ui/Reboot.qml

This file was deleted.

56 changes: 0 additions & 56 deletions ovos_PHAL_plugin_system/ui/Restart.qml

This file was deleted.

56 changes: 0 additions & 56 deletions ovos_PHAL_plugin_system/ui/Shutdown.qml

This file was deleted.

66 changes: 0 additions & 66 deletions ovos_PHAL_plugin_system/ui/Status.qml

This file was deleted.

Loading

0 comments on commit 62a8fe8

Please sign in to comment.