52 |
52 |
53 if self.newPasswordEdit.text() == "": |
53 if self.newPasswordEdit.text() == "": |
54 enable = False |
54 enable = False |
55 error = error or self.tr("New password must not be empty.") |
55 error = error or self.tr("New password must not be empty.") |
56 |
56 |
57 if self.newPasswordEdit.text() != "" and \ |
57 if ( |
58 self.newPasswordEdit.text() != self.newPasswordAgainEdit.text(): |
58 self.newPasswordEdit.text() != "" and |
|
59 self.newPasswordEdit.text() != self.newPasswordAgainEdit.text() |
|
60 ): |
59 enable = False |
61 enable = False |
60 error = error or self.tr("Repeated password is wrong.") |
62 error = error or self.tr("Repeated password is wrong.") |
61 |
63 |
62 if self.currentPasswordEdit.isEnabled(): |
64 if self.currentPasswordEdit.isEnabled(): |
63 if self.newPasswordEdit.text() == self.currentPasswordEdit.text(): |
65 if self.newPasswordEdit.text() == self.currentPasswordEdit.text(): |
64 enable = False |
66 enable = False |
65 error = error or \ |
67 error = error or self.tr( |
66 self.tr("Old and new password must not be the same.") |
68 "Old and new password must not be the same.") |
67 |
69 |
68 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
70 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
69 self.errorLabel.setText(error) |
71 self.errorLabel.setText(error) |
70 |
72 |
71 @pyqtSlot(str) |
73 @pyqtSlot(str) |