From 945641794974a123dcd149b69a9c52b4995fa96e Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 24 Jul 2016 17:56:18 +0200 Subject: [PATCH] quick_frontend, primitivus (contact_list): ContactList widget must now call postInit() when ready, to avoid being registered before being constructed --- frontends/src/primitivus/contact_list.py | 1 + frontends/src/quick_frontend/quick_contact_list.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontends/src/primitivus/contact_list.py b/frontends/src/primitivus/contact_list.py index 787848fd..f6f82571 100644 --- a/frontends/src/primitivus/contact_list.py +++ b/frontends/src/primitivus/contact_list.py @@ -51,6 +51,7 @@ class ContactList(PrimitivusWidget, QuickContactList): urwid.connect_signal(self, 'change', on_change, user_data) self.host.addListener('notification', self.onNotification, [self.profile]) self.host.addListener('notificationsClear', self.onNotification, [self.profile]) + self.postInit() def update(self, entities=None, type_=None, profile=None): """Update display, keep focus""" diff --git a/frontends/src/quick_frontend/quick_contact_list.py b/frontends/src/quick_frontend/quick_contact_list.py index f33e0aad..26772738 100644 --- a/frontends/src/quick_frontend/quick_contact_list.py +++ b/frontends/src/quick_frontend/quick_contact_list.py @@ -821,7 +821,6 @@ class QuickContactList(QuickWidget): def __init__(self, host, profiles): super(QuickContactList, self).__init__(host, None, profiles) - handler.register(self) # options # for next values, None means use indivual value per profile @@ -831,6 +830,10 @@ class QuickContactList(QuickWidget): self.show_resources = None # TODO self.show_status = None # TODO + def postInit(self): + """Method to be called by frontend after widget is initialised""" + handler.register(self) + @property def items(self): return handler.items