1
0

hww: fix some threading issues in wizard

fixes #3377
related: #6064  (passphrase dialog not rendered correctly)
This commit is contained in:
SomberNight
2020-04-01 21:05:19 +02:00
parent 81fc3fcce2
commit 371f55a0f9
8 changed files with 40 additions and 5 deletions

View File

@@ -707,7 +707,8 @@ class DigitalBitboxPlugin(HW_PluginBase):
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard)
if purpose == HWD_SETUP_NEW_WALLET:
client.setupRunning = True
client.get_xpub("m/44'/0'", 'standard')
wizard.run_task_without_blocking_gui(
task=lambda: client.get_xpub("m/44'/0'", 'standard'))
def is_mobile_paired(self):

View File

@@ -78,6 +78,8 @@ class HW_PluginBase(BasePlugin):
"""Called when creating a new wallet or when using the device to decrypt
an existing wallet. Select the device to use. If the device is
uninitialized, go through the initialization process.
Runs in GUI thread.
"""
raise NotImplementedError()

View File

@@ -279,7 +279,8 @@ class KeepKeyPlugin(HW_PluginBase):
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard)
if not device_info.initialized:
self.initialize_device(device_id, wizard, client.handler)
client.get_xpub('m', 'standard')
wizard.run_task_without_blocking_gui(
task=lambda: client.get_xpub("m", 'standard'))
client.used()
def get_xpub(self, device_id, derivation, xtype, wizard):

View File

@@ -591,7 +591,8 @@ class LedgerPlugin(HW_PluginBase):
def setup_device(self, device_info, wizard, purpose):
device_id = device_info.device.id_
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard)
client.get_xpub("m/44'/0'", 'standard') # TODO replace by direct derivation once Nano S > 1.1
wizard.run_task_without_blocking_gui(
task=lambda: client.get_xpub("m/44'/0'", 'standard')) # TODO replace by direct derivation once Nano S > 1.1
def get_xpub(self, device_id, derivation, xtype, wizard):
if xtype not in self.SUPPORTED_XTYPES:

View File

@@ -253,7 +253,8 @@ class SafeTPlugin(HW_PluginBase):
client = self.scan_and_create_client_for_device(device_id=device_id, wizard=wizard)
if not device_info.initialized:
self.initialize_device(device_id, wizard, client.handler)
client.get_xpub('m', 'standard')
wizard.run_task_without_blocking_gui(
task=lambda: client.get_xpub("m", 'standard'))
client.used()
def get_xpub(self, device_id, derivation, xtype, wizard):

View File

@@ -280,7 +280,8 @@ class TrezorPlugin(HW_PluginBase):
if not device_info.initialized:
self.initialize_device(device_id, wizard, client.handler)
is_creating_wallet = purpose == HWD_SETUP_NEW_WALLET
client.get_xpub('m', 'standard', creating=is_creating_wallet)
wizard.run_task_without_blocking_gui(
task=lambda: client.get_xpub('m', 'standard', creating=is_creating_wallet))
client.used()
def get_xpub(self, device_id, derivation, xtype, wizard):