+ def setItems(self, preset_list):
+ self.pageContent.boardList.clear()
+ selected_board = self.projectInfo("PROJECT_BOARD")
+ for item_data in preset_list:
+ item_name = item_data["info"].get("name", item_data["info"]["filename"])
+ item_icon = os.path.join(item_data["info"]["path"], const.PREDEFINED_BOARD_ICON_FILE)
+ if not os.path.exists(item_icon):
+ item_icon = const.PREDEFINED_BOARD_DEFAULT_ICON
+ item = QListWidgetItem(QIcon(item_icon), item_name)
+ item.setData(Qt.UserRole, qvariant_converter.convertDict(item_data))
+ self.pageContent.boardList.addItem(item)
+ if selected_board and selected_board == item_data["info"]["path"]:
+ self.pageContent.boardList.setCurrentItem(item)
+
+ @property
+ def selected(self):
+ return self.pageContent.boardList.currentItem()