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.") _("Please share it with your cosigners.")
]) ])
vbox = QVBoxLayout() vbox = QVBoxLayout()
layout = SeedLayout(xpub, title=msg, icon=False) layout = SeedLayout(xpub, title=msg, icon=False, for_seed_words=False)
vbox.addLayout(layout.layout()) vbox.addLayout(layout.layout())
self.exec_layout(vbox, _('Master Public Key')) self.exec_layout(vbox, _('Master Public Key'))
return None 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_ext = cb_ext.isChecked() if 'ext' in self.options else False
self.is_bip39 = cb_bip39.isChecked() if 'bip39' 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) QVBoxLayout.__init__(self)
self.parent = parent self.parent = parent
self.options = options self.options = options
if title: if title:
self.addWidget(WWLabel(title)) self.addWidget(WWLabel(title))
self.seed_e = CompletionTextEdit() if seed: # "read only", we already have the text
if seed: 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) self.seed_e.setText(seed)
else: else: # we expect user to enter text
self.seed_e.setTabChangesFocus(True) assert for_seed_words
self.seed_e = CompletionTextEdit()
self.seed_e.setTabChangesFocus(False) # so that tab auto-completes
self.is_seed = is_seed self.is_seed = is_seed
self.saved_is_seed = self.is_seed self.saved_is_seed = self.is_seed
self.seed_e.textChanged.connect(self.on_edit) self.seed_e.textChanged.connect(self.on_edit)

Loading…
Cancel
Save