コード例 #1
0
 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)
コード例 #2
0
ファイル: BBoardPage.py プロジェクト: aurelien-rainone/bertos
 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)
コード例 #3
0
 def populateCpuList(self):
     """
     Fills the cpu list.
     """
     self.pageContent.cpuList.clear()
     self.pageContent.cpuList.setCurrentItem(None)
     infos = self.project.getCpuInfos()
     tag_list = bertos_utils.getTagSet(infos)
     # Create, fill and store the dict with the tags
     tag_dict = {}
     for element in tag_list:
         tag_dict[element] = False
     self.setProjectInfo("ALL_CPU_TAGS", tag_dict)
     for cpu in infos:
         item = QListWidgetItem(cpu["CPU_NAME"])
         item.setData(Qt.UserRole, qvariant_converter.convertDict(cpu))
         self.pageContent.cpuList.addItem(item)
コード例 #4
0
ファイル: BCpuPage.py プロジェクト: insha/bertos
 def populateCpuList(self):
     """
     Fills the cpu list.
     """
     self.pageContent.cpuList.clear()
     self.pageContent.cpuList.setCurrentItem(None)
     infos = self.project.getCpuInfos()
     tag_list = bertos_utils.getTagSet(infos)
     # Create, fill and store the dict with the tags
     tag_dict = {}
     for element in tag_list:
         tag_dict[element] = False
     self.setProjectInfo("ALL_CPU_TAGS", tag_dict)
     for cpu in infos:
         item = QListWidgetItem(cpu["CPU_NAME"])
         item.setData(Qt.UserRole, qvariant_converter.convertDict(cpu))
         self.pageContent.cpuList.addItem(item)