Browse Source
hardware: update device conn. status faster (through GUI indicator)
Qt status bar icon will now refresh to reflect disconnected device
during next scan
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
5 additions and
3 deletions
-
electrum/plugin.py
|
|
@ -705,18 +705,20 @@ class DeviceMgr(ThreadJob): |
|
|
|
|
|
|
|
# find out what was disconnected |
|
|
|
pairs = [(dev.path, dev.id_) for dev in devices] |
|
|
|
disconnected_ids = [] |
|
|
|
disconnected_clients = [] |
|
|
|
with self.lock: |
|
|
|
connected = {} |
|
|
|
for client, pair in self.clients.items(): |
|
|
|
if pair in pairs and client.has_usable_connection_with_device(): |
|
|
|
connected[client] = pair |
|
|
|
else: |
|
|
|
disconnected_ids.append(pair[1]) |
|
|
|
disconnected_clients.append((client, pair[1])) |
|
|
|
self.clients = connected |
|
|
|
|
|
|
|
# Unpair disconnected devices |
|
|
|
for id_ in disconnected_ids: |
|
|
|
for client, id_ in disconnected_clients: |
|
|
|
self.unpair_id(id_) |
|
|
|
if client.handler: |
|
|
|
client.handler.update_status(False) |
|
|
|
|
|
|
|
return devices |
|
|
|