- def _connectSignals(self):
- self.connect(self.pageContent.pathBox, SIGNAL("clicked()"), self._updateUi)
- self.connect(self.pageContent.customDirBox, SIGNAL("clicked()"), self._updateUi)
- self.connect(self.pageContent.searchButton, SIGNAL("clicked()"), self._toSearchSubpage)
- self.connect(self.pageContent.cancelButton, SIGNAL("clicked()"), self._toSelectionSubpage)
\ No newline at end of file
+ def searchToolchain(self):
+ search = BToolchainSearch.BToolchainSearch()
+ self.connect(search, SIGNAL("accepted()"), self._search)
+ search.exec_()
+
+ def validateAllToolchains(self):
+ QApplication.instance().setOverrideCursor(Qt.WaitCursor)
+ for i in range(self.pageContent.toolchainList.count()):
+ self.validateToolchain(i)
+ QApplication.instance().restoreOverrideCursor()
+
+ def validateToolchain(self, i):
+ filename = qvariant_converter.getStringDict(self.pageContent.toolchainList.item(i).data(Qt.UserRole))["path"]
+ valid = False
+ info = {}
+ ## Check for the other tools of the toolchain
+ for tool in TOOLCHAIN_ITEMS:
+ if os.path.exists(filename.replace("gcc", tool)):
+ valid = True
+ else:
+ valid = False
+ break
+ ## Try to retrieve the informations about the toolchain only for the valid toolchains
+ if valid:
+ self._validation_process = QProcess()
+ self._validation_process.start(filename, ["-v"])
+ self._validation_process.waitForStarted(1000)
+ if self._validation_process.waitForFinished(200):
+ description = str(self._validation_process.readAllStandardError())
+ info = bertos_utils.getToolchainInfo(description)
+ if len(info.keys()) >= 4:
+ valid = True
+ else:
+ self._validation_process.kill()
+ ## Add the item in the list with the appropriate associate data.
+ if valid:
+ self._validItem(i, info)
+ else:
+ self._invalidItem(i)
+ toolchains = self.toolchains()
+ toolchains[filename] = True
+ self.setToolchains(toolchains)
+
+ def isComplete(self):
+ if self.pageContent.toolchainList.currentRow() != -1:
+ self._projectInfoStore("TOOLCHAIN",
+ qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole)))
+ return True
+ else:
+ return False
+
+ def reloadData(self):
+ self._clearList()
+ self._updateUi()
+ self._populateToolchainList()
\ No newline at end of file