def _processItems(self, item_list, procedure=lambda x: None): sel_toolchain = self.projectInfo("TOOLCHAIN") for item_data in item_list: item = QListWidgetItem(item_data["path"]) item.setData(Qt.UserRole, qvariant_converter.convertStringDict(item_data)) self.pageContent.toolchainList.addItem(item) procedure(item) if sel_toolchain and sel_toolchain["path"] == item_data["path"]: self.pageContent.toolchainList.setCurrentItem(item)
def addToolchain(self): """ Slot called when the user adds manually a toolchain. """ sel_toolchain = unicode(QFileDialog.getOpenFileName(self, self.tr("Choose the toolchain"), "")) if sel_toolchain != "": item = QListWidgetItem(sel_toolchain) item.setData(Qt.UserRole, qvariant_converter.convertStringDict({"path": sel_toolchain})) self.pageContent.toolchainList.addItem(item) self._toolchain_manager.addToolchain(sel_toolchain)