fix bug with indelible values in some 'optional' fields in project properties panel
only 'required' fields should be indelible
--- a/controls/ProjectPropertiesPanel.py Mon Feb 19 19:10:07 2018 +0300
+++ b/controls/ProjectPropertiesPanel.py Mon Feb 19 19:36:43 2018 +0300
@@ -285,7 +285,7 @@
if self.Controller is not None and self.Values is not None:
old_value = self.Values.get(name)
new_value = textctrl.GetValue()
- if name not in REQUIRED_PARAMS and new_value == "":
+ if name in REQUIRED_PARAMS and new_value == "":
new_value = None
if name == 'companyURL':
if not URI_model.match(new_value):
--- a/plcopen/plcopen.py Mon Feb 19 19:10:07 2018 +0300
+++ b/plcopen/plcopen.py Mon Feb 19 19:36:43 2018 +0300
@@ -441,7 +441,7 @@
"authorName": contentheader_obj.setauthor,
"pageSize": lambda v: contentheader_obj.setpageSize(*v),
"scaling": contentheader_obj.setscaling}.get(attr)
- if func is not None:
+ if func is not None and value is not None:
func(value)
elif attr in ["modificationDateTime", "organization", "language"]:
setattr(contentheader_obj, attr, value)