Check the existance of the value_list, if it doesn't exist show an error message...
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 30 Mar 2009 12:16:08 +0000 (12:16 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 30 Mar 2009 12:16:08 +0000 (12:16 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2442 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py

index 5f17d88181a6001be60a8d3b51928440d4f9e361..e3d99278ee28aff46499b70bea2d1e2a9e61c52c 100644 (file)
@@ -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