comparison frontends/src/primitivus/xmlui.py @ 1580:641cfd2faefe

Primitivus: better popups handling: - widget to remove can now be specified in removePopUp: if it is not the current one, it will be removed from queue - Primitivus.Alert method is a shortcut to display an Alert which will be removed on "OK" press - showDialog is now obsolete and removed, if generic dialog creation is needed, XMLUI can be used
author Goffi <goffi@goffi.org>
date Wed, 11 Nov 2015 18:32:59 +0100
parents d5e332055d9f
children 1378ec04380f
comparison
equal deleted inserted replaced
1579:d5e332055d9f 1580:641cfd2faefe
326 326
327 def _xmluiShow(self): 327 def _xmluiShow(self):
328 self.host.showPopUp(self) 328 self.host.showPopUp(self)
329 329
330 def _xmluiClose(self): 330 def _xmluiClose(self):
331 self.host.removePopUp() 331 self.host.removePopUp(self)
332 332
333 333
334 class PrimitivusMessageDialog(PrimitivusDialog, xmlui.MessageDialog, sat_widgets.Alert): 334 class PrimitivusMessageDialog(PrimitivusDialog, xmlui.MessageDialog, sat_widgets.Alert):
335 335
336 def __init__(self, _xmlui_parent, title, message, level): 336 def __init__(self, _xmlui_parent, title, message, level):
453 453
454 def _xmluiClose(self): 454 def _xmluiClose(self):
455 if self._dest == 'window': 455 if self._dest == 'window':
456 self.host.removeWindow() 456 self.host.removeWindow()
457 elif self._dest == 'popup': 457 elif self._dest == 'popup':
458 self.host.removePopUp() 458 self.host.removePopUp(self)
459 else: 459 else:
460 raise exceptions.InternalError("self._dest unknown, are you sure you have called XMLUI.show ?") 460 raise exceptions.InternalError("self._dest unknown, are you sure you have called XMLUI.show ?")
461 461
462 462
463 class XMLUIDialog(xmlui.XMLUIDialog): 463 class XMLUIDialog(xmlui.XMLUIDialog):