From 53a5a21ee89b791c351ad39a47e69837ed347af8 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 7 Sep 2020 17:16:06 +0200 Subject: [PATCH] hardware: update device conn. status faster (through GUI indicator) Qt status bar icon will now refresh to reflect disconnected device during next scan --- electrum/plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/electrum/plugin.py b/electrum/plugin.py index f14aeba82..f04a56411 100644 --- a/electrum/plugin.py +++ b/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