+ configurations[configuration][property]["value"] = "0"
+ self.setProjectInfo("CONFIGURATIONS", configurations)
+ if self.moduleItem(self.currentModule()).checkState(0) == Qt.Checked:
+ self.dependencyCheck(self.moduleItem(self.currentModule()))
+
+ ####
+
+ def loadModuleData(self):
+ """
+ Loads the module data.
+ """
+ # Do not load the module data again when the Wizard is in editing mode
+ # or when it's working on a preset.
+ if not self.project.edit and not self.project.from_preset:
+ # Load the module data every time so that if the user changed the cpu
+ # the right configurations are picked up.
+ try:
+ self.project.loadModuleData()
+ except ModuleDefineException, e:
+ self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
+ except EnumDefineException, e:
+ self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
+ except ConfigurationDefineException, e:
+ self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
+
+ def fillModuleTree(self):
+ """
+ Fills the module tree with the module entries separated in categories.
+ """
+ self.pageContent.moduleTree.clear()
+ modules = self.projectInfo("MODULES")
+ if not modules:
+ return
+ categories = {}
+ for module, information in modules.items():
+ if information["category"] not in categories:
+ categories[information["category"]] = []
+ categories[information["category"]].append(module)
+ for category, module_list in categories.items():
+ item = QTreeWidgetItem(QStringList([category]))
+ for module in module_list:
+ enabled = modules[module]["enabled"]
+ module_item = QTreeWidgetItem(item, QStringList([module]))
+ try:
+ supported = bertos_utils.isSupported(self.project, module=module)
+ except SupportedException, e:
+ self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(module))
+ supported = True
+ if not supported:
+ module_item.setForeground(0, QBrush(QColor(Qt.red)))
+ if enabled:
+ module_item.setCheckState(0, Qt.Checked)
+ else:
+ module_item.setCheckState(0, Qt.Unchecked)
+ self.pageContent.moduleTree.addTopLevelItem(item)
+ self.pageContent.moduleTree.sortItems(0, Qt.AscendingOrder)
+ self.fillPropertyTable()
+
+ def insertCheckBox(self, index, value):
+ """
+ Inserts in the table at index a checkbox for a boolean property setted
+ to value.
+ """
+ check_box = QCheckBox()
+ self.pageContent.propertyTable.setCellWidget(index, 1, check_box)
+ if value == "1":
+ check_box.setChecked(True)
+ else:
+ check_box.setChecked(False)
+ self._control_group.addControl(index, check_box)