diff cagou/plugins/plugin_wid_contact_list.py @ 404:f7476818f9fb

core (common): JidSelector + behaviors various improvments: - renamed *Behaviour => *Behavior to be consistent with Kivy + moved to new "core.behaviors" modules - use a dedicated property in ContactItem for notification counter (which is now named "badge") - in JidSelector, well-known strings now create use a dedicated layout, add separator (except if new `add_separators` property is set to False), and are added to attribute of the same name - a new `item_class` property is now used to indicate the class to instanciate for items (by default it's a ContactItem) - FilterBahavior.do_filter now expect the parent layout instead of directly the children, this is to allow a FilterBahavior to manage several children layout at once (used with JidSelector) - core.utils has been removed, as the behavior there has been moved to core.behaviors
author Goffi <goffi@goffi.org>
date Wed, 12 Feb 2020 20:02:58 +0100
parents d61bbbac4160
children 167c3e198f73
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_contact_list.py	Wed Feb 12 20:02:58 2020 +0100
+++ b/cagou/plugins/plugin_wid_contact_list.py	Wed Feb 12 20:02:58 2020 +0100
@@ -30,8 +30,8 @@
 from ..core import cagou_widget
 from ..core.constants import Const as C
 from ..core.common import ContactItem
-from ..core.utils import FilterBehavior
-from ..core.menu import SideMenu, TouchMenuBehaviour, TouchMenuItemBehaviour
+from ..core.behaviors import FilterBehavior, TouchMenuBehavior, TouchMenuItemBehavior
+from ..core.menu import SideMenu
 
 
 log = logging.getLogger(__name__)
@@ -99,7 +99,7 @@
             message=_("error while trying to remove contact: {msg}")))
 
 
-class CLContactItem(TouchMenuItemBehaviour, ContactItem):
+class CLContactItem(TouchMenuItemBehavior, ContactItem):
 
     def do_item_action(self, touch):
         assert self.profile
@@ -116,7 +116,7 @@
 
 
 class ContactList(QuickContactList, cagou_widget.CagouWidget, FilterBehavior,
-                  TouchMenuBehaviour):
+                  TouchMenuBehavior):
     float_layout = properties.ObjectProperty()
     layout = properties.ObjectProperty()
     use_header_input = True
@@ -143,7 +143,7 @@
         DelContactMenu(contact_item=item).show()
 
     def onHeaderInputComplete(self, wid, text):
-        self.do_filter(self.layout.children,
+        self.do_filter(self.layout,
                        text,
                        lambda c: c.jid,
                        width_cb=lambda c: c.base_width,