Color password field red if user enabled SSH but forget password
Ref #188
This commit is contained in:
+7
-2
@@ -169,13 +169,14 @@ Popup {
|
||||
|
||||
Text {
|
||||
text: qsTr("Set password for 'pi' user:")
|
||||
color: parent.enabled ? "black" : "grey"
|
||||
color: parent.enabled ? (fieldUserPassword.indicateError ? "red" : "black") : "grey"
|
||||
}
|
||||
TextField {
|
||||
id: fieldUserPassword
|
||||
echoMode: TextInput.Password
|
||||
Layout.minimumWidth: 200
|
||||
property bool alreadyCrypted: false
|
||||
property bool indicateError: false
|
||||
|
||||
onTextEdited: {
|
||||
if (alreadyCrypted) {
|
||||
@@ -184,6 +185,9 @@ Popup {
|
||||
alreadyCrypted = false
|
||||
clear()
|
||||
}
|
||||
if (indicateError) {
|
||||
indicateError = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,8 +345,9 @@ Popup {
|
||||
Button {
|
||||
text: qsTr("SAVE")
|
||||
onClicked: {
|
||||
if (radioPasswordAuthentication.checked && fieldUserPassword.text.length == 0)
|
||||
if (chkSSH.checked && radioPasswordAuthentication.checked && fieldUserPassword.text.length == 0)
|
||||
{
|
||||
fieldUserPassword.indicateError = true
|
||||
fieldUserPassword.forceActiveFocus()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user