From 998cd0d356fcd9ed1bd835c3a1abe81737a8b73b Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 3 Jun 2022 16:18:16 +0200 Subject: [PATCH] hww: make DeviceMgr.select_device dlg msg more explicit (add details) related https://github.com/spesmilo/electrum/issues/4199#issuecomment-1145063552 --- electrum/gui/qt/main_window.py | 1 + electrum/keystore.py | 2 +- electrum/plugin.py | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 6749c8aa1..56272635f 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2153,6 +2153,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): def query_choice(self, msg, choices): # Needed by QtHandler for hardware wallets dialog = WindowModalDialog(self.top_level_window(), title='Question') + dialog.setMinimumWidth(400) clayout = ChoicesLayout(msg, choices) vbox = QVBoxLayout(dialog) vbox.addLayout(clayout.layout()) diff --git a/electrum/keystore.py b/electrum/keystore.py index ec7cc79b0..578e198de 100644 --- a/electrum/keystore.py +++ b/electrum/keystore.py @@ -797,7 +797,7 @@ class Hardware_KeyStore(Xpub, KeyStore): # handler. The handler is per-window and preserved across # device reconnects self.xpub = d.get('xpub') - self.label = d.get('label') + self.label = d.get('label') # type: Optional[str] self.soft_device_id = d.get('soft_device_id') # type: Optional[str] self.handler = None # type: Optional[HardwareHandlerBase] run_hook('init_keystore', self) diff --git a/electrum/plugin.py b/electrum/plugin.py index f328cf9c5..af2e96762 100644 --- a/electrum/plugin.py +++ b/electrum/plugin.py @@ -671,12 +671,12 @@ class DeviceMgr(ThreadJob): if not allow_user_interaction: raise CannotAutoSelectDevice() # ask user to select device manually - 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 = ( + _("Could not automatically pair with device for given keystore.") + "\n" + + f"(keystore label: {keystore.label!r}, " + + f"bip32 root fingerprint: {keystore.get_root_fingerprint()!r})\n\n") msg += _("Please select which {} device to use:").format(plugin.device) + msg += "\n(" + _("Or click cancel to skip this keystore instead.") + ")" descriptions = ["{label} ({maybe_model}{init}, {transport})" .format(label=info.label or _("An unnamed {}").format(info.plugin_name), init=(_("initialized") if info.initialized else _("wiped")),