rgonzalez72/pytrainer — comment on commit 4e9e597cea20dfba672a3c90584ba3edfce5999e
File:  line 0
By ncjones:

Hmm, you are correct on both of these issues.

I disagree with the recommendation from the Gnome HIG though. I am not sure if we should follow this particular guideline. I tested out a few Gnome UIs with regards to this behaviour and don't find them particularly useful. For example, if you open the properties dialog for a file in Nautilus and change the name of the file to an invalid value (the same as an existing file or "/" etc) then you will get an obtrusive error dialog appear after the field loses focus. IMO it provides a better user experience to have inline error message appear in real time as the invalid value is being typed.

For the error message remaining visible when switching between tabs I suggest moving the message above the tabs so that it is obvious that it applies not just to the current tab.

Fortunately these issues can be largely mitigated byusing gtk.SpinButton to prevent invalid numeric input being entered at all. I have tested the SpinButton widget and confirmed that this is suitable for this type of use. I see that you have created a somewhat generic EntryInputFieldValidator type to perform this function. You can replace its use with the SpinButton widget.

There is also another type of validation that we need to consider: sport and equipment names must be unique. Currently you cannot add a new equipment item that has a non-unique name but there is no explanation as to why clicking "add" has no effect.