From 06ce6d26277eb7c73f1fbf2fb39106249cd6e4da Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 28 Apr 2022 21:12:54 +0200 Subject: [PATCH] hardware wallets: mention keystore.label in select_device Without it, it is not clear for which keystore the user is supposed to select the device. (though note that not all plugins implement labels, e.g. ledger does not) related: https://github.com/spesmilo/electrum/issues/4199#issuecomment-1112552416 --- electrum/plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/electrum/plugin.py b/electrum/plugin.py index 2d5592d16..2631b7c35 100644 --- a/electrum/plugin.py +++ b/electrum/plugin.py @@ -632,7 +632,7 @@ class DeviceMgr(ThreadJob): if not allow_user_interaction: raise CannotAutoSelectDevice() msg = _('Please insert your {}').format(plugin.device) - if keystore.label: + if keystore.label and keystore.label not in PLACEHOLDER_HW_CLIENT_LABELS: msg += ' ({})'.format(keystore.label) msg += '. {}\n\n{}'.format( _('Verify the cable is connected and that ' @@ -671,7 +671,12 @@ class DeviceMgr(ThreadJob): if not allow_user_interaction: raise CannotAutoSelectDevice() # ask user to select device manually - msg = _("Please select which {} device to use:").format(plugin.device) + msg = "" + if keystore.label and keystore.label not in PLACEHOLDER_HW_CLIENT_LABELS: + msg += _( + """Could not automatically pair with device """ + """for keystore labelled "{}".\n""").format(keystore.label) + msg += _("Please select which {} device to use:").format(plugin.device) descriptions = ["{label} ({maybe_model}{init}, {transport})" .format(label=info.label or _("An unnamed {}").format(info.plugin_name), init=(_("initialized") if info.initialized else _("wiped")),