Esempio n. 1
0
 def insertListElement(self, directory):
     """
     Inserts the given directory in the version list and returns the
     inserted item.
     """
     if bertos_utils.isBertosDir(directory):
         item = QListWidgetItem(QIcon(":/images/ok.png"), bertos_utils.bertosVersion(directory) + " (\"" + os.path.normpath(directory) + "\")")
         item.setData(Qt.UserRole, qvariant_converter.convertString(directory))
         self.pageContent.versionList.addItem(item)
         return item
     elif len(directory) > 0:
         item = QListWidgetItem(QIcon(":/images/warning.png"), "UNKNOWN" + " (\"" + os.path.normpath(directory) + "\")")
         item.setData(Qt.UserRole, qvariant_converter.convertString(directory))
         self.pageContent.versionList.addItem(item)
         return item
Esempio n. 2
0
 def setupUi(self):
     self.pageContent.presetList.clear()
     self.pageContent.categoryDescription.setText(self.preset_data["info"].get("description", ""))
     for preset in sorted(self.preset_data["children"].values(), _cmp):
         item_name = preset["info"].get("name", preset["info"]["filename"])
         item_icon = os.path.join(preset["info"]["path"], const.PREDEFINED_BOARD_ICON_FILE)
         if not os.path.exists(item_icon):
             item_icon = const.PREDEFINED_BOARD_DEFAULT_PROJECT_ICON
         item_icon = QIcon(item_icon)
         item = QListWidgetItem(item_icon, item_name)
         item.setData(Qt.UserRole, qvariant_converter.convertString(preset["info"]["path"]))
         self.pageContent.presetList.addItem(item)
     self.pageContent.presetList.setCurrentRow(0)
     self.updateUi()
Esempio n. 3
0
 def setupUi(self):
     self.pageContent.presetList.clear()
     self.pageContent.categoryDescription.setText(
         self.preset_data["info"].get("description", ""))
     for preset in sorted(self.preset_data["children"].values(), _cmp):
         item_name = preset["info"].get("name", preset["info"]["filename"])
         item_icon = os.path.join(preset["info"]["path"],
                                  const.PREDEFINED_BOARD_ICON_FILE)
         if not os.path.exists(item_icon):
             item_icon = const.PREDEFINED_BOARD_DEFAULT_PROJECT_ICON
         item_icon = QIcon(item_icon)
         item = QListWidgetItem(item_icon, item_name)
         item.setData(
             Qt.UserRole,
             qvariant_converter.convertString(preset["info"]["path"]))
         self.pageContent.presetList.addItem(item)
     self.pageContent.presetList.setCurrentRow(0)
     self.updateUi()
Esempio n. 4
0
 def setDefaultFolder(self, folder):
     """
     Stores the default save folder in the QSettings.
     """
     self.settingsStore("folder", qvariant_converter.convertString(folder))
Esempio n. 5
0
 def setDefaultFolder(self, folder):
     """
     Stores the default save folder in the QSettings.
     """
     self.settingsStore("folder", qvariant_converter.convertString(folder))