diff src/browser/sat_browser/chat.py @ 648:6d3142b782c3 frontends_multi_profiles

browser_side: classes reorganisation: - moved widgets in dedicated modules (base, contact, editor, libervia) and a widget module for single classes - same thing for panels (base, main, contact) - libervia_widget mix main panels and widget and drag n drop for technical reasons (see comments) - renamed WebPanel to WebWidget
author Goffi <goffi@goffi.org>
date Thu, 26 Feb 2015 18:10:54 +0100
parents 9092e624bb27
children 0262fee86375
line wrap: on
line diff
--- a/src/browser/sat_browser/chat.py	Thu Feb 26 13:10:46 2015 +0100
+++ b/src/browser/sat_browser/chat.py	Thu Feb 26 18:10:54 2015 +0100
@@ -39,11 +39,12 @@
 from time import time
 
 import html_tools
-import base_panels
-import panels
+import libervia_widget
+import base_panel
+import contact_panel
+import editor_widget
 import card_game
 import radiocol
-import base_widget
 import contact_list
 from constants import Const as C
 import plugin_xep_0085
@@ -73,7 +74,7 @@
         self.setStyleName('chatText')
 
 
-class Chat(QuickChat, base_widget.LiberviaWidget, KeyboardHandler):
+class Chat(QuickChat, libervia_widget.LiberviaWidget, KeyboardHandler):
 
     def __init__(self, host, target, type_=C.CHAT_ONE2ONE, profiles=None):
         """Panel used for conversation (one 2 one or group chat)
@@ -91,19 +92,19 @@
             host.plugins['otr'].infoTextCallback(target, cb)
         header_info = header_info_cb if (type_ == C.CHAT_ONE2ONE and 'otr' in host.plugins) else None
 
-        base_widget.LiberviaWidget.__init__(self, host, title=unicode(target.bare), info=header_info, selectable=True)
+        libervia_widget.LiberviaWidget.__init__(self, host, title=unicode(target.bare), info=header_info, selectable=True)
         self._body = AbsolutePanel()
         self._body.setStyleName('chatPanel_body')
         chat_area = HorizontalPanel()
         chat_area.setStyleName('chatArea')
         if type_ == C.CHAT_GROUP:
-            self.occupants_list = base_panels.OccupantsList()
+            self.occupants_list = contact_panel.OccupantsList()
             self.occupants_initialised = False
             chat_area.add(self.occupants_list)
         self._body.add(chat_area)
         self.content = AbsolutePanel()
         self.content.setStyleName('chatContent')
-        self.content_scroll = base_widget.ScrollPanelWrapper(self.content)
+        self.content_scroll = base_panel.ScrollPanelWrapper(self.content)
         chat_area.add(self.content_scroll)
         chat_area.setCellWidth(self.content_scroll, '100%')
         self.vpanel.add(self._body)
@@ -153,7 +154,7 @@
         if hasattr(self, 'message_box'):
             self.message_box.setVisible(enable_box)
         elif enable_box:
-            self.message_box = panels.MessageBox(self.host)
+            self.message_box = editor_widget.MessageBox(self.host)
             self.message_box.onSelectedChange(self)
             self.message_box.addKeyboardListener(self)
             self.vpanel.add(self.message_box)
@@ -207,7 +208,7 @@
         self.state_machine._onEvent("active")
 
     def onQuit(self):
-        base_widget.LiberviaWidget.onQuit(self)
+        libervia_widget.LiberviaWidget.onQuit(self)
         if self.type == C.CHAT_GROUP:
             self.host.bridge.call('mucLeave', None, unicode(self.target.bare))
 
@@ -363,4 +364,4 @@
 
 
 quick_widgets.register(QuickChat, Chat)
-base_widget.LiberviaWidget.addDropKey("CONTACT", lambda host, item: host.displayWidget(Chat, jid.JID(item), dropped=True))
+libervia_widget.LiberviaWidget.addDropKey("CONTACT", lambda host, item: host.displayWidget(Chat, jid.JID(item), dropped=True))