X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=6239a1d9dd0f1fa9503185b2428a272dde643452;hb=166b28ff378fba3466d171ee0b7b3c7c56f745dc;hp=4f7b4bf83701c022d800de4362c30862677e5087;hpb=df3bd7f742da8c015304fa21e01eb966ff76a089;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 4f7b4bf8..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): """ @@ -251,7 +256,7 @@ class BToolchainPage(BWizardPage): self._validation_process.start(filename, ["-v"]) self._validation_process.waitForStarted(1000) if self._validation_process.waitForFinished(200): - description = str(self._validation_process.readAllStandardError()) + description = unicode(self._validation_process.readAllStandardError()) info = bertos_utils.getToolchainInfo(description) if len(info) >= 4: valid = True @@ -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()