1
0

hw: fix passphrase dialog with confirmation

closes #4876
This commit is contained in:
SomberNight
2018-11-28 20:54:57 +01:00
parent 505cb2f65d
commit d0e6b8c89d
3 changed files with 20 additions and 15 deletions

View File

@@ -60,7 +60,7 @@ class PasswordLayout(object):
titles = [_("Enter Password"), _("Change Password"), _("Enter Passphrase")]
def __init__(self, wallet, msg, kind, OK_button, force_disable_encrypt_cb=False):
def __init__(self, msg, kind, OK_button, wallet=None, force_disable_encrypt_cb=False):
self.wallet = wallet
self.pw = QLineEdit()
@@ -169,12 +169,9 @@ class PasswordLayout(object):
class PasswordLayoutForHW(object):
def __init__(self, wallet, msg, kind, OK_button):
def __init__(self, msg, wallet=None):
self.wallet = wallet
self.kind = kind
self.OK_button = OK_button
vbox = QVBoxLayout()
label = QLabel(msg + "\n")
label.setWordWrap(True)
@@ -254,9 +251,11 @@ class ChangePasswordDialogForSW(ChangePasswordDialogBase):
else:
msg = _('Your wallet is password protected and encrypted.')
msg += ' ' + _('Use this dialog to change your password.')
self.playout = PasswordLayout(
wallet, msg, PW_CHANGE, OK_button,
force_disable_encrypt_cb=not wallet.can_have_keystore_encryption())
self.playout = PasswordLayout(msg=msg,
kind=PW_CHANGE,
OK_button=OK_button,
wallet=wallet,
force_disable_encrypt_cb=not wallet.can_have_keystore_encryption())
def run(self):
if not self.exec_():
@@ -276,7 +275,7 @@ class ChangePasswordDialogForHW(ChangePasswordDialogBase):
msg = _('Your wallet file is encrypted.')
msg += '\n' + _('Note: If you enable this setting, you will need your hardware device to open your wallet.')
msg += '\n' + _('Use this dialog to toggle encryption.')
self.playout = PasswordLayoutForHW(wallet, msg, PW_CHANGE, OK_button)
self.playout = PasswordLayoutForHW(msg)
def run(self):
if not self.exec_():