|
@@ -111,6 +111,8 @@ class ConfigEntry(kcgw.KCGWidgets):
|
|
|
:param mark: mark false entered values?
|
|
|
:return: -
|
|
|
"""
|
|
|
+ if not self.value.isEnabled():
|
|
|
+ return True
|
|
|
if self.multiline:
|
|
|
try:
|
|
|
v, e = self.san(str(self.value.toPlainText()))
|
|
@@ -146,6 +148,8 @@ class ConfigEntry(kcgw.KCGWidgets):
|
|
|
if self.type == str:
|
|
|
|
|
|
val.replace('"', '\'')
|
|
|
+ if len(val) == 0:
|
|
|
+ return "", False
|
|
|
if val[0] == "'":
|
|
|
if not val[-1] == "'":
|
|
|
val += "'"
|
|
@@ -166,10 +170,13 @@ class ConfigEntry(kcgw.KCGWidgets):
|
|
|
comment = ''
|
|
|
for line in str(self.comment.text()).split('\n'):
|
|
|
comment += "# " + line + '\n'
|
|
|
- if self.multiline:
|
|
|
- val = self.value.toPlainText()
|
|
|
+ if self.value.isEnabled():
|
|
|
+ if self.multiline:
|
|
|
+ val = self.value.toPlainText()
|
|
|
+ else:
|
|
|
+ val = self.value.text()
|
|
|
else:
|
|
|
- val = self.value.text()
|
|
|
+ val = "'\"disabled\"'"
|
|
|
|
|
|
val, e = self.san(val)
|
|
|
|
|
@@ -314,16 +321,19 @@ class ConfigSetup(kcgw.KCGWidgets):
|
|
|
self.logging_label = self.createLabel("Logging")
|
|
|
self.logging_label.setStyleSheet("font-size:20pt;")
|
|
|
self.layout.addWidget(self.logging_label)
|
|
|
+
|
|
|
self.configs.append("\n[Logging]")
|
|
|
+ self.logging_entries = []
|
|
|
for comm, conf, type in zip(self.logging_comments, self.logging_configs, self.logging_types):
|
|
|
if conf == 'epics_log_entry_pvs' or conf == 'default_log_entries':
|
|
|
self.configs.append(ConfigEntry(comm, conf, type, multiline=True))
|
|
|
else:
|
|
|
self.configs.append(ConfigEntry(comm, conf, type))
|
|
|
self.layout.addWidget(self.configs[-1])
|
|
|
+ self.logging_entries.append(self.configs[-1])
|
|
|
|
|
|
self.scrollWidget.setWidget(self.wid)
|
|
|
-
|
|
|
+
|
|
|
def save(self):
|
|
|
"""
|
|
|
Save the configuration entered in the config window to a configuration file
|