From: duplo Date: Thu, 5 Feb 2009 19:33:10 +0000 (+0000) Subject: Accept empty configuration field in the module definition X-Git-Tag: 2.1.0~400 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=a3f8182f09904311ccd71676d8a348900774c74c;hp=5f8280945446a255b5ef549ab70559a41623adc9;p=bertos.git Accept empty configuration field in the module definition git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2282 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 02a74374..7979133b 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -43,8 +43,9 @@ class BModulePage(BWizardPage): lists = bertos_utils.loadDefineListsDict(self._projectInfoRetrieve("SOURCES_PATH")) configurations = {} for module, informations in modules.items(): - configurations[informations["configuration"]] = bertos_utils.loadConfigurationInfos(self._projectInfoRetrieve("SOURCES_PATH") + - "/" + informations["configuration"]) + if len(informations["configuration"]) > 0: + configurations[informations["configuration"]] = bertos_utils.loadConfigurationInfos(self._projectInfoRetrieve("SOURCES_PATH") + + "/" + informations["configuration"]) except ModuleDefineException, e: self._exceptionOccurred(self.tr("Error parsing module information in file %1").arg(e.parameter)) except EnumDefineException, e: @@ -72,8 +73,11 @@ class BModulePage(BWizardPage): module = self._currentModule() self._controlGroup.clear() configuration = self._projectInfoRetrieve("MODULES")[module]["configuration"] - configurations = self._projectInfoRetrieve("CONFIGURATIONS")[configuration] self.pageContent.propertyTable.clear() + if len(configuration) == 0: + self.pageContent.propertyTable.setRowCount(0) + return + configurations = self._projectInfoRetrieve("CONFIGURATIONS")[configuration] self.pageContent.propertyTable.setRowCount(len(configurations)) for index, property in enumerate(configurations): item = QTableWidgetItem(property) @@ -188,7 +192,7 @@ class BModulePage(BWizardPage): 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(self.pageContent.propertyTable.cellWidget(index, 1).value()) + 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": @@ -274,9 +278,12 @@ class QControlGroup(QObject): self.connect(control, SIGNAL("valueChanged(int)"), lambda: self._stateChanged(id)) elif type(control) == QComboBox: self.connect(control, SIGNAL("currentIndexChanged(int)"), lambda: self._stateChanged(id)) + elif type(control) == QDoubleSpinBox: + self.connect(control, SIGNAL("valueChanged(double)"), lambda: self._stateChanged(id)) def clear(self): self._controls = {} def _stateChanged(self, id): + print id self.emit(SIGNAL("stateChanged"), id) \ No newline at end of file