comparison src/browser/libervia_main.py @ 503:88ece2a00c63

browser_side: display new lines and clickable URLs for headline message
author souliane <souliane@mailoo.org>
date Thu, 14 Aug 2014 13:27:07 +0200
parents 67a4e8383b70
children f0b56c022c01
comparison
equal deleted inserted replaced
502:4aa627b059df 503:88ece2a00c63
25 from sat.core.log import getLogger 25 from sat.core.log import getLogger
26 log = getLogger(__name__) 26 log = getLogger(__name__)
27 ### 27 ###
28 28
29 from sat_frontends.tools.misc import InputHistory 29 from sat_frontends.tools.misc import InputHistory
30 from sat_frontends.tools.strings import getURLParams 30 from sat_frontends.tools import strings
31 from sat.core.i18n import _ 31 from sat.core.i18n import _
32 32
33 from pyjamas.ui.RootPanel import RootPanel 33 from pyjamas.ui.RootPanel import RootPanel
34 from pyjamas.ui.HTML import HTML 34 from pyjamas.ui.HTML import HTML
35 from pyjamas.ui.KeyboardListener import KEY_ESCAPE 35 from pyjamas.ui.KeyboardListener import KEY_ESCAPE
385 385
386 def _tryAutoConnect(self, skip_validation=False): 386 def _tryAutoConnect(self, skip_validation=False):
387 """This method retrieve the eventual URL parameters to auto-connect the user. 387 """This method retrieve the eventual URL parameters to auto-connect the user.
388 @param skip_validation: if True, set the form values but do not validate it 388 @param skip_validation: if True, set the form values but do not validate it
389 """ 389 """
390 params = getURLParams(Window.getLocation().getSearch()) 390 params = strings.getURLParams(Window.getLocation().getSearch())
391 if "login" in params: 391 if "login" in params:
392 self._register_box._form.right_side.selectTab(0) 392 self._register_box._form.right_side.selectTab(0)
393 self._register_box._form.login_box.setText(params["login"]) 393 self._register_box._form.login_box.setText(params["login"])
394 self._register_box._form.login_pass_box.setFocus(True) 394 self._register_box._form.login_pass_box.setFocus(True)
395 if "passwd" in params: 395 if "passwd" in params:
691 try: 691 try:
692 assert(extra['subject']) # subject is defined and not empty 692 assert(extra['subject']) # subject is defined and not empty
693 title = extra['subject'] 693 title = extra['subject']
694 except (KeyError, AssertionError): 694 except (KeyError, AssertionError):
695 title = _('Announcement from %s') % from_jid 695 title = _('Announcement from %s') % from_jid
696 msg = strings.addURLToText(html_tools.convertNewLinesToXHTML(html_tools.html_sanitize(msg)))
696 dialog.InfoDialog(title, msg).show() 697 dialog.InfoDialog(title, msg).show()
697 return 698 return
698 if lib_wid is not None: 699 if lib_wid is not None:
699 lib_wid.printMessage(_from, msg, extra) 700 lib_wid.printMessage(_from, msg, extra)
700 else: 701 else: