- def toSearchSubpage(self):
- self.pageContent.pageSelector.setCurrentIndex(1)
-
- def toSelectionSubpage(self):
- self.pageContent.pageSelector.setCurrentIndex(0)
-
- def doSearch(self):
- path = []
- if self.pageContent.pathBox.isChecked():
- path += bertos_utils.getSystemPath()
- if self.pageContent.customDirBox.isChecked():
- for element in range(self.pageContent.customDirList.count()):
- path += [unicode(self.pageContent.customDirList.item(element).data(Qt.UserRole).toString())]
- toolchains = bertos_utils.findToolchains(path)
- toolchains_stored = self._settingsRetrieve("toolchains").toList()
- toolchains += [unicode(toolchain.toString()) for toolchain in toolchains_stored]
- toolchains = set(toolchains)
- toolchains = list(toolchains)
- self._clearList()
- for toolchain in toolchains:
- item = QListWidgetItem(toolchain)
- item.setData(Qt.UserRole, QVariant(toolchain))
- self.pageContent.toolchainList.addItem(item)
- self._settingsStore("toolchains", toolchains)
- self.toSelectionSubpage()
+ def _validItem(self, index, infos):
+ item = self.pageContent.toolchainList.item(index)
+ newData = qvariant_converter.getStringDict(self.pageContent.toolchainList.item(index).data(Qt.UserRole))
+ newData.update(infos)
+ item.setData(Qt.UserRole, qvariant_converter.convertStringDict(newData))
+ needed = self._projectInfoRetrieve("CPU_INFOS")
+ if infos["target"].find(needed["TOOLCHAIN"]) != -1:
+ item.setIcon(QIcon(":/images/ok.png"))
+ else:
+ item.setIcon(QIcon(":/images/warning.png"))
+ item.setText("GCC " + infos["version"] + " - " + infos["target"])
+
+ def _invalidItem(self, index):
+ item = self.pageContent.toolchainList.item(index)
+ item.setIcon(QIcon(":/images/error.png"))