Browse Source

hww: make DeviceMgr.select_device dlg msg more explicit (add details)

related https://github.com/spesmilo/electrum/issues/4199#issuecomment-1145063552
master
SomberNight 4 years ago
parent
commit
998cd0d356
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/gui/qt/main_window.py
  2. 2
      electrum/keystore.py
  3. 10
      electrum/plugin.py

1
electrum/gui/qt/main_window.py

@ -2153,6 +2153,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
def query_choice(self, msg, choices): def query_choice(self, msg, choices):
# Needed by QtHandler for hardware wallets # Needed by QtHandler for hardware wallets
dialog = WindowModalDialog(self.top_level_window(), title='Question') dialog = WindowModalDialog(self.top_level_window(), title='Question')
dialog.setMinimumWidth(400)
clayout = ChoicesLayout(msg, choices) clayout = ChoicesLayout(msg, choices)
vbox = QVBoxLayout(dialog) vbox = QVBoxLayout(dialog)
vbox.addLayout(clayout.layout()) vbox.addLayout(clayout.layout())

2
electrum/keystore.py

@ -797,7 +797,7 @@ class Hardware_KeyStore(Xpub, KeyStore):
# handler. The handler is per-window and preserved across # handler. The handler is per-window and preserved across
# device reconnects # device reconnects
self.xpub = d.get('xpub') 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.soft_device_id = d.get('soft_device_id') # type: Optional[str]
self.handler = None # type: Optional[HardwareHandlerBase] self.handler = None # type: Optional[HardwareHandlerBase]
run_hook('init_keystore', self) run_hook('init_keystore', self)

10
electrum/plugin.py

@ -671,12 +671,12 @@ class DeviceMgr(ThreadJob):
if not allow_user_interaction: if not allow_user_interaction:
raise CannotAutoSelectDevice() raise CannotAutoSelectDevice()
# ask user to select device manually # ask user to select device manually
msg = "" msg = (
if keystore.label and keystore.label not in PLACEHOLDER_HW_CLIENT_LABELS: _("Could not automatically pair with device for given keystore.") + "\n"
msg += _( + f"(keystore label: {keystore.label!r}, "
"""Could not automatically pair with device """ + f"bip32 root fingerprint: {keystore.get_root_fingerprint()!r})\n\n")
"""for keystore labelled "{}".\n""").format(keystore.label)
msg += _("Please select which {} device to use:").format(plugin.device) 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})" descriptions = ["{label} ({maybe_model}{init}, {transport})"
.format(label=info.label or _("An unnamed {}").format(info.plugin_name), .format(label=info.label or _("An unnamed {}").format(info.plugin_name),
init=(_("initialized") if info.initialized else _("wiped")), init=(_("initialized") if info.initialized else _("wiped")),

Loading…
Cancel
Save