Skip to content

Commit

Permalink
Prevent user from entering invalid characters in hostname field
Browse files Browse the repository at this point in the history
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
  • Loading branch information
maxnet committed Aug 18, 2022
1 parent 9c95398 commit ce0b02b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ rpi-imager (1.7.3) unstable; urgency=medium
* Allow selecting file names without extension
* Add possibility to outsource handling of custom settings to script at
/usr/lib/raspberrypi-sys-mods/imager_custom
* Advanced settings: disallow invalid characters in hostname field

-- Floris Bos <[email protected]> Sun, 31 Jul 2022 12:15:17 +0200
-- Floris Bos <[email protected]> Thu, 18 Aug 2022 20:04:37 +0200

rpi-imager (1.7.2) unstable; urgency=medium

Expand Down
3 changes: 3 additions & 0 deletions src/OptionsPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ce0b02b

Please sign in to comment.