From d0df1d8aeb1a5832c4f49af5f45d4b5a760e0752 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 6 Mar 2020 18:19:03 +0100 Subject: [PATCH] quick frontend(app): new `QuickApp.profileConnected` method --- sat_frontends/quick_frontend/quick_app.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index 09474a4c..0afa773e 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -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"""