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:
parent
6243880982
commit
a96d4b4dc9
|
|
@ -346,6 +346,8 @@ class AddSensorDlg(wx.Dialog):
|
||||||
self.bSave.Enable(False)
|
self.bSave.Enable(False)
|
||||||
|
|
||||||
def onTextCtrlInteger(self, tc, rqd):
|
def onTextCtrlInteger(self, tc, rqd):
|
||||||
|
if not rqd:
|
||||||
|
return True
|
||||||
w = tc.GetValue().strip()
|
w = tc.GetValue().strip()
|
||||||
if w == "":
|
if w == "":
|
||||||
if rqd:
|
if rqd:
|
||||||
|
|
@ -368,6 +370,8 @@ class AddSensorDlg(wx.Dialog):
|
||||||
return valid
|
return valid
|
||||||
|
|
||||||
def onTextCtrlFloat(self, tc, rqd):
|
def onTextCtrlFloat(self, tc, rqd):
|
||||||
|
if not rqd:
|
||||||
|
return True
|
||||||
w = tc.GetValue().strip()
|
w = tc.GetValue().strip()
|
||||||
if w == "":
|
if w == "":
|
||||||
if rqd:
|
if rqd:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue