mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Color password field red if user enabled SSH but forget password
Ref #188
This commit is contained in:
parent
91cb44d46e
commit
c67cd9bb19
1 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue