gui: pass a dbus device error on as signal

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-22 11:31:49 +10:00 committed by Benjamin Tissoires
parent 1ddf899d3e
commit daac9114e1
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,8 @@ class TuhiKeteDevice(_DBusObject):
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
'registered':
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
'device-error':
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT, int)),
}
def __init__(self, manager, objpath):
@ -246,6 +248,7 @@ class TuhiKeteDevice(_DBusObject):
logger.error(f'{self}: wrong device, please re-register.')
elif err < 0:
logger.error(f'{self}: an error occured: {os.strerror(-err)}')
self.emit('device-error', self, err)
self.notify('listening')
elif signal == 'SyncState':
self._sync_state = parameters[0]