From d97c5eaaacc98da0bbcdc7c16823ed702e92fb32 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Jul 2019 15:45:48 +1000 Subject: [PATCH] Rename the connected property to 'online' We're using connected for the bluez property, so let's not clash with that --- tuhigui/tuhi.py | 16 ++++++++-------- tuhigui/window.py | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tuhigui/tuhi.py b/tuhigui/tuhi.py index eefd31d..767c84d 100644 --- a/tuhigui/tuhi.py +++ b/tuhigui/tuhi.py @@ -50,7 +50,7 @@ class _DBusObject(GObject.Object): self.interface = interface self.objpath = objpath - self._connected = False + self._online = False self._name = name try: self._connect() @@ -66,8 +66,8 @@ class _DBusObject(GObject.Object): if self.proxy.get_name_owner() is None: raise DBusError(f'No-one is handling {self._name}, is the daemon running?') - self._connected = True - self.notify('connected') + self._online = True + self.notify('online') except GLib.Error as e: if (e.domain == 'g-io-error-quark' and e.code == Gio.IOErrorEnum.DBUS_ERROR): @@ -87,8 +87,8 @@ class _DBusObject(GObject.Object): return True @GObject.Property - def connected(self): - return self._connected + def online(self): + return self._online def _connect_to_session(self): try: @@ -297,13 +297,13 @@ class TuhiKeteManager(_DBusObject): self._unregistered_devices = {} logger.info('starting up') - if not self.connected: - self.connect('notify::connected', self._init) + if not self.online: + self.connect('notify::online', self._init) else: self._init() def _init(self, *args, **kwargs): - logger.info('connected') + logger.info('online') for objpath in self.property('Devices'): device = TuhiKeteDevice(self, objpath) self._devices[device.address] = device diff --git a/tuhigui/window.py b/tuhigui/window.py index eabc758..8aed44a 100644 --- a/tuhigui/window.py +++ b/tuhigui/window.py @@ -40,14 +40,14 @@ class MainWindow(Gtk.ApplicationWindow): self.stack_perspectives.set_visible_child_name(ep.name) # the dbus bindings need more async... - if not self._tuhi.connected: - self._tuhi.connect('notify::connected', self._on_dbus_connected) + if not self._tuhi.online: + self._tuhi.connect('notify::online', self._on_dbus_online) else: - self._on_dbus_connected() + self._on_dbus_online() self._add_primary_menu() - def _on_dbus_connected(self, *args, **kwargs): + def _on_dbus_online(self, *args, **kwargs): dp = DrawingPerspective() self._add_perspective(dp)