addsensordlg.py: always validate not required fields.

Previously funny things could happen, like a refusal to save
temperature sensors just because some unused field contained
garbage.
This commit is contained in:
jbernardis 2015-05-06 19:37:51 -04:00 committed by Markus Hitter
parent 6243880982
commit a96d4b4dc9
1 changed files with 4 additions and 0 deletions

View File

@ -346,6 +346,8 @@ class AddSensorDlg(wx.Dialog):
self.bSave.Enable(False)
def onTextCtrlInteger(self, tc, rqd):
if not rqd:
return True
w = tc.GetValue().strip()
if w == "":
if rqd:
@ -368,6 +370,8 @@ class AddSensorDlg(wx.Dialog):
return valid
def onTextCtrlFloat(self, tc, rqd):
if not rqd:
return True
w = tc.GetValue().strip()
if w == "":
if rqd: