From d2fa65b9aa1d5d8e3b0eadad547935396cb52ea1 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 6 Jan 2025 11:46:20 +0100 Subject: [PATCH] fix qt wizard (follow-up 693210edbec1b9845a7911df1a52692380d1afa1) --- electrum/gui/qt/wizard/wallet.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/electrum/gui/qt/wizard/wallet.py b/electrum/gui/qt/wizard/wallet.py index 069e9275a..e8012d956 100644 --- a/electrum/gui/qt/wizard/wallet.py +++ b/electrum/gui/qt/wizard/wallet.py @@ -991,9 +991,7 @@ class WCWalletPassword(WalletWizardComponent): msg=MSG_ENTER_PASSWORD, kind=PW_NEW, OK_button=self.next_button, - # force_disable_encrypt_cb=force_disable_encrypt_cb ) - self.pw_layout.encrypt_cb.setChecked(True) self.layout().addLayout(self.pw_layout.layout()) self.layout().addStretch(1) @@ -1002,7 +1000,7 @@ class WCWalletPassword(WalletWizardComponent): def apply(self): self.wizard_data['password'] = self.pw_layout.new_password() - self.wizard_data['encrypt'] = self.pw_layout.encrypt_cb.isChecked() + self.wizard_data['encrypt'] = True class SeedExtensionEdit(QWidget): @@ -1240,22 +1238,20 @@ class WCWalletPasswordHardware(WalletWizardComponent): self.plugins = wizard.plugins self.playout = PasswordLayoutForHW(MSG_HW_STORAGE_ENCRYPTION) - self.playout.encrypt_cb.setChecked(True) self.layout().addLayout(self.playout.layout()) self.layout().addStretch(1) self._valid = True def apply(self): - self.wizard_data['encrypt'] = self.playout.encrypt_cb.isChecked() - if self.playout.encrypt_cb.isChecked(): - _name, _info = self.wizard_data['hardware_device'] - device_id = _info.device.id_ - client = self.plugins.device_manager.client_by_id(device_id, scan_now=False) - # client.handler = self.plugin.create_handler(self.wizard) - # FIXME client can be None if it was recently disconnected. - # also, even if not None, this might raise (e.g. if it disconnected *just now*): - self.wizard_data['password'] = client.get_password_for_storage_encryption() + self.wizard_data['encrypt'] = True + _name, _info = self.wizard_data['hardware_device'] + device_id = _info.device.id_ + client = self.plugins.device_manager.client_by_id(device_id, scan_now=False) + # client.handler = self.plugin.create_handler(self.wizard) + # FIXME client can be None if it was recently disconnected. + # also, even if not None, this might raise (e.g. if it disconnected *just now*): + self.wizard_data['password'] = client.get_password_for_storage_encryption() class WCHWUnlock(WalletWizardComponent, Logger):