From 510870087483dcee61c7fe93abe7b4a37f2714f3 Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 30 Mar 2009 12:16:08 +0000 Subject: [PATCH] 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 --- wizard/BModulePage.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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 -- 2.25.1