Mercurial > libervia-web
comparison src/browser/sat_browser/xmlui.py @ 504:f030491cff75
browser side (XMLUI): fixed bad use of text instead of XHTML in dialogs
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 20 Aug 2014 20:59:13 +0200 |
parents | 67a4e8383b70 |
children | fed185c95f1c |
comparison
equal
deleted
inserted
replaced
503:88ece2a00c63 | 504:f030491cff75 |
---|---|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 |
20 from sat.core.log import getLogger | 20 from sat.core.log import getLogger |
21 log = getLogger(__name__) | 21 log = getLogger(__name__) |
22 from sat_frontends.tools import xmlui | 22 from sat_frontends.tools import xmlui |
23 from sat_frontends.tools import strings | |
23 from sat_browser.constants import Const as C | 24 from sat_browser.constants import Const as C |
24 from sat_browser import dialog | 25 from sat_browser import dialog |
26 from sat_browser import html_tools | |
25 | 27 |
26 from pyjamas.ui.VerticalPanel import VerticalPanel | 28 from pyjamas.ui.VerticalPanel import VerticalPanel |
27 from pyjamas.ui.HorizontalPanel import HorizontalPanel | 29 from pyjamas.ui.HorizontalPanel import HorizontalPanel |
28 from pyjamas.ui.TabPanel import TabPanel | 30 from pyjamas.ui.TabPanel import TabPanel |
29 from pyjamas.ui.Grid import Grid | 31 from pyjamas.ui.Grid import Grid |
307 | 309 |
308 class MessageDialog(Dlg, xmlui.MessageDialog, dialog.InfoDialog): | 310 class MessageDialog(Dlg, xmlui.MessageDialog, dialog.InfoDialog): |
309 | 311 |
310 def __init__(self, _xmlui_parent, title, message, level): | 312 def __init__(self, _xmlui_parent, title, message, level): |
311 #TODO: level is not managed | 313 #TODO: level is not managed |
314 title = html_tools.html_sanitize(title) | |
315 message = strings.addURLToText(html_tools.XHTML2Text(message)) | |
312 Dlg.__init__(self) | 316 Dlg.__init__(self) |
313 xmlui.MessageDialog.__init__(self, _xmlui_parent) | 317 xmlui.MessageDialog.__init__(self, _xmlui_parent) |
314 dialog.InfoDialog.__init__(self, title, message, self._xmluiValidated()) | 318 dialog.InfoDialog.__init__(self, title, message, self._xmluiValidated()) |
315 | 319 |
316 | 320 |
324 | 328 |
325 class ConfirmDialog(xmlui.ConfirmDialog, Dlg, dialog.ConfirmDialog): | 329 class ConfirmDialog(xmlui.ConfirmDialog, Dlg, dialog.ConfirmDialog): |
326 | 330 |
327 def __init__(self, _xmlui_parent, title, message, level): | 331 def __init__(self, _xmlui_parent, title, message, level): |
328 #TODO: level is not managed | 332 #TODO: level is not managed |
333 title = html_tools.html_sanitize(title) | |
334 message = strings.addURLToText(html_tools.XHTML2Text(message)) | |
329 xmlui.ConfirmDialog.__init__(self, _xmlui_parent) | 335 xmlui.ConfirmDialog.__init__(self, _xmlui_parent) |
330 print "self.parent = %s" % self._xmlui_parent | |
331 Dlg.__init__(self) | 336 Dlg.__init__(self) |
332 dialog.ConfirmDialog.__init__(self, self.answered, message, title) | 337 dialog.ConfirmDialog.__init__(self, self.answered, message, title) |
333 | 338 |
334 def answered(self, validated): | 339 def answered(self, validated): |
335 if validated: | 340 if validated: |