From 8b39352d4ebae623e8956354cdbf2678fbfcb71e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 20 Feb 2016 21:55:59 -0800 Subject: [PATCH] QML UI: only allow valid gas mixes The input is restricted to EAN100 EANxx (with 'x' one of 0..9) AIR xx/xx (with 'x' one of 0..9) xxx (with 'x' one of 0..9 and the number <= 100) Signed-off-by: Dirk Hohndel --- qt-mobile/qml/DiveDetailsEdit.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/qt-mobile/qml/DiveDetailsEdit.qml b/qt-mobile/qml/DiveDetailsEdit.qml index 2c7baf3e1..c2f468d98 100644 --- a/qt-mobile/qml/DiveDetailsEdit.qml +++ b/qt-mobile/qml/DiveDetailsEdit.qml @@ -180,6 +180,7 @@ Item { id: txtGasMix readOnly: (text == "cannot edit multiple gases" ? true : false) Layout.fillWidth: true + validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/ } } MobileComponents.Label {