changeset 492:5114bbb5daa3

plugin remove: update `action_launch` call following changes in bridge API
author Goffi <goffi@goffi.org>
date Fri, 02 Jun 2023 17:53:09 +0200
parents 203755bbe0fe
children b3cedbee561d
files cagou/plugins/plugin_wid_remote.py
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_remote.py	Sat Apr 08 13:44:32 2023 +0200
+++ b/cagou/plugins/plugin_wid_remote.py	Fri Jun 02 17:53:09 2023 +0200
@@ -27,6 +27,7 @@
 from ..core.common_widgets import (Identities, ItemWidget, DeviceWidget,
                                        CategorySeparator)
 from sat.tools.common import template_xmlui
+from sat.tools.common import data_format
 from cagou.core import xmlui
 from sat_frontends.tools import jid
 from kivy import properties
@@ -75,7 +76,8 @@
     def profile(self):
         return self.main_wid.profile
 
-    def update_ui(self, action_data):
+    def update_ui(self, action_data_s):
+        action_data = data_format.deserialise(action_data_s)
         xmlui_raw = action_data['xmlui']
         ui_tpl = template_xmlui.create(G.host, xmlui_raw)
         self.ui_tpl = ui_tpl
@@ -104,9 +106,10 @@
         data = {xmlui.XMLUIPanel.escape("media_player"): self.remote_item.node,
                 "session_id": ui_tpl.session_id}
         G.host.bridge.action_launch(
-            ui_tpl.submit_id, data, self.profile,
-            callback=self.update_ui,
-            errback=self.main_wid.errback)
+            ui_tpl.submit_id, data_format.serialise(data),
+            self.profile, callback=self.update_ui,
+            errback=self.main_wid.errback
+        )
 
     def on_remote_item(self, __, remote):
         NS_MEDIA_PLAYER = G.host.ns_map["mediaplayer"]
@@ -131,9 +134,9 @@
                       for k,v in self.ui_tpl.hidden.items()}
             data.update(hidden)
             G.host.bridge.action_launch(
-                self.ui_tpl.submit_id, data, self.profile,
-                callback=self.update_ui,
-                errback=self.main_wid.errback)
+                self.ui_tpl.submit_id, data_format.serialise(data), self.profile,
+                callback=self.update_ui, errback=self.main_wid.errback
+            )
 
 
 class RemoteDeviceWidget(DeviceWidget):