Improve parsing of possible subject nr field
Closed this issue · 6 comments
It might be a good idea to implement an input mask to the possible subject nrs field, so users can only enter numbers, commas and if they desire, whitespace characters. This makes input validation unnecessary, and guides users to the correct way of using this box.
Another valuable addition may be a dash, so users can also specify a range. Thus,
1,3-6, 10
is valid input, and evaluates to 1,3,4,5,6,10
What do you think of this?
That seems like a good idea. Qt has input validators for this purpose.
Cool thanks! I think validation is necessary in addition to input masking. The latter allows users to only enter valid characters (which are numbers, commas, dashes, and spaces). Is this what we desire? The former should also check if users don't enter things such as 1,2-,4
, or 1,2,5-2,7
, etc. These checks should occur both in the QT UI of the extension (doing a realtime check of the subject no. field input and showing a small error message below the field if the input is invalid), and maybe before one of the export buttons is clicked (showing the error message as a popup or notification).
Are we on the same page about this?
I'm going to work on this, after I have the 'show informative error messages' issue handled in osweb itself.
Are we on the same page about this?
Absolutely, and that's what the QValidator
does :-)
I'm going to work on this, after I have the 'show informative error messages' issue handled in osweb itself.
Yes, indeed, that has priority.
The parsing still isn't perfect, as currently a pattern like 1,2-33-2,5
is allowed (so double -
). This is only possible if the middle number between the - is a double (or higher) digit, so it possibly has to do with the 'greediness' of the expression.
Closing because of no activity