quick frontend(app): new QuickApp.profileConnected method
This commit is contained in:
parent
f7360d31e2
commit
d0df1d8aeb
1 changed files with 11 additions and 0 deletions
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue