X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=567fbcee11e0f3b2607b1a7ce1ef4651d66efc2e;hb=595b7ac4403cebcc30244eebc14b31e487d1da16;hp=546a7e0b908c937b604e6ee27e6df297de38b348;hpb=2b542ab21bf9f3df4e564e38e0c9db2c180449bd;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 546a7e0b..567fbcee 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -9,6 +9,8 @@ # Author: Lorenzo Berni # +import os + from BWizardPage import * import BToolchainSearch import bertos_utils @@ -68,13 +70,16 @@ class BToolchainPage(BWizardPage): def _validItem(self, index, infos): item = self.pageContent.toolchainList.item(index) - item.setIcon(QIcon(":/images/ok.png")) - item.setToolTip("Version: " + infos["version"] + "
Target: " + infos["target"] + - "
Thread model: " + infos["thread"]) + needed = self._projectInfoRetrieve("CPU_INFOS") + if infos["target"].find(unicode(needed[QString("TOOLCHAIN")].toString())) != -1: + item.setIcon(QIcon(":/images/ok.png")) + else: + item.setIcon(QIcon(":/images/warning.png")) + item.setText(infos["version"] + " " + infos["target"]) def _invalidItem(self, index): item = self.pageContent.toolchainList.item(index) - item.setIcon(QIcon(":/images/warning.png")) + item.setIcon(QIcon(":/images/error.png")) def addToolchain(self): sel_toolchain = QFileDialog.getOpenFileName(self, self.tr("Choose the toolchain"), "") @@ -102,11 +107,11 @@ class BToolchainPage(BWizardPage): def validateToolchains(self): for i in range(self.pageContent.toolchainList.count()): - filename = self.pageContent.toolchainList.item(i).text() + filename = unicode(self.pageContent.toolchainList.item(i).data(Qt.UserRole).toString()) self._validationProcess = QProcess() self._validationProcess.start(filename, ["-v"]) - self._validationProcess.waitForStarted(10) - if self._validationProcess.waitForFinished(10): + self._validationProcess.waitForStarted(1000) + if self._validationProcess.waitForFinished(200): description = str(self._validationProcess.readAllStandardError()) infos = bertos_utils.getToolchainInfo(description) if len(infos.keys()) == 4: