1
0
This commit is contained in:
ThomasV
2025-03-17 10:46:00 +01:00
parent 58be5a3ad5
commit 2133427f53
2 changed files with 10 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ import math
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QPixmap
from PyQt6.QtWidgets import QLabel, QGridLayout, QVBoxLayout
from PyQt6.QtWidgets import QLabel, QGridLayout, QVBoxLayout, QCheckBox
from electrum.i18n import _
from electrum.plugin import run_hook
@@ -202,8 +202,14 @@ class PasswordLayoutForHW(object):
vbox.addLayout(grid)
self.encrypt_cb = QCheckBox(_('Encrypt wallet file'))
grid.addWidget(self.encrypt_cb, 1, 0, 1, 2)
self.vbox = vbox
def should_encrypt_storage(self):
return self.encrypt_cb.isChecked()
def title(self):
return _("Toggle Encryption")
@@ -274,7 +280,8 @@ class ChangePasswordDialogForHW(ChangePasswordDialogBase):
def run(self):
if not self.exec():
return False, None
return True, True
return True, self.playout.should_encrypt_storage()
class PasswordDialog(WindowModalDialog):

View File

@@ -1245,7 +1245,7 @@ class WCWalletPasswordHardware(WalletWizardComponent):
self._valid = True
def apply(self):
self.wizard_data['encrypt'] = True
self.wizard_data['encrypt'] = self.playout.should_encrypt_storage()
_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)