Rename the connected property to 'online'
We're using connected for the bluez property, so let's not clash with that
This commit is contained in:
parent
fdade5529d
commit
d97c5eaaac
|
@ -50,7 +50,7 @@ class _DBusObject(GObject.Object):
|
||||||
|
|
||||||
self.interface = interface
|
self.interface = interface
|
||||||
self.objpath = objpath
|
self.objpath = objpath
|
||||||
self._connected = False
|
self._online = False
|
||||||
self._name = name
|
self._name = name
|
||||||
try:
|
try:
|
||||||
self._connect()
|
self._connect()
|
||||||
|
@ -66,8 +66,8 @@ class _DBusObject(GObject.Object):
|
||||||
if self.proxy.get_name_owner() is None:
|
if self.proxy.get_name_owner() is None:
|
||||||
raise DBusError(f'No-one is handling {self._name}, is the daemon running?')
|
raise DBusError(f'No-one is handling {self._name}, is the daemon running?')
|
||||||
|
|
||||||
self._connected = True
|
self._online = True
|
||||||
self.notify('connected')
|
self.notify('online')
|
||||||
except GLib.Error as e:
|
except GLib.Error as e:
|
||||||
if (e.domain == 'g-io-error-quark' and
|
if (e.domain == 'g-io-error-quark' and
|
||||||
e.code == Gio.IOErrorEnum.DBUS_ERROR):
|
e.code == Gio.IOErrorEnum.DBUS_ERROR):
|
||||||
|
@ -87,8 +87,8 @@ class _DBusObject(GObject.Object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@GObject.Property
|
@GObject.Property
|
||||||
def connected(self):
|
def online(self):
|
||||||
return self._connected
|
return self._online
|
||||||
|
|
||||||
def _connect_to_session(self):
|
def _connect_to_session(self):
|
||||||
try:
|
try:
|
||||||
|
@ -297,13 +297,13 @@ class TuhiKeteManager(_DBusObject):
|
||||||
self._unregistered_devices = {}
|
self._unregistered_devices = {}
|
||||||
logger.info('starting up')
|
logger.info('starting up')
|
||||||
|
|
||||||
if not self.connected:
|
if not self.online:
|
||||||
self.connect('notify::connected', self._init)
|
self.connect('notify::online', self._init)
|
||||||
else:
|
else:
|
||||||
self._init()
|
self._init()
|
||||||
|
|
||||||
def _init(self, *args, **kwargs):
|
def _init(self, *args, **kwargs):
|
||||||
logger.info('connected')
|
logger.info('online')
|
||||||
for objpath in self.property('Devices'):
|
for objpath in self.property('Devices'):
|
||||||
device = TuhiKeteDevice(self, objpath)
|
device = TuhiKeteDevice(self, objpath)
|
||||||
self._devices[device.address] = device
|
self._devices[device.address] = device
|
||||||
|
|
|
@ -40,14 +40,14 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
self.stack_perspectives.set_visible_child_name(ep.name)
|
self.stack_perspectives.set_visible_child_name(ep.name)
|
||||||
|
|
||||||
# the dbus bindings need more async...
|
# the dbus bindings need more async...
|
||||||
if not self._tuhi.connected:
|
if not self._tuhi.online:
|
||||||
self._tuhi.connect('notify::connected', self._on_dbus_connected)
|
self._tuhi.connect('notify::online', self._on_dbus_online)
|
||||||
else:
|
else:
|
||||||
self._on_dbus_connected()
|
self._on_dbus_online()
|
||||||
|
|
||||||
self._add_primary_menu()
|
self._add_primary_menu()
|
||||||
|
|
||||||
def _on_dbus_connected(self, *args, **kwargs):
|
def _on_dbus_online(self, *args, **kwargs):
|
||||||
dp = DrawingPerspective()
|
dp = DrawingPerspective()
|
||||||
self._add_perspective(dp)
|
self._add_perspective(dp)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue