module = self.currentModule()
if module is not None:
try:
- supported = bertos_utils.isSupported(module, self.project())
+ 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(selectedModule))
supported = True
for i, property in param_list:
if "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "autoenabled":
# Doesn't show the hidden fields
- pass
+ continue
+ try:
+ param_supported = bertos_utils.isSupported(self.project(), property_id=(configuration, property))
+ except SupportedException, e:
+ self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule))
+ param_supported = True
+ if not param_supported:
+ # Doesn't show the unsupported parameters
+ continue
+ # Set the row count to the current index + 1
+ self.pageContent.propertyTable.setRowCount(index + 1)
+ item = QTableWidgetItem(configurations[property]["brief"])
+ item.setData(Qt.UserRole, qvariant_converter.convertString(property))
+ self.pageContent.propertyTable.setItem(index, 0, item)
+ if "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "boolean":
+ self.insertCheckBox(index, configurations[property]["value"])
+ elif "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "enum":
+ self.insertComboBox(index, configurations[property]["value"], configurations[property]["informations"]["value_list"])
+ elif "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "int":
+ self.insertSpinBox(index, configurations[property]["value"], configurations[property]["informations"])
else:
- # Set the row count to the current index + 1
- self.pageContent.propertyTable.setRowCount(index + 1)
- item = QTableWidgetItem(configurations[property]["brief"])
- item.setData(Qt.UserRole, qvariant_converter.convertString(property))
- self.pageContent.propertyTable.setItem(index, 0, item)
- if "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "boolean":
- self.insertCheckBox(index, configurations[property]["value"])
- elif "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "enum":
- self.insertComboBox(index, configurations[property]["value"], configurations[property]["informations"]["value_list"])
- elif "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "int":
- self.insertSpinBox(index, configurations[property]["value"], configurations[property]["informations"])
- else:
- # Not defined type, rendered as a text field
- self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(configurations[property]["value"]))
- index += 1
+ # Not defined type, rendered as a text field
+ self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(configurations[property]["value"]))
+ index += 1
if self.pageContent.propertyTable.rowCount() == 0:
module_label = self.pageContent.moduleLabel.text()
module_label += "\n\nNo configuration needed."
enabled = modules[module]["enabled"]
module_item = QTreeWidgetItem(item, QStringList([module]))
try:
- supported = bertos_utils.isSupported(module, self.project())
+ 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(selectedModule))
supported = True
module_dict[module_name]["enabled"] = False
return to_be_parsed, module_dict
-def isSupported(module, project):
+def isSupported(project, module=None, property_id=None):
+ if module is None and property_id is not None:
+ item = project.info("CONFIGURATIONS")[property_id[0]][property_id[1]]["informations"]
+ else:
+ item = project.info("MODULES")[module]
tag_dict = project.info("ALL_CPU_TAGS")
- module = project.info("MODULES")[module]
- if "supports" in module:
- support_string = module["supports"]
+ if "supports" in item:
+ support_string = item["supports"]
supported = {}
try:
exec "supported = " + support_string in tag_dict, supported
return supported["supported"]
else:
return True
-
def loadDefineLists(comment_list):
define_list = {}