Exemplo n.º 1
0
	def ImageList(self, imagedict):
		list = []
		mode = getCurrentImageMode() or 0
		currentimageslot = getCurrentImage()
		for x in sorted(imagedict.keys()):
			if imagedict[x]["imagename"] != _("Empty slot") and x != currentimageslot:
				list.append(ChoiceEntryComponent('', ((_("slot%s - %s ")) % (x, imagedict[x]['imagename']), x)))
		self["config"].setList(list)
Exemplo n.º 2
0
 def getImagesList(self):
     list = []
     imagesList = getImagelist()
     mode = getCurrentImageMode() or 0
     self.deletedImagesExists = False
     if imagesList:
         for index, x in enumerate(sorted(imagesList.keys())):
             if imagesList[x]["imagename"] == _("Deleted image"):
                 self.deletedImagesExists = True
             elif imagesList[x]["imagename"] != _("Empty slot"):
                 if SystemInfo["canMode12"]:
                     list.insert(
                         index,
                         ChoiceEntryComponent(
                             '',
                             ((_("slot%s - %s mode 1 (current image)")
                               if x == self.currentimageslot and mode != 12
                               else _("slot%s - %s mode 1")) %
                              (x, imagesList[x]['imagename']), (x, 1))))
                     list.append(
                         ChoiceEntryComponent(
                             '',
                             ((_("slot%s - %s mode 12 (current image)")
                               if x == self.currentimageslot and mode == 12
                               else _("slot%s - %s mode 12")) %
                              (x, imagesList[x]['imagename']), (x, 12))))
                 else:
                     list.append(
                         ChoiceEntryComponent(
                             '', ((_("slot%s - %s (current image)")
                                   if x == self.currentimageslot
                                   and mode != 12 else _("slot%s - %s")) %
                                  (x, imagesList[x]['imagename']), (x, 1))))
     if os.path.isfile(os.path.join(self.tmp_dir, "STARTUP_RECOVERY")):
         list.append(
             ChoiceEntryComponent(
                 '', ((_("Boot to Recovery menu")), "Recovery")))
     if os.path.isfile(os.path.join(self.tmp_dir, "STARTUP_ANDROID")):
         list.append(
             ChoiceEntryComponent(
                 '', ((_("Boot to Android image")), "Android")))
     if not list:
         list.append(
             ChoiceEntryComponent('', ((_("No images found")), "Waiter")))
     self["list"].setList(list)
     self.selectionChanged()