diff frontends/src/tools/xmlui.py @ 1579:d5e332055d9f

quick_frontend, primitivus (xmlui): removed _xmluiClose from workflow were submit is triggered, as submit launch the callback which close the dialog itself + fixed dialogs _xmluiClose
author Goffi <goffi@goffi.org>
date Wed, 11 Nov 2015 18:29:32 +0100
parents cb1b0fe10415
children 05274b27e90e
line wrap: on
line diff
--- a/frontends/src/tools/xmlui.py	Wed Nov 11 18:21:20 2015 +0100
+++ b/frontends/src/tools/xmlui.py	Wed Nov 11 18:29:32 2015 +0100
@@ -180,17 +180,16 @@
             data = {}
         self._xmluiSetData(C.XMLUI_STATUS_VALIDATED, data)
         self._xmluiSubmit(data)
-        self._xmluiClose()
 
     def _xmluiCancelled(self):
         data = {C.XMLUI_DATA_CANCELLED: C.BOOL_TRUE}
         self._xmluiSetData(C.XMLUI_STATUS_CANCELLED, data)
         self._xmluiSubmit(data)
-        self._xmluiClose()
 
     def _xmluiSubmit(self, data):
         if self._xmlui_parent.submit_id is None:
             log.debug(_("Nothing to submit"))
+            self._xmluiClose()
         else:
             self._xmlui_parent.submit(data)
 
@@ -295,7 +294,7 @@
         self.host.launchAction(action_id, data, callback=self.callback, profile=self.profile)
 
     def _xmluiClose(self):
-        """Close the window/popup/... where the constructeur XMLUI is
+        """Close the window/popup/... where the constructor XMLUI is
 
         this method must be overrided
         """
@@ -657,7 +656,7 @@
             self.submit(data)
         else:
             log.warning(_("The form data is not sent back, the type is not managed properly"))
-        self._xmluiClose()
+            self._xmluiClose()
 
     def onFormCancelled(self, ignore=None):
         """Called when a form is cancelled"""
@@ -725,6 +724,9 @@
     def show(self):
         self.dlg._xmluiShow()
 
+    def _xmluiClose(self):
+        self.dlg._xmluiClose()
+
 
 def registerClass(type_, class_):
     """Register the class to use with the factory