From: duplo Date: Mon, 30 Mar 2009 12:16:08 +0000 (+0000) Subject: Check the existance of the value_list, if it doesn't exist show an error message... X-Git-Tag: 2.1.0~240 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=510870087483dcee61c7fe93abe7b4a37f2714f3;p=bertos.git Check the existance of the value_list, if it doesn't exist show an error message and put an uneditable field with the current value. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2442 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 5f17d881..e3d99278 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -123,14 +123,18 @@ class BModulePage(BWizardPage): def _insertComboBox(self, index, value, value_list): ## enum property - combo_box = QComboBox() - self.pageContent.propertyTable.setCellWidget(index, 1, combo_box) - enum = self._projectInfoRetrieve("LISTS")[value_list] - for i, element in enumerate(enum): - combo_box.addItem(element) - if element == value: - combo_box.setCurrentIndex(i) - self._control_group.addControl(index, combo_box) + try: + enum = self._projectInfoRetrieve("LISTS")[value_list] + combo_box = QComboBox() + self.pageContent.propertyTable.setCellWidget(index, 1, combo_box) + for i, element in enumerate(enum): + combo_box.addItem(element) + if element == value: + combo_box.setCurrentIndex(i) + self._control_group.addControl(index, combo_box) + except KeyError: + self._exceptionOccurred(self.tr("Define list \"%1\" not found. Check definition files.").arg(value_list)) + self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(value)) def _insertSpinBox(self, index, value, informations): ## int, long or undefined type property