Add stub for board selection page.
[bertos.git] / wizard / BToolchainPage.py
index 24105c196d50391811ff6570d6929417cd7c9476..88be219efe4a323743437ac06a47f124054f90b3 100644 (file)
@@ -155,10 +155,12 @@ class BToolchainPage(BWizardPage):
         Slot called when the user clicks on the validate button. It starts the
         toolchain validation procedure for all the toolchains.
         """
         Slot called when the user clicks on the validate button. It starts the
         toolchain validation procedure for all the toolchains.
         """
-        QApplication.instance().setOverrideCursor(Qt.WaitCursor)
-        for i in range(self.pageContent.toolchainList.count()):
-            self.validateToolchain(i)
-        QApplication.instance().restoreOverrideCursor()
+        try:
+            QApplication.instance().setOverrideCursor(Qt.WaitCursor)
+            for i in range(self.pageContent.toolchainList.count()):
+                self.validateToolchain(i)
+        finally:
+            QApplication.instance().restoreOverrideCursor()
 
     ####
 
 
     ####
 
@@ -174,13 +176,18 @@ class BToolchainPage(BWizardPage):
                 toolchains[toolchain] = True
         sel_toolchain = self.projectInfo("TOOLCHAIN")
         for key, value in toolchains.items():
                 toolchains[toolchain] = True
         sel_toolchain = self.projectInfo("TOOLCHAIN")
         for key, value in toolchains.items():
-            item = QListWidgetItem(key)
-            item.setData(Qt.UserRole, qvariant_converter.convertStringDict({"path": key}))
-            self.pageContent.toolchainList.addItem(item)
-            if sel_toolchain and sel_toolchain["path"] == key:
-                self.pageContent.toolchainList.setCurrentItem(item)
-            if value:
-                self.validateToolchain(self.pageContent.toolchainList.row(item))
+            if os.path.exists(key):
+                item = QListWidgetItem(key)
+                item.setData(Qt.UserRole, qvariant_converter.convertStringDict({"path": key}))
+                self.pageContent.toolchainList.addItem(item)
+                if sel_toolchain and sel_toolchain["path"] == key:
+                    self.pageContent.toolchainList.setCurrentItem(item)
+                if value:
+                    self.validateToolchain(self.pageContent.toolchainList.row(item))
+
+    def currentToolchain(self):
+        selected_toolchain = qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole))
+        return selected_toolchain
 
     def _clearList(self):
         """
 
     def _clearList(self):
         """