electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit eb64571341a26dd4974f904edf87f9b9e5c78ee9
parent 53320470f590edcea6d3783b530ece173e0d03ff
Author: SomberNight <somber.night@protonmail.com>
Date:   Tue, 24 Apr 2018 23:55:42 +0200

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

Diffstat:
Mgui/qt/installwizard.py | 2+-
Mgui/qt/seed_dialog.py | 17++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/gui/qt/installwizard.py b/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 diff --git a/gui/qt/seed_dialog.py b/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)