X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=88be219efe4a323743437ac06a47f124054f90b3;hb=e47f203a5648786cd782d921880a77a395570059;hp=f85dbb1f30c44b417d01fb7c8b88eda138e65c81;hpb=fd6894350a266f4436055940e6220151a4fd43de;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index f85dbb1f..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): """ @@ -288,4 +295,6 @@ class BToolchainPage(BWizardPage): Enable the remove button. """ self.pageContent.removeButton.setEnabled(True) - \ No newline at end of file + + def currentItem(self): + return self.pageContent.toolchainList.currentItem()