1
0

qml: show result dialog after password change

This commit is contained in:
Sander van Grieken
2023-05-12 10:53:02 +02:00
parent a6f3ee6364
commit 89225a9f41
3 changed files with 20 additions and 16 deletions

View File

@@ -673,7 +673,7 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
except InvalidPassword as e:
return False
@pyqtSlot(str)
@pyqtSlot(str, result=bool)
def setPassword(self, password):
if password == '':
password = None
@@ -682,16 +682,18 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
# HW wallet not supported yet
if storage.is_encrypted_with_hw_device():
return
return False
current_password = self.password if self.password != '' else None
try:
self._logger.info(f'PW change from {current_password} to {password}')
self._logger.info('setting new password')
self.wallet.update_password(current_password, password, encrypt_storage=True)
self.password = password
return True
except InvalidPassword as e:
self._logger.exception(repr(e))
return False
@pyqtSlot(str)
def importAddresses(self, addresslist):