comparison frontends/src/quick_frontend/quick_app.py @ 1930:70ce9421c4d3

quick frontend (QuickApp): added ui_show_cb in actionManager, so frontend can handle the display of the XMLUI itself
author Goffi <goffi@goffi.org>
date Sat, 26 Mar 2016 16:15:23 +0100
parents d678b723460b
children 2daf7b4c6756
comparison
equal deleted inserted replaced
1929:b603a3d516d3 1930:70ce9421c4d3
749 raise NotImplementedError 749 raise NotImplementedError
750 750
751 def actionResultHandler(self, type, id, data, profile): 751 def actionResultHandler(self, type, id, data, profile):
752 raise NotImplementedError 752 raise NotImplementedError
753 753
754 def actionManager(self, action_data, callback=None, profile=C.PROF_KEY_NONE): 754 def actionManager(self, action_data, callback=None, ui_show_cb=None, profile=C.PROF_KEY_NONE):
755 """Handle backend action
756
757 @param action_data(dict): action dict as sent by launchAction or returned by an UI action
758 @param callback(None, callback): if not None, callback to use on XMLUI answer
759 @param ui_show_cb(None, callback): if not None, method to call to show the XMLUI
760 """
755 try: 761 try:
756 xmlui = action_data.pop('xmlui') 762 xmlui = action_data.pop('xmlui')
757 except KeyError: 763 except KeyError:
758 pass 764 pass
759 else: 765 else:
760 ui = self.xmlui.create(self, xml_data=xmlui, callback=callback, profile=profile) 766 ui = self.xmlui.create(self, xml_data=xmlui, callback=callback, profile=profile)
761 ui.show() 767 if ui_show_cb is None:
768 ui.show()
769 else:
770 ui_show_cb(ui)
762 771
763 try: 772 try:
764 progress_id = action_data.pop('progress') 773 progress_id = action_data.pop('progress')
765 except KeyError: 774 except KeyError:
766 pass 775 pass