From fb2dc9b7a061a2f96a759c65de51f5e48bffd3c2 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 29 Oct 2019 20:24:29 +0100 Subject: [PATCH] quick frontend (contact list): added "contactsFilled" event --- sat_frontends/quick_frontend/constants.py | 1 + sat_frontends/quick_frontend/quick_app.py | 7 ++++--- sat_frontends/quick_frontend/quick_contact_list.py | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sat_frontends/quick_frontend/constants.py b/sat_frontends/quick_frontend/constants.py index ad5ad316..bb15a394 100644 --- a/sat_frontends/quick_frontend/constants.py +++ b/sat_frontends/quick_frontend/constants.py @@ -99,6 +99,7 @@ class Const(constants.Const): "nick", "presence", "profilePlugged", + "contactsFilled", "disconnect", "gotMenus", "menu", diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index bb6246b8..8b66b7a2 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -297,9 +297,8 @@ class QuickApp(object): 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 @@ class QuickApp(object): /!\ 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 diff --git a/sat_frontends/quick_frontend/quick_contact_list.py b/sat_frontends/quick_frontend/quick_contact_list.py index d8799de6..5712b712 100644 --- a/sat_frontends/quick_frontend/quick_contact_list.py +++ b/sat_frontends/quick_frontend/quick_contact_list.py @@ -963,6 +963,7 @@ class QuickContactListHandler(object): 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