qml: in the password dialogs, disable the password confirmation
line if the first entered password is too short. Without that, a user may enter two passwords that are identical but too short, and then click on the eye icon in order to discover that they actuall are identical.. and only at this point guess that the size might be the problem. Also, raise the minimum length to 6, because that is what is was on Kivy. One of the password dialogs still had two eye icons; that was only fixed in the wizard. I guess that could be avoided if both dialogs used the same code.
This commit is contained in:
@@ -67,6 +67,9 @@ ElDialog {
|
||||
id: pw_2
|
||||
Layout.leftMargin: constants.paddingXLarge
|
||||
visible: confirmPassword
|
||||
showReveal: false
|
||||
echoMode: pw_1.echoMode
|
||||
enabled: pw_1.text.length >= 6
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +77,7 @@ ElDialog {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Ok")
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: confirmPassword ? pw_1.text.length > 4 && pw_1.text == pw_2.text : true
|
||||
enabled: confirmPassword ? pw_1.text.length >= 6 && pw_1.text == pw_2.text : true
|
||||
onClicked: {
|
||||
password = pw_1.text
|
||||
passworddialog.accept()
|
||||
|
||||
@@ -5,7 +5,7 @@ import QtQuick.Controls 2.1
|
||||
import "../controls"
|
||||
|
||||
WizardComponent {
|
||||
valid: password1.text === password2.text && password1.text.length > 4
|
||||
valid: password1.text === password2.text && password1.text.length >= 6
|
||||
|
||||
function apply() {
|
||||
wizard_data['password'] = password1.text
|
||||
@@ -25,6 +25,7 @@ WizardComponent {
|
||||
id: password2
|
||||
showReveal: false
|
||||
echoMode: password1.echoMode
|
||||
enabled: password1.text.length >= 6
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user