X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBToolchainPage.py;h=567fbcee11e0f3b2607b1a7ce1ef4651d66efc2e;hb=d5403b5adfbe4ef86d77498932bbf514143bb842;hp=05b90d9c2e5efef9c9660622704e4d06fcaca0b1;hpb=09d443bba27e603fed4fb6b3ffb1e0c77e4b8972;p=bertos.git diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 05b90d9c..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"), "") @@ -92,7 +97,6 @@ class BToolchainPage(BWizardPage): item = item.data(Qt.UserRole).toString() toolchains = self._settingsRetrieve("toolchains").toList() toolchains = [unicode(toolchain.toString()) for toolchain in toolchains] - print unicode(item), type(unicode(item)) toolchains.remove(unicode(item)) self._settingsStore("toolchains", toolchains) @@ -103,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: