mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Prevent user from entering invalid characters in hostname field
Implemented as "validator" which will cause that if an user presses a key that is not allowed, it will not register. Saves having to add an error message that would need to be translated to different languages. Closes #474
This commit is contained in:
parent
9c95398210
commit
ce0b02b823
2 changed files with 5 additions and 1 deletions
|
@ -127,6 +127,9 @@ Popup {
|
|||
id: fieldHostname
|
||||
enabled: chkHostname.checked
|
||||
text: "raspberrypi"
|
||||
/* FIXME: use RegularExpressionValidator instead when moving to newer Qt version.
|
||||
It is not available in 5.12 that is still being used by Ubuntu 20 LTS though */
|
||||
validator: RegExpValidator { regExp: /[0-9A-Za-z][0-9A-Za-z-]{0,62}/ }
|
||||
}
|
||||
Text {
|
||||
text : ".local"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue