quick frontend(app): new QuickApp.profileConnected method

This commit is contained in:
Goffi 2020-03-06 18:19:03 +01:00
commit d0df1d8aeb

View file

@ -90,6 +90,8 @@ class ProfileManager(object):
def _plug_profile_isconnected(self, connected):
self.connected = connected
if connected:
self.host.profileConnected(self.profile)
self.bridge.asyncGetParamA(
"autodisconnect",
"Connection",
@ -663,6 +665,14 @@ class QuickApp(object):
if not self._plugs_in_progress:
self.contact_lists.lockUpdate(False)
def profileConnected(self, profile):
"""Called when a plugged profile is connected
it is called independently of profilePlugged (may be called before or after
profilePlugged)
"""
pass
def connect(self, profile, callback=None, errback=None):
if not callback:
callback = lambda __: None
@ -742,6 +752,7 @@ class QuickApp(object):
# A mechanism similar to sync should be available
# on a per-profile basis
self.sync = True
self.profileConnected(profile)
def disconnectedHandler(self, profile):
"""called when the connection is closed"""