mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05: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 {
|
||||||
text: qsTr("Set password for 'pi' user:")
|
text: qsTr("Set password for 'pi' user:")
|
||||||
color: parent.enabled ? "black" : "grey"
|
color: parent.enabled ? (fieldUserPassword.indicateError ? "red" : "black") : "grey"
|
||||||
}
|
}
|
||||||
TextField {
|
TextField {
|
||||||
id: fieldUserPassword
|
id: fieldUserPassword
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
Layout.minimumWidth: 200
|
Layout.minimumWidth: 200
|
||||||
property bool alreadyCrypted: false
|
property bool alreadyCrypted: false
|
||||||
|
property bool indicateError: false
|
||||||
|
|
||||||
onTextEdited: {
|
onTextEdited: {
|
||||||
if (alreadyCrypted) {
|
if (alreadyCrypted) {
|
||||||
|
@ -184,6 +185,9 @@ Popup {
|
||||||
alreadyCrypted = false
|
alreadyCrypted = false
|
||||||
clear()
|
clear()
|
||||||
}
|
}
|
||||||
|
if (indicateError) {
|
||||||
|
indicateError = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -341,8 +345,9 @@ Popup {
|
||||||
Button {
|
Button {
|
||||||
text: qsTr("SAVE")
|
text: qsTr("SAVE")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (radioPasswordAuthentication.checked && fieldUserPassword.text.length == 0)
|
if (chkSSH.checked && radioPasswordAuthentication.checked && fieldUserPassword.text.length == 0)
|
||||||
{
|
{
|
||||||
|
fieldUserPassword.indicateError = true
|
||||||
fieldUserPassword.forceActiveFocus()
|
fieldUserPassword.forceActiveFocus()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue