(self, sections, pdata, sec="core")
| 134 | |
| 135 | |
| 136 | def saveSection(self, sections, pdata, sec="core"): |
| 137 | for k, section in enumerate(pdata): |
| 138 | if k in sections: |
| 139 | widget = sections[k] |
| 140 | for item in section.items: |
| 141 | if item.name in widget.inputs: |
| 142 | i = widget.inputs[item.name] |
| 143 | |
| 144 | #TODO : unresolved reference: option |
| 145 | |
| 146 | if item.type == "int": |
| 147 | if i.value() != int(item.value): |
| 148 | self.connector.setConfigValue(k, option, i.value(), sec) |
| 149 | elif not item.type.find(";") == -1: |
| 150 | if i.currentText() != item.value: |
| 151 | self.connector.setConfigValue(k, option, i.currentText(), sec) |
| 152 | elif item.type == "bool": |
| 153 | if (True if item.value.lower() in ("1","true", "on", "an","yes") else False) ^ (not i.currentIndex()): |
| 154 | self.connector.setConfigValue(k, option, not i.currentIndex(), sec) |
| 155 | else: |
| 156 | if i.text() != item.value: |
| 157 | self.connector.setConfigValue(k, option, str(i.text()), sec) |
| 158 | |
| 159 | class Section(QGroupBox): |
| 160 | def __init__(self, data, parent, ctype="core"): |
no test coverage detected