# HG changeset patch # User Goffi # Date 1440088432 -7200 # Node ID 48706f4ff19c0c397b544c0597b6dd02c1453625 # Parent 7ac073d2e7e00cddd2096d4ba058d279a9c51ba0 core (xmlui): added JidsListWidget to manage editable list of jids: - can be used to manage XEP-0004's jid-multi - can be used in the future for search result to display found entities (need a read-only style) - generaly usefull to manage list of entites - implemented in params too diff -r 7ac073d2e7e0 -r 48706f4ff19c src/tools/xml_tools.py --- a/src/tools/xml_tools.py Tue Aug 18 10:52:18 2015 +0200 +++ b/src/tools/xml_tools.py Thu Aug 20 18:33:52 2015 +0200 @@ -25,6 +25,7 @@ from xml.dom import minidom, NotFoundErr from wokkel import data_form from twisted.words.xish import domish +from twisted.words.protocols.jabber import jid from sat.core import exceptions @@ -254,6 +255,7 @@ @param xml (unicode) @return: XMLUI """ + # TODO: refactor params and use Twisted directly to parse XML params_doc = minidom.parseString(xml.encode('utf-8')) top = params_doc.documentElement if top.nodeName != 'params': @@ -281,9 +283,11 @@ callback_id = param.getAttribute('callback_id') or None if type_ == 'list': - options, selected = _getParamListOptions(param) + options, selected = _paramsGetListOptions(param) widget_kwargs['options'] = options widget_kwargs['selected'] = selected + elif type_ == 'jids_list': + widget_kwargs['jids'] = _paramsGetListJids(param) if type_ in ("button", "text"): param_ui.addEmpty() @@ -308,7 +312,7 @@ return param_ui.toXml() -def _getParamListOptions(param): +def _paramsGetListOptions(param): """Retrieve the options for list element. The