[PATCH] Mark Air/Water temp field red for wrong input.

Yosef Hamza jo.adam.93 at gmail.com
Sat Apr 12 10:42:23 PDT 2014


Thanks for the review.

I made it a little more tolerant if editing existing values instead of
giving red while deleting it at some point -after deleting the Unit and
after last number after the '.'-  then back to normal yellow and for empty
string -or should I leave it marked red for empty string?- which made it
more consistent for the user.

Waiting for the review.

Regards,
Yousef Hamza


On Sat, Apr 12, 2014 at 6:02 PM, Miika Turkia <miika.turkia at gmail.com>wrote:

> On Sat, Apr 12, 2014 at 6:04 PM, Yosef Hamza <jo.adam.93 at gmail.com> wrote:
>
>> As a warining for the user mark the field red.
>> if user inputs invaild input that will be ignored
>> while parsing.
>>
>
> The pattern matching is a bit broken. E.g. following input for temperature
> is accepted:
> 2 8.5°C fff  asfdf ,
>
> If the input contains ° or , characters, then it is accepted, no matter
> what else is in it. I would go for a single regexp pattern that includes
> all valid inputs. Something like this:
>
>     if
> (!text.contains(QRegExp("^[-+]{0,1}[0-9]+([,.][0-9]+){0,1}(°[CF]){0,1}$")))
> {
>
> This matches the full input field and allows optionally different parts of
> temperature to be given. I am not sure if the unit makes sense after the
> degree sign, as it is not parsed but the configured unit is used instead.
>
> miika
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140412/4e017a01/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Mark-Air-Water-temp-field-red-for-wrong-input.patch
Type: application/octet-stream
Size: 2576 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140412/4e017a01/attachment.obj>


More information about the subsurface mailing list