1
0

Trezor: GUI fixes

Trezor window was doing GUI stuff outside the GUI thread
This commit is contained in:
Neil Booth
2016-01-21 23:33:15 +09:00
parent 24037be99c
commit 0d14781463
3 changed files with 14 additions and 3 deletions

View File

@@ -314,13 +314,14 @@ class TrezorCompatiblePlugin(BasePlugin, ThreadJob):
devmgr = self.device_manager()
devices = devmgr.unpaired_devices(handler)
states = [_("wiped"), _("initialized")]
good_devices, descrs = [], []
for device in devices:
client = self.device_manager().create_client(device, handler, self)
if not client:
continue
state = states[client.is_initialized()]
label = device.info['label'] or _("An unnamed device")
label = client.label() or _("An unnamed device")
good_devices.append(device)
descrs.append("%s: device ID %s (%s)" % (label, device.id_, state))

View File

@@ -312,9 +312,9 @@ class SettingsDialog(WindowModalDialog):
raise RuntimeError("Device not connected")
if method:
getattr(client, method)(*args, **kw_args)
update(client.features)
return client.features
thread.add(task)
thread.add(task, on_success=update)
def update(features):
self.current_label = features.label