| 104 | self.sections = {} |
| 105 | |
| 106 | def reloadSection(self, sections, pdata): |
| 107 | |
| 108 | for k, section in enumerate(pdata): |
| 109 | if k in sections: |
| 110 | widget = sections[k] |
| 111 | for item in section.items: |
| 112 | if item.name in widget.inputs: |
| 113 | i = widget.inputs[item.name] |
| 114 | |
| 115 | if item.type == "int": |
| 116 | i.setValue(int(item.value)) |
| 117 | elif not item.type.find(";") == -1: |
| 118 | i.setCurrentIndex(i.findText(item.value)) |
| 119 | elif item.type == "bool": |
| 120 | if True if item.value.lower() in ("1","true", "on", "an","yes") else False: |
| 121 | i.setCurrentIndex(0) |
| 122 | else: |
| 123 | i.setCurrentIndex(1) |
| 124 | else: |
| 125 | i.setText(item.value) |
| 126 | |
| 127 | |
| 128 | def saveConfig(self): |