diff --git a/electrum/gui/qt/installwizard.py b/electrum/gui/qt/installwizard.py index 985480ac7..d2266b9cf 100644 --- a/electrum/gui/qt/installwizard.py +++ b/electrum/gui/qt/installwizard.py @@ -452,7 +452,13 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): return slayout.get_text() def seed_input(self, title, message, is_seed, options): - slayout = SeedLayout(title=message, is_seed=is_seed, options=options, parent=self) + slayout = SeedLayout( + title=message, + is_seed=is_seed, + options=options, + parent=self, + config=self.config, + ) self.exec_layout(slayout, title, next_enabled=False) return slayout.get_seed(), slayout.is_bip39, slayout.is_ext @@ -500,8 +506,14 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): @wizard_dialog def show_seed_dialog(self, run_next, seed_text): - title = _("Your wallet generation seed is:") - slayout = SeedLayout(seed=seed_text, title=title, msg=True, options=['ext']) + title = _("Your wallet generation seed is:") + slayout = SeedLayout( + seed=seed_text, + title=title, + msg=True, + options=['ext'], + config=self.config, + ) self.exec_layout(slayout) return slayout.is_ext @@ -697,7 +709,13 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): _("Please share it with your cosigners.") ]) vbox = QVBoxLayout() - layout = SeedLayout(xpub, title=msg, icon=False, for_seed_words=False) + layout = SeedLayout( + xpub, + title=msg, + icon=False, + for_seed_words=False, + config=self.config, + ) vbox.addLayout(layout.layout()) self.exec_layout(vbox, _('Master Public Key')) return None diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index b8a1909f9..fab9bd1f4 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2430,7 +2430,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): self.show_error(repr(e)) return from .seed_dialog import SeedDialog - d = SeedDialog(self, seed, passphrase) + d = SeedDialog(self, seed, passphrase, config=self.config) d.exec_() def show_qrcode(self, data, title = _("QR code"), parent=None, *, diff --git a/electrum/gui/qt/seed_dialog.py b/electrum/gui/qt/seed_dialog.py index 280ed73c5..0baadab2d 100644 --- a/electrum/gui/qt/seed_dialog.py +++ b/electrum/gui/qt/seed_dialog.py @@ -94,11 +94,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, for_seed_words=True): + def __init__( + self, + seed=None, + title=None, + icon=True, + msg=None, + options=None, + is_seed=None, + passphrase=None, + parent=None, + for_seed_words=True, + *, + config: 'SimpleConfig', + ): QVBoxLayout.__init__(self) self.parent = parent self.options = options + self.config = config if title: self.addWidget(WWLabel(title)) if seed: # "read only", we already have the text @@ -238,11 +251,17 @@ class KeysLayout(QVBoxLayout): class SeedDialog(WindowModalDialog): - def __init__(self, parent, seed, passphrase): + def __init__(self, parent, seed, passphrase, *, config: 'SimpleConfig'): WindowModalDialog.__init__(self, parent, ('Electrum - ' + _('Seed'))) self.setMinimumWidth(400) vbox = QVBoxLayout(self) title = _("Your wallet generation seed is:") - slayout = SeedLayout(title=title, seed=seed, msg=True, passphrase=passphrase) + slayout = SeedLayout( + title=title, + seed=seed, + msg=True, + passphrase=passphrase, + config=config, + ) vbox.addLayout(slayout) vbox.addLayout(Buttons(CloseButton(self)))