From b2f1786effa7028b6da8a08e777992fb748f7414 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Thu, 20 Jun 2013 14:18:36 +0200 Subject: [PATCH] use consistent naming of offline state for devices --- lib/solaar/cli.py | 6 +++--- lib/solaar/ui/notify.py | 2 +- lib/solaar/ui/tray.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/solaar/cli.py b/lib/solaar/cli.py index 4691ad9f..d43ecc17 100644 --- a/lib/solaar/cli.py +++ b/lib/solaar/cli.py @@ -109,7 +109,7 @@ def _print_receiver(receiver, verbose=False): def _print_device(dev, verbose=False): p = dev.protocol - state = '' if p > 0 else 'inactive' + state = '' if p > 0 else 'offline' if not verbose: print ("%d: %s [%s:%s]" % (dev.number, dev.name, dev.codename, dev.serial), state) @@ -119,7 +119,7 @@ def _print_device(dev, verbose=False): print (" Codename :", dev.codename) print (" Kind :", dev.kind) if p == 0: - print (" Protocol : unknown (device is inactive)") + print (" Protocol : unknown (device is offline)") else: print (" Protocol : HID++ %1.1f" % p) print (" Polling rate :", dev.polling_rate, "ms") @@ -167,7 +167,7 @@ def _print_device(dev, verbose=False): else: print (" Battery status unavailable.") else: - print (" Battery status is unknown (device is inactive).") + print (" Battery status is unknown (device is offline).") # # diff --git a/lib/solaar/ui/notify.py b/lib/solaar/ui/notify.py index 346b0534..41fdae59 100644 --- a/lib/solaar/ui/notify.py +++ b/lib/solaar/ui/notify.py @@ -88,7 +88,7 @@ try: n = _notifications[summary] = Notify.Notification() message = reason or ('unpaired' if dev.status is None else - (str(dev.status) or ('connected' if dev.status else 'inactive'))) + (str(dev.status) or ('connected' if dev.status else 'offline'))) # we need to use the filename here because the notifications daemon # is an external application that does not know about our icon sets diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index 4394fc61..196eeb32 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -257,19 +257,19 @@ def _generate_tooltip_lines(): if serial is None: # receiver continue - yield '%s' % name p = str(status) if p: # does it have any properties to print? + yield '%s' % name if status: yield '\t%s' % p else: - yield '\t%s (inactive)' % p + yield '\t%s (offline)' % p else: if status: - yield '\tno status' + yield '%s no status' % name else: - yield '\t(inactive)' + yield '%s (offline)' % name yield ''