primitivus (xmlui): fixed closing on popup panel "OK" button press

This commit is contained in:
Goffi 2015-11-16 09:25:05 +01:00
commit fd271b69ba

View file

@ -406,7 +406,7 @@ class XMLUIPanel(xmlui.XMLUIPanel, PrimitivusWidget):
if not 'NO_CANCEL' in self.flags:
buttons.append(urwid.Button(_('Cancel'), self.onFormCancelled))
else:
buttons.append(urwid.Button(_('OK')))
buttons.append(urwid.Button(_('OK'), on_press=lambda dummy: self._xmluiClose()))
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)