- def _showPropertyDescription(self):
- self._resetPropertyDescription()
- configurations = self._currentModuleConfigurations()
- if self._currentProperty() in configurations.keys():
- description = configurations[self._currentProperty()]["brief"]
- name = self._currentProperty()
- self._currentPropertyItem().setText(description + "\n" + name)
-
- def _setupUi(self):
- self.pageContent.moduleTable.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
- self.pageContent.moduleTable.horizontalHeader().setStretchLastSection(True)
- self.pageContent.moduleTable.horizontalHeader().setVisible(False)
- self.pageContent.moduleTable.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
- self.pageContent.moduleTable.verticalHeader().setVisible(False)
- self.pageContent.moduleTable.setColumnCount(2)
- self.pageContent.moduleTable.setRowCount(0)
- self.pageContent.propertyTable.horizontalHeader().setResizeMode(QHeaderView.Stretch)
- self.pageContent.propertyTable.horizontalHeader().setVisible(False)
- self.pageContent.propertyTable.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
- self.pageContent.propertyTable.verticalHeader().setVisible(False)
- self.pageContent.propertyTable.setColumnCount(2)
- self.pageContent.propertyTable.setRowCount(0)
- self.pageContent.moduleLabel.setVisible(False)
-
- def _connectSignals(self):
- self.connect(self.pageContent.moduleTable, SIGNAL("itemSelectionChanged()"), self._fillPropertyTable)
- self.connect(self.pageContent.propertyTable, SIGNAL("itemSelectionChanged()"), self._showPropertyDescription)
- self.connect(self._controlGroup, SIGNAL("stateChanged"), self._saveValue)
-
- def _saveValue(self, index):
- property = qvariant_converter.getString(self.pageContent.propertyTable.item(index, 0).data(Qt.UserRole))
- configuration = self._projectInfoRetrieve("MODULES")[self._currentModule()]["configuration"]
- configurations = self._projectInfoRetrieve("CONFIGURATIONS")
- if "type" not in configurations[configuration][property]["informations"].keys() or configurations[configuration][property]["informations"]["type"] == "int":
- configurations[configuration][property]["value"] = str(int(self.pageContent.propertyTable.cellWidget(index, 1).value()))
- elif configurations[configuration][property]["informations"]["type"] == "enum":
- configurations[configuration][property]["value"] = unicode(self.pageContent.propertyTable.cellWidget(index, 1).currentText())
- elif configurations[configuration][property]["informations"]["type"] == "boolean":
- if self.pageContent.propertyTable.cellWidget(index, 1).isChecked():
- configurations[configuration][property]["value"] = "1"
- else:
- configurations[configuration][property]["value"] = "0"
- self._projectInfoStore("CONFIGURATIONS", configurations)
-
- def _moduleSelectionChanged(self, index):
- module = unicode(self.pageContent.moduleTable.item(index, 1).text())
- if self._buttonGroup.button(index).isChecked():
- self._moduleSelected(module)
- else:
- self._moduleUnselected(module)
-
- def _moduleSelected(self, selectedModule):
- modules = self._projectInfoRetrieve("MODULES")