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 #48

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
Loading