From: duplo Date: Thu, 26 Mar 2009 09:09:21 +0000 (+0000) Subject: Correct a little bug about empty configurations X-Git-Tag: 2.1.0~248 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=2c6bd0cab479f9b11cf1dc05ba07110a5db34432;p=bertos.git Correct a little bug about empty configurations git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2434 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index b124df9c..1d9e414b 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -73,30 +73,31 @@ class BModulePage(BWizardPage): self.pageContent.moduleLabel.setText(module_description) self.pageContent.moduleLabel.setVisible(True) self.pageContent.propertyTable.clear() - configurations = self._projectInfoRetrieve("CONFIGURATIONS")[configuration] - param_list = sorted(configurations["paramlist"]) self.pageContent.propertyTable.setRowCount(0) - index = 0 - 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 - 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"]) + if configuration != "": + configurations = self._projectInfoRetrieve("CONFIGURATIONS")[configuration] + param_list = sorted(configurations["paramlist"]) + index = 0 + 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 else: - # Not defined type, rendered as a text field - self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(configurations[property]["value"])) - index += 1 + ## 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 def _insertCheckBox(self, index, value): ## boolean property