Skip to content

Commit

Permalink
Emit Messagebus event directly from QML instead of via GUI event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jun 12, 2024
1 parent ca71de4 commit 626b215
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions ovos_gui_plugin_shell_companion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,6 @@ def handle_display_wallpaper_rotation_config_set(self, message: GUIMessage):
self.local_display_config["wallpaper_rotation"] = wallpaper_rotation
self.local_display_config.store()

LOG.info(message.data)
# TODO: Is rotation time defined here?

if wallpaper_rotation:
msg_type = "ovos.wallpaper.manager.enable.auto.rotation"
else:
msg_type = "ovos.wallpaper.manager.disable.auto.rotation"
self.bus.emit(message.forward(msg_type))
# TODO Is the below message consumed anywhere?
self.bus.emit(message.forward("speaker.extension.display.wallpaper.rotation.changed"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ Item {
onClicked: {
console.log(autoWallpaperRotationSwitch.checked)
Mycroft.SoundEffects.playClickedSound(Qt.resolvedUrl("../snd/clicked.wav"))
if (autoWallpaperRotationSwitch.checked) {
Mycroft.MycroftController.sendRequest("ovos.wallpaper.manager.enable.auto.rotation")
}
else {
Mycroft.MycroftController.sendRequest("ovos.wallpaper.manager.disable.auto.rotation")
}
// TODO: deprecate this event?
triggerGuiEvent("speaker.extension.display.set.wallpaper.rotation", {"wallpaper_rotation": autoWallpaperRotationSwitch.checked})
}
}
Expand Down

0 comments on commit 626b215

Please sign in to comment.