# HG changeset patch # User Goffi # Date 1447262972 -3600 # Node ID d5e332055d9fa046eb5e5f59db9763f60c1b8237 # Parent 7fef6cdf5953ac5348e2c8e5cf184f8703d6af7c 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 diff -r 7fef6cdf5953 -r d5e332055d9f frontends/src/primitivus/xmlui.py --- a/frontends/src/primitivus/xmlui.py Wed Nov 11 18:21:20 2015 +0100 +++ b/frontends/src/primitivus/xmlui.py Wed Nov 11 18:29:32 2015 +0100 @@ -406,7 +406,7 @@ if not 'NO_CANCEL' in self.flags: buttons.append(urwid.Button(_('Cancel'), self.onFormCancelled)) else: - buttons.append(urwid.Button(_('OK'), lambda dummy: self._xmluiClose())) + buttons.append(urwid.Button(_('OK'))) max_len = max([len(button.get_label()) for button in buttons]) grid_wid = urwid.GridFlow(buttons, max_len + 4, 1, 0, 'center') self.main_cont.body.append(grid_wid) diff -r 7fef6cdf5953 -r d5e332055d9f frontends/src/tools/xmlui.py --- 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