quick frontend: added progressIdHandler to managed progress id on action result + ignore meta_* action results
This commit is contained in:
parent
1c86c2b9b4
commit
51a5b7c56f
1 changed files with 15 additions and 0 deletions
|
|
@ -675,6 +675,10 @@ class QuickApp(object):
|
|||
def dialogFailure(self, failure):
|
||||
log.warning(u"Failure: {}".format(failure))
|
||||
|
||||
def progressIdHandler(self, progress_id, profile):
|
||||
"""Callback used when an action result in a progress id"""
|
||||
log.info(u"Progress ID received: {}".format(progress_id))
|
||||
|
||||
def updateAlertsCounter(self):
|
||||
"""Update the over whole alerts counter
|
||||
|
||||
|
|
@ -722,6 +726,17 @@ class QuickApp(object):
|
|||
else:
|
||||
ui = self.xmlui.create(self, xml_data=xmlui, callback=callback, profile=profile)
|
||||
ui.show()
|
||||
|
||||
try:
|
||||
progress_id = action_data.pop('progress')
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
self.progressIdHandler(progress_id, profile)
|
||||
|
||||
# we ignore metadata
|
||||
action_data = {k:v for k,v in action_data.iteritems() if not k.startswith("meta_")}
|
||||
|
||||
if action_data:
|
||||
raise exceptions.DataError(u"Not all keys in action_data are managed ({keys})".format(keys=', '.join(action_data.keys())))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue