Modify the layout.
[bertos.git] / wizard / BBoardPage.py
index 160ff610186bd4a9461d33828ca121979967801c..301d46b7c36383abe30aa6a5aa50c11375d88686 100644 (file)
@@ -46,7 +46,7 @@ from BRoutePage import BRoutePage
 
 import const
 import qvariant_converter
-from bertos_utils import presetList
+from bertos_utils import presetList, _cmp
 
 class BBoardPage(BWizardPage):
     """
@@ -96,8 +96,6 @@ class BBoardPage(BWizardPage):
         """
         preset_list = self.projectInfo("PRESET_TREE")
         preset_list = preset_list["children"]
-        def _cmp(x, y):
-            return cmp(x["info"].get('ord', 0), y["info"].get('ord', 0))
         preset_list = sorted(preset_list.values(), _cmp)
         self.setItems(preset_list)
 
@@ -127,7 +125,7 @@ class BBoardPage(BWizardPage):
             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 = ":/images/default_board_icon.png"
+                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)