(self)
| 35 | self.connector = connector |
| 36 | |
| 37 | def loadConfig(self): |
| 38 | if self.sections and self.psections: |
| 39 | self.data = self.connector.getConfig() |
| 40 | self.pdata = self.connector.getPluginConfig() |
| 41 | |
| 42 | self.reloadSection(self.sections, self.data) |
| 43 | self.reloadSection(self.psections, self.pdata) |
| 44 | |
| 45 | return |
| 46 | |
| 47 | if self.layout(): |
| 48 | delete(self.layout()) |
| 49 | |
| 50 | for s in self.sections.values()+self.psections.values(): |
| 51 | delete(s) |
| 52 | |
| 53 | self.sections = {} |
| 54 | self.setLayout(QVBoxLayout()) |
| 55 | self.clearConfig() |
| 56 | layout = self.layout() |
| 57 | layout.setSizeConstraint(QLayout.SetMinAndMaxSize) |
| 58 | |
| 59 | general = QTabWidget() |
| 60 | self.general = general |
| 61 | |
| 62 | plugins = QTabWidget() |
| 63 | self.plugins = plugins |
| 64 | |
| 65 | tab = QTabWidget() |
| 66 | self.tab = tab |
| 67 | |
| 68 | gw = QWidget() |
| 69 | gw.setLayout(QVBoxLayout()) |
| 70 | gw.layout().addWidget(self.general) |
| 71 | pw = QWidget() |
| 72 | pw.setLayout(QVBoxLayout()) |
| 73 | pw.layout().addWidget(self.plugins) |
| 74 | tab.addTab(gw, _("General")) |
| 75 | tab.addTab(pw, _("Plugins")) |
| 76 | |
| 77 | layout.addWidget(tab) |
| 78 | |
| 79 | self.data = self.connector.getConfig() |
| 80 | self.pdata = self.connector.getPluginConfig() |
| 81 | for k, section in self.data.iteritems(): |
| 82 | s = Section(section, general) |
| 83 | self.sections[k] = s |
| 84 | |
| 85 | for k, section in self.pdata.iteritems(): |
| 86 | s = Section(section, plugins, "plugin") |
| 87 | self.psections[k] = s |
| 88 | |
| 89 | rel = QPushButton(_("Reload")) |
| 90 | save = QPushButton(_("Save")) |
| 91 | |
| 92 | layout.addWidget(save) |
| 93 | |
| 94 | cont = QHBoxLayout() |
no test coverage detected