- self.download_container = eConsoleAppContainer()
- self.nfo = ""
- self.nfofile = ""
- self.feedhtml = ""
- self.focus = None
- self.download = None
- self.box = HardwareInfo().get_device_name()
- self.feed_base = "http://www.dreamboxupdate.com/opendreambox/1.5/%s/images/" % self.box
- self.nfi_filter = "" # "release" # only show NFIs containing this string, or all if ""
-
- self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "EPGSelectActions"],
- {
- "cancel": self.closeCB,
- "red": self.closeCB,
- "green": self.nfi_download,
- "yellow": self.switchList,
- "blue": self.askCreateUSBstick,
- "prevBouquet": self.switchList,
- "nextBouquet": self.switchList,
- "ok": self.ok,
- "left": self.left,
- "right": self.right,
- "up": self.up,
- "upRepeated": self.up,
- "downRepeated": self.down,
- "down": self.down
- }, -1)
-
- self.feed_download()
-
- def downloading(self, state=True):
- if state is True:
- self["key_red"].text = _("Cancel")
- self["key_green"].text = ""
- self["key_yellow"].text = ""
- self["key_blue"].text = ""
-
- else:
- self.download = None
- self["key_red"].text = _("Exit")
- if self["feedlist"].isValid():
- self["key_green"].text = (_("Download"))
- if self.focus is self.LIST_SOURCE:
- self["key_yellow"].text = (_("Change dir."))
- else:
- self["key_yellow"].text = (_("Select image"))
- self["key_blue"].text = (_("Fix USB stick"))
-
- def switchList(self,to_where=None):
- if self.download or not self["feedlist"].isValid():
- return
-
- self["job_progressbar"].value = 0
- self["job_progresslabel"].text = ""
-
- if to_where is None:
- if self.focus is self.LIST_SOURCE:
- to_where = self.LIST_DEST
- if self.focus is self.LIST_DEST:
- to_where = self.LIST_SOURCE
-
- if to_where is self.LIST_DEST:
- self.focus = self.LIST_DEST
- self["statusbar"].text = _("Please select target directory or medium")
- self["label_top"].text = _("choose destination directory")+":"
- self["feedlist"].hide()
- self["destlist"].show()
- self["label_bottom"].text = _("Selected source image")+":"
- self["path_bottom"].text = str(self["feedlist"].getNFIname())
- self["key_yellow"].text = (_("Select image"))
-
- elif to_where is self.LIST_SOURCE:
- self.focus = self.LIST_SOURCE
- self["statusbar"].text = _("Please choose .NFI image file from feed server to download")
- self["label_top"].text = _("select image from server")+":"
- self["feedlist"].show()
- self["destlist"].hide()
- self["label_bottom"].text = _("Destination directory")+":"
- self["path_bottom"].text = str(self["destlist"].getCurrentDirectory())
- self["key_yellow"].text = (_("Change dir."))
-
- def up(self):
- if self.download:
- return
- if self.focus is self.LIST_SOURCE:
- self["feedlist"].up()
- self.nfo_download()
- if self.focus is self.LIST_DEST:
- self["destlist"].up()
-
- def down(self):
- if self.download:
- return
- if self.focus is self.LIST_SOURCE:
- self["feedlist"].down()
- self.nfo_download()
- if self.focus is self.LIST_DEST:
- self["destlist"].down()
-
- def left(self):
- if self.download:
- return
- if self.focus is self.LIST_SOURCE:
- self["feedlist"].pageUp()
- self.nfo_download()
- if self.focus is self.LIST_DEST:
- self["destlist"].pageUp()
-
- def right(self):
- if self.download:
- return
- if self.focus is self.LIST_SOURCE:
- self["feedlist"].pageDown()
- self.nfo_download()
- if self.focus is self.LIST_DEST:
- self["destlist"].pageDown()