quick frontend (QuickApp): added ui_show_cb in actionManager, so frontend can handle the display of the XMLUI itself
This commit is contained in:
parent
f600da971e
commit
74409e5e64
1 changed files with 11 additions and 2 deletions
|
|
@ -751,14 +751,23 @@ class QuickApp(object):
|
|||
def actionResultHandler(self, type, id, data, profile):
|
||||
raise NotImplementedError
|
||||
|
||||
def actionManager(self, action_data, callback=None, profile=C.PROF_KEY_NONE):
|
||||
def actionManager(self, action_data, callback=None, ui_show_cb=None, profile=C.PROF_KEY_NONE):
|
||||
"""Handle backend action
|
||||
|
||||
@param action_data(dict): action dict as sent by launchAction or returned by an UI action
|
||||
@param callback(None, callback): if not None, callback to use on XMLUI answer
|
||||
@param ui_show_cb(None, callback): if not None, method to call to show the XMLUI
|
||||
"""
|
||||
try:
|
||||
xmlui = action_data.pop('xmlui')
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
ui = self.xmlui.create(self, xml_data=xmlui, callback=callback, profile=profile)
|
||||
ui.show()
|
||||
if ui_show_cb is None:
|
||||
ui.show()
|
||||
else:
|
||||
ui_show_cb(ui)
|
||||
|
||||
try:
|
||||
progress_id = action_data.pop('progress')
|
||||
|
|
|
|||
Loading…
Reference in a new issue