mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
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
This commit is contained in:
parent
53320470f5
commit
eb64571341
2 changed files with 13 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue