diff --git a/ovos_gui_plugin_shell_companion/__init__.py b/ovos_gui_plugin_shell_companion/__init__.py index 8908778..f30b7eb 100644 --- a/ovos_gui_plugin_shell_companion/__init__.py +++ b/ovos_gui_plugin_shell_companion/__init__.py @@ -75,9 +75,8 @@ def register_bus_events(self): self.gui.register_handler("mycroft.device.settings.factory", self.handle_device_display_factory) # Display settings - self.gui.register_handler("speaker.extension.display.set.wallpaper.rotation", - self.handle_display_wallpaper_rotation_config_set) - self.gui.register_handler("speaker.extension.display.set.auto.dim", self.handle_display_auto_dim_config_set) + self.gui.register_handler("speaker.extension.display.set.auto.dim", + self.handle_display_auto_dim_config_set) self.gui.register_handler("speaker.extension.display.set.auto.nightmode", self.handle_display_auto_nightmode_config_set) @@ -142,7 +141,7 @@ def handle_device_display_factory(self, message): def handle_device_display_settings(self, message): LOG.debug(f"Display settings: {self.local_display_config}") self.gui['state'] = 'settings/display_settings' - self.gui['display_wallpaper_rotation'] = self.local_display_config.get("wallpaper_rotation", False) + # wallpaper_rotation data is determined via Messagebus in Qt directly self.gui['display_auto_dim'] = self.local_display_config.get("auto_dim", False) self.gui['display_auto_nightmode'] = self.local_display_config.get("auto_nightmode", False) self.gui.show_page("SYSTEM_AdditionalSettings.qml", override_idle=True) @@ -155,12 +154,6 @@ def handle_device_about_page(self, message): self.gui['system_info'] = system_information self.gui.show_page("SYSTEM_AdditionalSettings.qml", override_idle=True) - def handle_display_wallpaper_rotation_config_set(self, message): - wallpaper_rotation = message.data.get("wallpaper_rotation", False) - self.local_display_config["wallpaper_rotation"] = wallpaper_rotation - self.local_display_config.store() - self.bus.emit(Message("speaker.extension.display.wallpaper.rotation.changed")) - def handle_display_auto_dim_config_set(self, message): auto_dim = message.data.get("auto_dim", False) self.local_display_config["auto_dim"] = auto_dim diff --git a/ovos_gui_plugin_shell_companion/res/ui/settings/display_settings.qml b/ovos_gui_plugin_shell_companion/res/ui/settings/display_settings.qml index 911b48b..83ea3e6 100644 --- a/ovos_gui_plugin_shell_companion/res/ui/settings/display_settings.qml +++ b/ovos_gui_plugin_shell_companion/res/ui/settings/display_settings.qml @@ -33,12 +33,12 @@ Item { property bool menuLabelsEnabled: false function getAutoRotation() { - Mycroft.MycroftController.sendRequest("ovos.wallpaper.manager.get.auto.rotation", {}) + Mycroft.MycroftController.sendRequest("ovos.wallpaper.manager.get.auto.rotation", {}, {"session": {"session_id": "default"}}) } Component.onCompleted: { getAutoRotation() - Mycroft.MycroftController.sendRequest("ovos.shell.get.menuLabels.status", {}) + Mycroft.MycroftController.sendRequest("ovos.shell.get.menuLabels.status", {}, {"session": {"session_id": "default"}}) } Connections { @@ -161,7 +161,12 @@ Item { onClicked: { console.log(autoWallpaperRotationSwitch.checked) Mycroft.SoundEffects.playClickedSound(Qt.resolvedUrl("../snd/clicked.wav")) - triggerGuiEvent("speaker.extension.display.set.wallpaper.rotation", {"wallpaper_rotation": autoWallpaperRotationSwitch.checked}) + if (autoWallpaperRotationSwitch.checked === true) { + Mycroft.MycroftController.sendRequest("ovos.wallpaper.manager.enable.auto.rotation", {}, {"session": {"session_id": "default"}}) + } + else { + Mycroft.MycroftController.sendRequest("ovos.wallpaper.manager.disable.auto.rotation", {}, {"session": {"session_id": "default"}}) + } } } } @@ -365,7 +370,7 @@ Item { onClicked: { console.log(displayMenuLabelsSwitch.checked) Mycroft.SoundEffects.playClickedSound(Qt.resolvedUrl("../snd/clicked.wav")) - Mycroft.MycroftController.sendRequest("ovos.shell.set.menuLabels", {"enabled": displayMenuLabelsSwitch.checked}) + Mycroft.MycroftController.sendRequest("ovos.shell.set.menuLabels", {"enabled": displayMenuLabelsSwitch.checked}, {"session": {"session_id": "default"}}) } } }