toolchains[toolchain] = True
sel_toolchain = self.projectInfo("TOOLCHAIN")
for key, value in toolchains.items():
- item = QListWidgetItem(key)
- item.setData(Qt.UserRole, qvariant_converter.convertStringDict({"path": key}))
- self.pageContent.toolchainList.addItem(item)
- if sel_toolchain and sel_toolchain["path"] == key:
- self.pageContent.toolchainList.setCurrentItem(item)
- if value:
- self.validateToolchain(self.pageContent.toolchainList.row(item))
+ if os.path.exists(key):
+ item = QListWidgetItem(key)
+ item.setData(Qt.UserRole, qvariant_converter.convertStringDict({"path": key}))
+ self.pageContent.toolchainList.addItem(item)
+ if sel_toolchain and sel_toolchain["path"] == key:
+ self.pageContent.toolchainList.setCurrentItem(item)
+ if value:
+ self.validateToolchain(self.pageContent.toolchainList.row(item))
+
+ def currentToolchain(self):
+ selected_toolchain = qvariant_converter.getStringDict(self.pageContent.toolchainList.currentItem().data(Qt.UserRole))
+ return selected_toolchain
def _clearList(self):
"""
self._validation_process.start(filename, ["-v"])
self._validation_process.waitForStarted(1000)
if self._validation_process.waitForFinished(200):
- description = str(self._validation_process.readAllStandardError())
+ description = unicode(self._validation_process.readAllStandardError())
info = bertos_utils.getToolchainInfo(description)
if len(info) >= 4:
valid = True
Enable the remove button.
"""
self.pageContent.removeButton.setEnabled(True)
-
\ No newline at end of file
+
+ def currentItem(self):
+ return self.pageContent.toolchainList.currentItem()