fix issue #9543
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user