comparison src/browser/sat_browser/xmlui.py @ 721:102bab805ec1

browser side(xmlui): basic JidsList implementation (read-only) using ContactsPanel, to fix params display
author Goffi <goffi@goffi.org>
date Fri, 21 Aug 2015 15:38:20 +0200
parents bf0a7da558e8
children 242dde89e698
comparison
equal deleted inserted replaced
720:bf0a7da558e8 721:102bab805ec1
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_frontends.tools import strings
24 from sat_frontends.tools import jid
24 from sat_browser.constants import Const as C 25 from sat_browser.constants import Const as C
25 from sat_browser import dialog 26 from sat_browser import dialog
26 from sat_browser import html_tools 27 from sat_browser import html_tools
28 from sat_browser import contact_panel
27 29
28 from pyjamas.ui.VerticalPanel import VerticalPanel 30 from pyjamas.ui.VerticalPanel import VerticalPanel
29 from pyjamas.ui.HorizontalPanel import HorizontalPanel 31 from pyjamas.ui.HorizontalPanel import HorizontalPanel
30 from pyjamas.ui.TabPanel import TabPanel 32 from pyjamas.ui.TabPanel import TabPanel
31 from pyjamas.ui.Grid import Grid 33 from pyjamas.ui.Grid import Grid
224 self.addItem(value) 226 self.addItem(value)
225 self._xmlui_attr_map[value] = value 227 self._xmlui_attr_map[value] = value
226 if value not in selected: 228 if value not in selected:
227 selected.append(value) 229 selected.append(value)
228 self._xmluiSelectValues(selected) 230 self._xmluiSelectValues(selected)
231
232
233 class JidsListWidget(contact_panel.ContactsPanel, xmlui.JidsListWidget):
234
235 def __init__(self, xmlui_main, xmlui_parent, jids, styles):
236 contact_panel.ContactsPanel.__init__(self, xmlui_main.host, merge_resources=False)
237 self.setList([jid.JID(jid_) for jid_ in jids])
238
239 def _xmluiGetSelectedValues(self):
240 # XXX: there is not selection in this list, so we return all non empty values
241 return self.getJids()
242
229 243
230 244
231 class LiberviaContainer(object): 245 class LiberviaContainer(object):
232 246
233 def _xmluiAppend(self, widget): 247 def _xmluiAppend(self, widget):