comparison src/cagou/plugins/plugin_wid_contact_list.py @ 16:ba14b596b90e

host can now be get as a global value: instead of always copying host from class to class, it can now be gotten from a global class with: from cagou import G then G.host will give host. This will probably be used on the long term on all SàT (backend + frontends). As host is currently needed in several places (most importantly in QuickFrontend), the argument is still present, and must be there even is unused on class inheriting from QuickSomething.
author Goffi <goffi@goffi.org>
date Sat, 09 Jul 2016 18:41:52 +0200
parents 56838ad5c84b
children 5c9feaa060a5
comparison
equal deleted inserted replaced
15:56838ad5c84b 16:ba14b596b90e
26 from kivy.uix.listview import ListView 26 from kivy.uix.listview import ListView
27 from kivy.adapters.listadapter import ListAdapter 27 from kivy.adapters.listadapter import ListAdapter
28 from kivy import properties 28 from kivy import properties
29 from cagou.core import cagou_widget 29 from cagou.core import cagou_widget
30 from cagou.core import image 30 from cagou.core import image
31 from cagou import G
31 32
32 33
33 PLUGIN_INFO = { 34 PLUGIN_INFO = {
34 "name": _(u"contacts"), 35 "name": _(u"contacts"),
35 "main": "ContactList", 36 "main": "ContactList",
50 51
51 52
52 class ContactList(QuickContactList, cagou_widget.CagouWidget): 53 class ContactList(QuickContactList, cagou_widget.CagouWidget):
53 54
54 def __init__(self, host, target, profiles): 55 def __init__(self, host, target, profiles):
55 QuickContactList.__init__(self, host, profiles) 56 QuickContactList.__init__(self, G.host, profiles)
56 cagou_widget.CagouWidget.__init__(self, host) 57 cagou_widget.CagouWidget.__init__(self)
57 self.adapter = ListAdapter(data={}, 58 self.adapter = ListAdapter(data={},
58 cls=ContactItem, 59 cls=ContactItem,
59 args_converter=self.contactDataConverter, 60 args_converter=self.contactDataConverter,
60 selection_mode='multiple', 61 selection_mode='multiple',
61 allow_empty_selection=True, 62 allow_empty_selection=True,