comparison sat_frontends/jp/cmd_file.py @ 4041:2594e1951cf7

core (bridge): `action_new` now use serialised dict for extra data.
author Goffi <goffi@goffi.org>
date Mon, 15 May 2023 16:20:45 +0200
parents 524856bd7b19
children 877145b4ba01
comparison
equal deleted inserted replaced
4040:1f967f85fc23 4041:2594e1951cf7
385 385
386 if not self.bare_jids or from_jid.bare in self.bare_jids: 386 if not self.bare_jids or from_jid.bare in self.bare_jids:
387 if self._overwrite_refused: 387 if self._overwrite_refused:
388 self.disp(_("File refused because overwrite is needed"), error=True) 388 self.disp(_("File refused because overwrite is needed"), error=True)
389 await self.host.bridge.action_launch( 389 await self.host.bridge.action_launch(
390 xmlui_id, {"cancelled": C.BOOL_TRUE}, profile_key=profile 390 xmlui_id, data_format.serialise({"cancelled": C.BOOL_TRUE}),
391 profile_key=profile
391 ) 392 )
392 return self.host.quit_from_signal(2) 393 return self.host.quit_from_signal(2)
393 await self.set_progress_id(progress_id) 394 await self.set_progress_id(progress_id)
394 xmlui_data = {"path": self.path} 395 xmlui_data = {"path": self.path}
395 await self.host.bridge.action_launch(xmlui_id, xmlui_data, profile_key=profile) 396 await self.host.bridge.action_launch(
397 xmlui_id, data_format.serialise(xmlui_data), profile_key=profile
398 )
396 399
397 async def on_overwrite_action(self, action_data, action_id, security_limit, profile): 400 async def on_overwrite_action(self, action_data, action_id, security_limit, profile):
398 xmlui_id = self.get_xmlui_id(action_data) 401 xmlui_id = self.get_xmlui_id(action_data)
399 if xmlui_id is None: 402 if xmlui_id is None:
400 return self.host.quit_from_signal(1) 403 return self.host.quit_from_signal(1)
411 else: 414 else:
412 self.disp(_("Refused to overwrite"), 2) 415 self.disp(_("Refused to overwrite"), 2)
413 self._overwrite_refused = True 416 self._overwrite_refused = True
414 417
415 xmlui_data = {"answer": C.bool_const(self.args.force)} 418 xmlui_data = {"answer": C.bool_const(self.args.force)}
416 await self.host.bridge.action_launch(xmlui_id, xmlui_data, profile_key=profile) 419 await self.host.bridge.action_launch(
420 xmlui_id, data_format.serialise(xmlui_data), profile_key=profile
421 )
417 422
418 async def on_not_in_roster_action(self, action_data, action_id, security_limit, profile): 423 async def on_not_in_roster_action(self, action_data, action_id, security_limit, profile):
419 xmlui_id = self.get_xmlui_id(action_data) 424 xmlui_id = self.get_xmlui_id(action_data)
420 if xmlui_id is None: 425 if xmlui_id is None:
421 return self.host.quit_from_signal(1) 426 return self.host.quit_from_signal(1)
441 else: 446 else:
442 xmlui = xmlui_manager.create(self.host, action_data["xmlui"]) 447 xmlui = xmlui_manager.create(self.host, action_data["xmlui"])
443 confirmed = await self.host.confirm(xmlui.dlg.message) 448 confirmed = await self.host.confirm(xmlui.dlg.message)
444 449
445 xmlui_data = {"answer": C.bool_const(confirmed)} 450 xmlui_data = {"answer": C.bool_const(confirmed)}
446 await self.host.bridge.action_launch(xmlui_id, xmlui_data, profile_key=profile) 451 await self.host.bridge.action_launch(
452 xmlui_id, data_format.serialise(xmlui_data), profile_key=profile
453 )
447 if not confirmed and not self.args.multiple: 454 if not confirmed and not self.args.multiple:
448 self.disp(_("Session refused for {from_jid}").format(from_jid=from_jid)) 455 self.disp(_("Session refused for {from_jid}").format(from_jid=from_jid))
449 self.host.quit_from_signal(0) 456 self.host.quit_from_signal(0)
450 457
451 async def start(self): 458 async def start(self):