X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=88be219efe4a323743437ac06a47f124054f90b3;hb=cc03eb93224f06debc7f426acd9374076e8be834;hp=24105c196d50391811ff6570d6929417cd7c9476;hpb=a861d8e4e8a484679865bf5cd4e26954f76452da;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 24105c19..88be219e 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -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. """ - 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(): - 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): """