Browse Source

qt "Wallet Info" dialog: show bip32 root fingerprint

and also show it in DeviceMgr.select_device

follow-up 998cd0d356
patch-4
SomberNight 3 years ago
parent
commit
780408285c
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 15
      electrum/gui/qt/main_window.py
  2. 6
      electrum/plugin.py

15
electrum/gui/qt/main_window.py

@ -2817,20 +2817,27 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
mpk_text.setMaximumHeight(150)
mpk_text.addCopyButton()
run_hook('show_xpub_button', mpk_text, ks)
ks_vbox.addWidget(WWLabel(_("Master Public Key")))
ks_vbox.addWidget(mpk_text)
der_path_hbox = QHBoxLayout()
der_path_hbox.setContentsMargins(0, 0, 0, 0)
der_path_hbox.addWidget(WWLabel(_("Derivation path") + ':'))
der_path_text = WWLabel(ks.get_derivation_prefix() or _("unknown"))
der_path_text.setTextInteractionFlags(Qt.TextSelectableByMouse)
der_path_hbox.addWidget(der_path_text)
der_path_hbox.addStretch()
ks_vbox.addWidget(WWLabel(_("Master Public Key")))
ks_vbox.addWidget(mpk_text)
ks_vbox.addLayout(der_path_hbox)
bip32fp_hbox = QHBoxLayout()
bip32fp_hbox.setContentsMargins(0, 0, 0, 0)
bip32fp_hbox.addWidget(QLabel("BIP32 root fingerprint:"))
bip32fp_text = WWLabel(ks.get_root_fingerprint() or _("unknown"))
bip32fp_text.setTextInteractionFlags(Qt.TextSelectableByMouse)
bip32fp_hbox.addWidget(bip32fp_text)
bip32fp_hbox.addStretch()
ks_vbox.addLayout(bip32fp_hbox)
ks_stack.addWidget(ks_w)
select_ks(0)

6
electrum/plugin.py

@ -632,9 +632,11 @@ class DeviceMgr(ThreadJob):
if not allow_user_interaction:
raise CannotAutoSelectDevice()
msg = _('Please insert your {}').format(plugin.device)
msg += " ("
if keystore.label and keystore.label not in PLACEHOLDER_HW_CLIENT_LABELS:
msg += ' ({})'.format(keystore.label)
msg += '. {}\n\n{}'.format(
msg += f"label: {keystore.label}, "
msg += f"bip32 root fingerprint: {keystore.get_root_fingerprint()!r}"
msg += ').\n\n{}\n\n{}'.format(
_('Verify the cable is connected and that '
'no other application is using it.'),
_('Try to connect again?')

Loading…
Cancel
Save