Set an option for the tree view. The child may be None.
(self, parent, child, value)
| 537 | self.__schedule_flush() |
| 538 | |
| 539 | def set_tree(self, parent, child, value): |
| 540 | """Set an option for the tree view. The child may be None.""" |
| 541 | if not self.config.has_section("tree"): |
| 542 | self.config.add_section("tree") |
| 543 | option = parent |
| 544 | if child is not None: |
| 545 | option = option + "." + child |
| 546 | if self.config.has_option('tree', option) and not value: |
| 547 | self.config.remove_option('tree', option) |
| 548 | else: |
| 549 | self.config.set('tree', option, str(value)) |
| 550 | self.__schedule_flush() |
| 551 | |
| 552 | def toggle(self, key): |
| 553 | """Toggle a boolean key""" |