diff --git a/configtool/boardpanel.py b/configtool/boardpanel.py index 737ac12..e449153 100644 --- a/configtool/boardpanel.py +++ b/configtool/boardpanel.py @@ -396,7 +396,12 @@ class BoardPanel(wx.Panel): m = reDefBool.search(ln) if m: t = m.groups() - if len(t) == 1 and (t[0] in self.cfgNames): + # Accept booleans, but not those for which a value exists already. + # Booleans already existing as values are most likely misconfigured + # manual edits (or result of a bug). + if len(t) == 1 and t[0] in self.cfgNames \ + and not (t[0] in self.cfgValues \ + and isinstance(self.cfgValues[t[0]], tuple)): if reDefBoolBL.search(ln): self.cfgValues[t[0]] = True else: diff --git a/configtool/printerpanel.py b/configtool/printerpanel.py index f976985..08ab132 100644 --- a/configtool/printerpanel.py +++ b/configtool/printerpanel.py @@ -322,7 +322,12 @@ class PrinterPanel(wx.Panel): m = reDefBool.search(ln) if m: t = m.groups() - if len(t) == 1 and (t[0] in self.cfgNames): + # Accept booleans, but not those for which a value exists already. + # Booleans already existing as values are most likely misconfigured + # manual edits (or result of a bug). + if len(t) == 1 and t[0] in self.cfgNames \ + and not (t[0] in self.cfgValues \ + and isinstance(self.cfgValues[t[0]], tuple)): if reDefBoolBL.search(ln): self.cfgValues[t[0]] = True else: