dbusserver: emit the bus-name-owned when we have the bus

And rename from 'owned' to 'acquired', that's better english
This commit is contained in:
Peter Hutterer 2018-01-12 20:43:41 +10:00
parent 0d88d9d0e7
commit c4b0807c3c
2 changed files with 4 additions and 5 deletions

View File

@ -34,14 +34,14 @@ class Tuhi(GObject.Object):
def __init__(self): def __init__(self):
GObject.Object.__init__(self) GObject.Object.__init__(self)
self.server = TuhiDBusServer(self) self.server = TuhiDBusServer(self)
self.server.connect('bus-name-owned', self._on_bus_name_owned) self.server.connect('bus-name-acquired', self._on_bus_name_acquired)
self.bluez = BlueZDeviceManager() self.bluez = BlueZDeviceManager()
self.bluez.connect('device-added', self._on_device_added) self.bluez.connect('device-added', self._on_device_added)
self.drawings = [] self.drawings = []
def _on_bus_name_owned(self, dbus_server): def _on_bus_name_acquired(self, dbus_server):
self.bluez.connect_to_bluez() self.bluez.connect_to_bluez()
def _on_device_added(self, manager, device): def _on_device_added(self, manager, device):

View File

@ -153,7 +153,7 @@ class TuhiDBusServer(GObject.Object):
Class for the DBus server. Class for the DBus server.
""" """
__gsignals__ = { __gsignals__ = {
"bus-name-owned": "bus-name-acquired":
(GObject.SIGNAL_RUN_FIRST, None, ()), (GObject.SIGNAL_RUN_FIRST, None, ()),
} }
@ -178,10 +178,9 @@ class TuhiDBusServer(GObject.Object):
self._property_read_cb, self._property_read_cb,
self._property_write_cb) self._property_write_cb)
self._connection = connection self._connection = connection
self.emit('bus-name-owned')
def _bus_name_aquired(self, connection, name): def _bus_name_aquired(self, connection, name):
pass self.emit('bus-name-acquired')
def _bus_name_lost(self, connection, name): def _bus_name_lost(self, connection, name):
pass pass