changeset 3065:f8e3789912d0

quick frontend (contact list): added "contactsFilled" event
author Goffi <goffi@goffi.org>
date Tue, 29 Oct 2019 20:24:29 +0100
parents d62fceccff22
children 2cc2f65379f7
files sat_frontends/quick_frontend/constants.py sat_frontends/quick_frontend/quick_app.py sat_frontends/quick_frontend/quick_contact_list.py
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/constants.py	Mon Oct 21 23:52:25 2019 +0200
+++ b/sat_frontends/quick_frontend/constants.py	Tue Oct 29 20:24:29 2019 +0100
@@ -99,6 +99,7 @@
         "nick",
         "presence",
         "profilePlugged",
+        "contactsFilled",
         "disconnect",
         "gotMenus",
         "menu",
--- a/sat_frontends/quick_frontend/quick_app.py	Mon Oct 21 23:52:25 2019 +0200
+++ b/sat_frontends/quick_frontend/quick_app.py	Tue Oct 29 20:24:29 2019 +0100
@@ -297,9 +297,8 @@
         self.menus = quick_menus.QuickMenusManager(self)
         ProfileManager.host = self
         self.profiles = ProfilesManager()
-        self._plugs_in_progress = (
-            set()
-        )  # profiles currently being plugged, used to (un)lock contact list updates
+        # profiles currently being plugged, used to (un)lock contact list updates
+        self._plugs_in_progress = set()
         self.ready_profiles = set()  # profiles which are connected and ready
         self.signals_cache = {}  # used to keep signal received between start of
                                  # plug_profile and when the profile is actualy ready
@@ -528,6 +527,8 @@
         /!\ don't forget to remove listener when not used anymore (e.g. if you delete a
             widget)
         @param type_: type of event, can be:
+            - contactsFilled: called when contact have been fully filled for a profiles
+                kwargs: profile
             - avatar: called when avatar data is updated
                 args: (entity, avatar file, profile)
             - nick: called when nick data is updated
--- a/sat_frontends/quick_frontend/quick_contact_list.py	Mon Oct 21 23:52:25 2019 +0200
+++ b/sat_frontends/quick_frontend/quick_contact_list.py	Tue Oct 29 20:24:29 2019 +0100
@@ -963,6 +963,7 @@
             del self._to_fill
             # we need a full update when all contacts are filled
             self.update()
+        self.host.callListeners("contactsFilled", profile=profile)
 
     def fill(self, profile=None):
         """Get all contacts from backend, and fill the widget