comparison src/browser/sat_browser/richtext.py @ 616:1c0d5a87c554 frontends_multi_profiles

browser_side: add and use method displayWidget to harmonize widget's management in Libervia (not completely done, there are some issues)
author souliane <souliane@mailoo.org>
date Wed, 11 Feb 2015 11:18:13 +0100
parents b97c85b8a47e
children 9092e624bb27
comparison
equal deleted inserted replaced
615:70872a83ef15 616:1c0d5a87c554
35 from constants import Const as C 35 from constants import Const as C
36 import dialog 36 import dialog
37 import base_panels 37 import base_panels
38 import list_manager 38 import list_manager
39 import html_tools 39 import html_tools
40 import panels 40 import blog
41 import chat
41 42
42 43
43 class RichTextEditor(base_panels.BaseTextEditor, FlexTable): 44 class RichTextEditor(base_panels.BaseTextEditor, FlexTable):
44 """Panel for the rich text editor.""" 45 """Panel for the rich text editor."""
45 46
456 target = recipients[key][0] 457 target = recipients[key][0]
457 setText() 458 setText()
458 if target == "": 459 if target == "":
459 return True 460 return True
460 if target.startswith("@"): 461 if target.startswith("@"):
461 _class = panels.MicroblogPanel 462 _class = blog.MicroblogPanel
462 target = None if target == "@@" else target[1:] 463 target = None if target == "@@" else target[1:]
463 else: 464 else:
464 _class = panels.ChatPanel 465 _class = chat.Chat
465 self.host.getOrCreateLiberviaWidget(_class, {'item': target}) 466 self.host.displayWidget(_class, target)
466 return True 467 return True
467 468
468 def syncFromEditor(self, content): 469 def syncFromEditor(self, content):
469 """Synchronize to unibox and close the dialog afterward. Display 470 """Synchronize to unibox and close the dialog afterward. Display
470 a message and leave the dialog open if the sync was not possible.""" 471 a message and leave the dialog open if the sync was not possible."""