Browse Source

qt seed dialog fixes

for xpub, reenable show qr code option (fixes #4307)
set to read-only when editing capability is not intentional
allow tab to auto-complete
3.2.x
SomberNight 7 years ago
parent
commit
eb64571341
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      gui/qt/installwizard.py
  2. 17
      gui/qt/seed_dialog.py

2
gui/qt/installwizard.py

@ -534,7 +534,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
_("Please share it with your cosigners.")
])
vbox = QVBoxLayout()
layout = SeedLayout(xpub, title=msg, icon=False)
layout = SeedLayout(xpub, title=msg, icon=False, for_seed_words=False)
vbox.addLayout(layout.layout())
self.exec_layout(vbox, _('Master Public Key'))
return None

17
gui/qt/seed_dialog.py

@ -88,17 +88,24 @@ class SeedLayout(QVBoxLayout):
self.is_ext = cb_ext.isChecked() if 'ext' in self.options else False
self.is_bip39 = cb_bip39.isChecked() if 'bip39' in self.options else False
def __init__(self, seed=None, title=None, icon=True, msg=None, options=None, is_seed=None, passphrase=None, parent=None):
def __init__(self, seed=None, title=None, icon=True, msg=None, options=None,
is_seed=None, passphrase=None, parent=None, for_seed_words=True):
QVBoxLayout.__init__(self)
self.parent = parent
self.options = options
if title:
self.addWidget(WWLabel(title))
self.seed_e = CompletionTextEdit()
if seed:
if seed: # "read only", we already have the text
if for_seed_words:
self.seed_e = ButtonsTextEdit()
else: # e.g. xpub
self.seed_e = ShowQRTextEdit()
self.seed_e.setReadOnly(True)
self.seed_e.setText(seed)
else:
self.seed_e.setTabChangesFocus(True)
else: # we expect user to enter text
assert for_seed_words
self.seed_e = CompletionTextEdit()
self.seed_e.setTabChangesFocus(False) # so that tab auto-completes
self.is_seed = is_seed
self.saved_is_seed = self.is_seed
self.seed_e.textChanged.connect(self.on_edit)

Loading…
Cancel
Save