mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 00:14:09 -04:00
applet: Rework how manager pings work
This swaps to notifying the applet internally when registration is lost after a ping fails.
This commit is contained in:
parent
298cefe9c2
commit
c336d9c4cf
@ -57,15 +57,22 @@ class Applet(dbus.service.Object):
|
||||
|
||||
def _ping(self):
|
||||
if self._manager:
|
||||
result = False
|
||||
|
||||
try:
|
||||
self._manager.Ping()
|
||||
result = self._manager.Ping()
|
||||
except DBusException as err:
|
||||
print('Lost connection with AppletManager: %s' % err)
|
||||
self._registered = False
|
||||
|
||||
GLib.idle_add(self.onUnregistered)
|
||||
GLib.timeout_add_seconds(1, self.register)
|
||||
return False
|
||||
|
||||
if not result:
|
||||
print('Lost registration with AppletManager')
|
||||
self._registered = False
|
||||
GLib.idle_add(self.onUnregistered)
|
||||
GLib.timeout_add_seconds(1, self.register)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user