Preferences/ConfigurationPages/MasterPasswordEntryDialog.py

changeset 3010
befeff46ec0f
parent 2964
84b65fb9e780
child 3057
10516539f238
child 3160
209a07d7e401
equal deleted inserted replaced
3009:bf5ae5d7477d 3010:befeff46ec0f
42 """ 42 """
43 enable = True 43 enable = True
44 error = "" 44 error = ""
45 if self.currentPasswordEdit.isEnabled(): 45 if self.currentPasswordEdit.isEnabled():
46 from Utilities.crypto.py3PBKDF2 import verifyPassword 46 from Utilities.crypto.py3PBKDF2 import verifyPassword
47 enable = \ 47 enable = verifyPassword(
48 verifyPassword(self.currentPasswordEdit.text(), self.__oldPasswordHash) 48 self.currentPasswordEdit.text(), self.__oldPasswordHash)
49 if not enable: 49 if not enable:
50 error = error or self.trUtf8("Wrong password entered.") 50 error = error or self.trUtf8("Wrong password entered.")
51 51
52 if self.newPasswordEdit.text() == "": 52 if self.newPasswordEdit.text() == "":
53 enable = False 53 enable = False
59 error = error or self.trUtf8("Repeated password is wrong.") 59 error = error or self.trUtf8("Repeated password is wrong.")
60 60
61 if self.currentPasswordEdit.isEnabled(): 61 if self.currentPasswordEdit.isEnabled():
62 if self.newPasswordEdit.text() == self.currentPasswordEdit.text(): 62 if self.newPasswordEdit.text() == self.currentPasswordEdit.text():
63 enable = False 63 enable = False
64 error = error or self.trUtf8("Old and new password must not be the same.") 64 error = error or \
65 self.trUtf8("Old and new password must not be the same.")
65 66
66 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 67 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
67 self.errorLabel.setText(error) 68 self.errorLabel.setText(error)
68 69
69 @pyqtSlot(str) 70 @pyqtSlot(str)

eric ide

mercurial