X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=6239a1d9dd0f1fa9503185b2428a272dde643452;hb=b3fe69febaf2e2e41937b0f0e0dfad9b5fcbc3a5;hp=f85dbb1f30c44b417d01fb7c8b88eda138e65c81;hpb=fd6894350a266f4436055940e6220151a4fd43de;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index f85dbb1f..6239a1d9 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -174,13 +174,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 +293,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()