Esempio n. 1
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("About"))
		hddsplit = skin.parameters.get("AboutHddSplit", 0)

		AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
		cpu = about.getCPUInfoString()
		AboutText += _("CPU: ") + cpu + "\n"
		AboutText += _("Image: ") + about.getImageTypeString() + "\n"
		AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
		AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"
		if SystemInfo["canMultiBoot"]:
			slot = image = getCurrentImage()
			bootmode = ""
			part = _("eMMC slot %s") %slot
			if "sda" in SystemInfo["canMultiBoot"][slot]['device']:
				if slot > 4:
					image -=4
				else:
					image -=1
				if getMachineBuild() in ("sf8008"):
					part = _("SD-card slot %s") % image
				else:
					part = _("USB-device slot %s") % image
			AboutText += _("Selected Image: %s") % _("STARTUP_") + str(slot) + "  (" + part + ")\n"

		# [WanWizard] Removed until we find a reliable way to determine the installation date
		# AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

		EnigmaVersion = about.getEnigmaVersionString()
		EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
		if len(EnigmaVersion) == 3:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[2] + "-" + EnigmaVersion[1] + ")"
		else:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
		EnigmaVersion = _("Enigma version: ") + EnigmaVersion
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		AboutText += "\n" + EnigmaVersion + "\n"

		AboutText += _("Kernel version: ") + about.getKernelVersionString() + "\n"

		AboutText += _("DVB driver version: ") + about.getDriverInstalledDate() + "\n"

		GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString(cpu).replace("GStreamer","")
		self["GStreamerVersion"] = StaticText(GStreamerVersion)
		AboutText += GStreamerVersion + "\n"

		AboutText += _("Python version: ") + about.getPythonVersionString() + "\n"

		AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value
		AboutText += _("Enigma debug level: %d\n") % eGetEnigmaDebugLvl()

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %s") % fp_version
			AboutText += fp_version + "\n"

		self["FPVersion"] = StaticText(fp_version)
		
		skinWidth = getDesktop(0).size().width()
		skinHeight = getDesktop(0).size().height()
		AboutText += _("Skin Name: %s") % config.skin.primary_skin.value[0:-9] + _("  (%s x %s)") % (skinWidth, skinHeight) + "\n"

		if path.exists('/etc/enigma2/EtRcType'):
			rfp = open('/etc/enigma2/EtRcType', "r")
			Remote = rfp.read()
			rfp.close
			AboutText += _("Remote control type") + _(": ") + Remote + "\n"
		else:
			AboutText += _("Remote control type") + _(": ") + iRcTypeControl.getBoxType() + "\n"

		if path.exists('/proc/stb/ir/rc/type'):
			fp = open('/proc/stb/ir/rc/type', "r")
			RcID = fp.read()
			fp.close
			AboutText += _("Remote control ID") + _(": ") + RcID

		AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (config.skin.primary_skin.value.split('/')[0], getDesktop(0).size().width(), getDesktop(0).size().height())

		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		AboutText += "\n" + _("Detected NIMs:") + "\n"

		nims = nimmanager.nimListCompressed()
		for count in range(len(nims)):
			if count < 4:
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")
			AboutText += nims[count] + "\n"

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		AboutText += "\n" + _("Detected HDD:") + "\n"

		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free()/1024.0, "G", _("free"))
				else:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		AboutText += hddinfo + "\n\n" + _("Network Info:")
		for x in about.GetIPsFromNetworkInterfaces():
			AboutText += "\n" + x[0] + ": " + x[1]
		AboutText += '\n\n' + _("Uptime") + ": " + about.getBoxUptime()

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
		self["key_green"] = Button(_("Troubleshoot"))
		self["key_red"] = Button(_("Latest Commits"))
		self["key_yellow"] = Button(_("Memory Info"))
		self["key_blue"] = Button(_("%s ") % getMachineName() + _("picture"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions", "ChannelSelectEPGActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"info": self.showTranslationInfo,
				"red": self.showCommits,
				"green": self.showTroubleshoot,
				"yellow": self.showMemoryInfo,
				"blue": self.showModelPic,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Esempio n. 2
0
 def __init__(self, session, autotimer, partnerbox):
     AutoTimerOverview.__init__(self, session, autotimer)
     self.partnerbox = partnerbox
     self["key_red"] = StaticText("")
     self["key_green"] = StaticText(_("Save"))
Esempio n. 3
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent=parent)
     self["entry"] = StaticText("")
     self["desc"] = StaticText("")
     self.onShow.append(self.addWatcher)
     self.onHide.append(self.removeWatcher)
Esempio n. 4
0
    def __init__(self, session, filelist, index, path):

        self.textcolor = config.pic.textcolor.value
        self.bgcolor = config.pic.bgcolor.value
        space = config.pic.framesize.value

        self.size_w = size_w = getDesktop(0).size().width()
        self.size_h = size_h = getDesktop(0).size().height()

        if config.usage.pic_resolution.value and (size_w, size_h) != eval(
                config.usage.pic_resolution.value):
            (size_w, size_h) = eval(config.usage.pic_resolution.value)
            gMainDC.getInstance().setResolution(size_w, size_h)
            getDesktop(0).resize(eSize(size_w, size_h))

        self.skin = "<screen position=\"0,0\" size=\"" + str(
            size_w
        ) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \
			<eLabel position=\"0,0\" zPosition=\"0\" size=\"" + str(size_w) + "," + str(
            size_h
        ) + "\" backgroundColor=\"" + self.bgcolor + "\" /><widget name=\"pic\" position=\"" + str(
            space) + "," + str(space) + "\" size=\"" + str(
                size_w - (space * 2)) + "," + str(
                    size_h - (space * 2)
                ) + "\" zPosition=\"1\" alphatest=\"on\" /> \
			<widget name=\"point\" position=\"" + str(space + 5) + "," + str(
                    space + 2
                ) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"icons/record.png\" alphatest=\"on\" /> \
			<widget name=\"play_icon\" position=\"" + str(space + 25) + "," + str(
                    space + 2
                ) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"icons/ico_mp_play.png\"  alphatest=\"on\" /> \
			<widget source=\"file\" render=\"Label\" position=\"" + str(
                    space + 45
                ) + "," + str(space) + "\" size=\"" + str(
                    size_w - (space * 2) - 50
                ) + ",25\" font=\"Regular;20\" borderWidth=\"1\" borderColor=\"#000000\" halign=\"left\" foregroundColor=\"" + self.textcolor + "\" zPosition=\"2\" noWrap=\"1\" transparent=\"1\" /></screen>"

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "MovieSelectionActions"
            ], {
                "cancel": self.Exit,
                "green": self.PlayPause,
                "yellow": self.PlayPause,
                "blue": self.nextPic,
                "red": self.prevPic,
                "left": self.prevPic,
                "right": self.nextPic,
                "showEventInfo": self.StartExif,
                "contextMenu": self.KeyMenu,
            }, -1)

        self["point"] = Pixmap()
        self["pic"] = Pixmap()
        self["play_icon"] = Pixmap()
        self["file"] = StaticText(_("please wait, loading picture..."))

        self.old_index = 0
        self.filelist = []
        self.lastindex = index
        self.currPic = []
        self.shownow = True
        self.dirlistcount = 0

        for x in filelist:
            if len(filelist[0]) == 3:  #orig. filelist
                if x[0][1] == False:
                    self.filelist.append(path + x[0][0])
                else:
                    self.dirlistcount += 1
            elif len(filelist[0]) == 2:  #scanlist
                if x[0][1] == False:
                    self.filelist.append(x[0][0])
                else:
                    self.dirlistcount += 1
            else:  # thumbnaillist
                self.filelist.append(x[T_FULL])

        self.maxentry = len(self.filelist) - 1
        self.index = index - self.dirlistcount
        if self.index < 0:
            self.index = 0

        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.finish_decode)

        self.slideTimer = eTimer()
        self.slideTimer.callback.append(self.slidePic)

        if self.maxentry >= 0:
            self.onLayoutFinish.append(self.setPicloadConf)
Esempio n. 5
0
 def __init__(self, session, text):
     Screen.__init__(self, session)
     self["text"] = StaticText(text)
Esempio n. 6
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        Screen.setTitle(self, _("Fan Control"))

        templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
        tempcount = len(templist)
        fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
        fancount = len(fanlist)

        self["key_red"] = self["red"] = StaticText(_("Cancel"))
        self["key_green"] = self["green"] = StaticText(_("OK"))

        for count in range(8):
            if count < tempcount:
                id = templist[count]
                if getBrandOEM() not in ('dags', 'vuplus'):
                    self["SensorTempText%d" % count] = StaticText(
                        sensors.getSensorName(id))
                    self["SensorTemp%d" % count] = SensorSource(sensorid=id)
                elif getBrandOEM() in ('dags', 'vuplus') and id < 1:
                    self["SensorTempText%d" % count] = StaticText(
                        sensors.getSensorName(id))
                    self["SensorTemp%d" % count] = SensorSource(sensorid=id)
                else:
                    self["SensorTempText%d" % count] = StaticText("")
                    self["SensorTemp%d" % count] = SensorSource()
            else:
                self["SensorTempText%d" % count] = StaticText("")
                self["SensorTemp%d" % count] = SensorSource()

            if count < fancount:
                id = fanlist[count]
                self["SensorFanText%d" % count] = StaticText(
                    sensors.getSensorName(id))
                self["SensorFan%d" % count] = SensorSource(sensorid=id)
            else:
                self["SensorFanText%d" % count] = StaticText("")
                self["SensorFan%d" % count] = SensorSource()

        self.list = []
        for count in range(fancontrol.getFanCount()):
            if getBrandOEM() not in ('dags', 'vuplus'):
                self.list.append(
                    getConfigListEntry(
                        _("Fan %d voltage") % (count + 1),
                        fancontrol.getConfig(count).vlt))
            self.list.append(
                getConfigListEntry(
                    _("Fan %d PWM") % (count + 1),
                    fancontrol.getConfig(count).pwm))
            if getBrandOEM() not in ('dags', 'vuplus'):
                self.list.append(
                    getConfigListEntry(
                        _("Standby fan %d voltage") % (count + 1),
                        fancontrol.getConfig(count).vlt_standby))
            self.list.append(
                getConfigListEntry(
                    _("Standby fan %d PWM") % (count + 1),
                    fancontrol.getConfig(count).pwm_standby))

        ConfigListScreen.__init__(self, self.list, session=self.session)
        #self["config"].list = self.list
        #self["config"].setList(self.list)
        self["config"].l.setSeperation(300)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "MenuActions"], {
                "ok": self.save,
                "cancel": self.revert,
                "red": self.revert,
                "green": self.save,
                "menu": self.closeRecursive,
            }, -1)
Esempio n. 7
0
    def __init__(self,
                 session,
                 libraryName,
                 loadLibrary,
                 playEntry,
                 viewName,
                 select=None,
                 sort=None,
                 filter=None):
        '''
		'''
        printl("", self, "S")

        DP_View.__init__(self, session, libraryName, loadLibrary, playEntry,
                         viewName, select, sort, filter)

        self.EXpicloadPoster3__ = ePicLoad()
        self.EXpicloadPoster2__ = ePicLoad()
        self.EXpicloadPoster1__ = ePicLoad()
        self.EXpicloadPoster_0_ = ePicLoad()
        self.EXpicloadPoster__1 = ePicLoad()
        self.EXpicloadPoster__2 = ePicLoad()
        self.EXpicloadPoster__3 = ePicLoad()

        self.EXscale = (AVSwitch().getFramebufferScale())

        self["poster3__"] = Pixmap()
        self["poster2__"] = Pixmap()
        self["poster1__"] = Pixmap()
        self["poster_0_"] = Pixmap()
        self["poster__1"] = Pixmap()
        self["poster__2"] = Pixmap()
        self["poster__3"] = Pixmap()

        self["title"] = Label()

        self["shortDescriptionContainer"] = Label()
        self["shortDescription"] = Label()

        self["key_red"] = StaticText(_("Sort: ") + _("Default"))
        self["key_green"] = StaticText("")
        self["key_yellow"] = StaticText("")
        self["key_blue"] = StaticText(self.viewName[0])

        self.skinName = self.viewName[2]

        self.EXpicloadPoster3__.PictureData.get().append(
            self.DecodeActionPoster3__)
        self.EXpicloadPoster2__.PictureData.get().append(
            self.DecodeActionPoster2__)
        self.EXpicloadPoster1__.PictureData.get().append(
            self.DecodeActionPoster1__)
        self.EXpicloadPoster_0_.PictureData.get().append(
            self.DecodeActionPoster_0_)
        self.EXpicloadPoster__1.PictureData.get().append(
            self.DecodeActionPoster__1)
        self.EXpicloadPoster__2.PictureData.get().append(
            self.DecodeActionPoster__2)
        self.EXpicloadPoster__3.PictureData.get().append(
            self.DecodeActionPoster__3)

        printl("", self, "C")
Esempio n. 8
0
    def __init__(self,
                 session,
                 slotid,
                 action,
                 handler=eDVBCI_UI.getInstance(),
                 wait_text="",
                 screen_data=None):
        Screen.__init__(self, session)

        print "[CI] MMIDialog with action" + str(action)

        self.mmiclosed = False
        self.tag = None
        self.slotid = slotid

        self.timer = eTimer()
        self.timer.callback.append(self.keyCancel)

        #else the skins fails
        self["title"] = Label("")
        self["subtitle"] = Label("")
        self["bottom"] = Label("")
        self["key_menu"] = StaticText(_("MENU"))
        self["entries"] = ConfigList([])

        self["actions"] = NumberActionMap(
            ["SetupActions", "MenuActions"],
            {
                "ok": self.okbuttonClick,
                "cancel": self.keyCancel,
                "menu": self.forceExit,
                #for PIN
                "left": self.keyLeft,
                "right": self.keyRight,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            },
            -1)

        self.action = action
        self.screen_data = screen_data

        self.is_pin_list = -1
        self.handler = handler
        if wait_text == "":
            self.wait_text = _("wait for ci...")
        else:
            self.wait_text = wait_text

        if action == 2:  #start MMI
            handler.startMMI(self.slotid)
            self.showWait()
        elif action == 3:  #mmi already there (called from infobar)
            self.showScreen()
Esempio n. 9
0
	def populate(self):
		if isVTISkin:
			self["EnigmaVersion"] = StaticText(_("Version") + ": " + about.getEnigmaVersionString())
			self["ImageVersion"] = StaticText(_("Image") + ": " + about.getImageVersionString())

			self["TunerHeader"] = StaticText(_("Detected NIMs:"))

			fp_version = getFPVersion()
			if fp_version is None:
				fp_version = ""
			else:
				fp_version = _("Frontprocessor version: %d") % fp_version

			self["FPVersion"] = StaticText(fp_version)

			nims = nimmanager.nimList()
			self.tuner_list = []
			if len(nims) <= 4 :
				for count in (0, 1, 2, 3, 4, 5, 6, 7):
					if count < len(nims):
						self["Tuner" + str(count)] = StaticText(nims[count])
						self.tuner_list.append((nims[count] + "\n"))
					else:
						self["Tuner" + str(count)] = StaticText("")
			else:
				desc_list = []
				count = 0
				cur_idx = -1
				while count < len(nims):
					data = nims[count].split(":")
					idx = data[0].strip('Tuner').strip()
					desc = data[1].strip()
					if desc_list and desc_list[cur_idx]['desc'] == desc:
						desc_list[cur_idx]['end'] = idx
					else:
						desc_list.append({'desc' : desc, 'start' : idx, 'end' : idx})
						cur_idx += 1
					count += 1

				for count in (0, 1, 2, 3, 4, 5, 6, 7):
					if count < len(desc_list):
						if desc_list[count]['start'] == desc_list[count]['end']:
							text = "Tuner %s: %s" % (desc_list[count]['start'], desc_list[count]['desc'])
						else:
							text = "Tuner %s-%s: %s" % (desc_list[count]['start'], desc_list[count]['end'], desc_list[count]['desc'])
					else:
						text = ""

					self["Tuner" + str(count)] = StaticText(text)
					if text != "":
						self.tuner_list.append(text + "\n")

			self["HDDHeader"] = StaticText(_("Detected HDD:"))
			hddlist = harddiskmanager.HDDList()
			hdd = hddlist and hddlist[0][1] or None
			if hdd is not None and hdd.model() != "":
				self["hddA"] = StaticText(_("%s\n(%s, %d MB free)") % (hdd.model(), hdd.capacity(),hdd.free()))
			else:
				self["hddA"] = StaticText(_("none"))


			self.enigma2_version = _("Version") + ": " + about.getEnigmaVersionString()
			self.image_version = _("Image") + ": " + about.getImageVersionString()
			cpu_info = parseLines("/proc/cpuinfo")
			cpu_name = "N/A"
			for line in cpu_info:
				if line.find('model') != -1:
					cpu_name = line.split(':')
					if len(cpu_name) >= 2:
						cpu_name = cpu_name[1].strip()
					break

			self.cpu = _("CPU") + ": " + cpu_name
			self.chipset = _("Chipset") + ": " + parseFile("/proc/stb/info/chipset")
			self.tuner_header = _("Detected NIMs:")
			self.hdd_header = _("Detected HDD:")
			self.hdd_list = []
			if len(hddlist):
				for hddX in hddlist:
					hdd = hddX[1]
					if hdd.model() != "":
						self.hdd_list.append((hdd.model() + "\n   %.2f GB - %.2f GB" % (hdd.diskSize()/1000.0, hdd.free()/1000.0) + " " + _("free") + "\n\n"))

			ifaces = iNetwork.getConfiguredAdapters()
			iface_list = []
			for iface in ifaces:
				iface_list.append((_("Interface") + " : " + iNetwork.getAdapterName(iface) + " ("+ iNetwork.getFriendlyAdapterName(iface) + ")\n"))
				iface_list.append((_("IP") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "ip")) + "\n"))
				iface_list.append((_("Netmask") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "netmask")) + "\n"))
				iface_list.append((_("Gateway") + " : " + parse_ipv4(iNetwork.getAdapterAttribute(iface, "gateway")) + "\n"))
				if iNetwork.getAdapterAttribute(iface, "dhcp"):
					iface_list.append((_("DHCP") + " : " + _("Yes") + "\n"))
				else:
					iface_list.append((_("DHCP") + " : " + _("No") + "\n"))
				iface_list.append((_("MAC") + " : " + iNetwork.getAdapterAttribute(iface, "mac") + "\n"))
				iface_list.append(("\n"))

			my_txt = self.enigma2_version + "\n"
			my_txt += self.image_version + "\n"
			my_txt += "\n"
			my_txt += self.cpu + "\n"
			my_txt += self.chipset + "\n"
			my_txt += "\n"
			my_txt += self.tuner_header + "\n"
			for x in self.tuner_list:
				my_txt += "   " + x
			my_txt += "\n"
			my_txt += _("Network") + ":\n"
			for x in iface_list:
				my_txt += "   " + x
			my_txt += self.hdd_header + "\n"
			for x in self.hdd_list:
				my_txt += "   " + x
			my_txt += "\n"

			self["FullAbout"] = ScrollLabel(my_txt)
		else:
			self["lab1"] = StaticText(_("openATV"))
			self["lab2"] = StaticText(_("By openATV Image Team"))
			self["lab3"] = StaticText(_("Support at") + " www.opena.tv")
			model = None
			AboutText = getAboutText()[0]
			self["AboutScrollLabel"] = ScrollLabel(AboutText)
Esempio n. 10
0
    def __init__(self, session, args=None):
        Screen.__init__(self, session)

        templist = sensors.getSensorsList(sensors.TYPE_TEMPERATURE)
        tempcount = len(templist)
        fanlist = sensors.getSensorsList(sensors.TYPE_FAN_RPM)
        fancount = len(fanlist)

        self["red"] = StaticText(_("Cancel"))
        self["green"] = StaticText(_("OK"))
        self["yellow"] = StaticText("")
        self["blue"] = StaticText("")

        for count in range(8):
            if count < tempcount:
                id = templist[count]
                self["SensorTempText%d" % count] = StaticText(
                    sensors.getSensorName(id))
                self["SensorTemp%d" % count] = SensorSource(sensorid=id)
            else:
                self["SensorTempText%d" % count] = StaticText("")
                self["SensorTemp%d" % count] = SensorSource()

            if count < fancount:
                id = fanlist[count]
                self["SensorFanText%d" % count] = StaticText(
                    sensors.getSensorName(id))
                self["SensorFan%d" % count] = SensorSource(sensorid=id)
            else:
                self["SensorFanText%d" % count] = StaticText("")
                self["SensorFan%d" % count] = SensorSource()

        self.list = []
        for count in range(fancontrol.getFanCount()):
            self.list.append(
                getConfigListEntry(
                    _("Fan %d Voltage") % (count + 1),
                    fancontrol.getConfig(count).vlt))
            self.list.append(
                getConfigListEntry(
                    _("Fan %d PWM") % (count + 1),
                    fancontrol.getConfig(count).pwm))
            self.list.append(
                getConfigListEntry(
                    _("Standby Fan %d Voltage") % (count + 1),
                    fancontrol.getConfig(count).vlt_standby))
            self.list.append(
                getConfigListEntry(
                    _("Standby Fan %d PWM") % (count + 1),
                    fancontrol.getConfig(count).pwm_standby))

        ConfigListScreen.__init__(self, self.list, session=self.session)
        #self["config"].list = self.list
        #self["config"].setList(self.list)
        self["config"].l.setSeperation(300)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "ok": self.save,
                "cancel": self.revert,
                "red": self.revert,
                "green": self.save
            }, -1)
Esempio n. 11
0
    def __init__(self, session, title="", **kwargs):
        Screen.__init__(self, session)
        self.setTitle(_(title))
        self.keys_list = []
        self.shiftkeys_list = []
        self.lang = language.getLanguage()
        self.nextLang = None
        self.shiftMode = False
        self.selectedKey = 0
        self.smsChar = None
        self.sms = NumericalTextInput(self.smsOK)

        self.key_bg = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_bg.png"))
        self.key_sel = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_sel.png"))
        self.key_backspace = LoadPixmap(path=resolveFilename(
            SCOPE_ACTIVE_SKIN, "buttons/vkey_backspace.png"))
        self.key_all = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_all.png"))
        self.key_clr = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_clr.png"))
        self.key_esc = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_esc.png"))
        self.key_ok = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_ok.png"))
        self.key_shift = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_shift.png"))
        self.key_shift_sel = LoadPixmap(path=resolveFilename(
            SCOPE_ACTIVE_SKIN, "buttons/vkey_shift_sel.png"))
        self.key_space = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_space.png"))
        self.key_left = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_left.png"))
        self.key_right = LoadPixmap(
            path=resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/vkey_right.png"))

        self.keyImages = {
            "BACKSPACE": self.key_backspace,
            "ALL": self.key_all,
            "EXIT": self.key_esc,
            "OK": self.key_ok,
            "SHIFT": self.key_shift,
            "SPACE": self.key_space,
            "LEFT": self.key_left,
            "RIGHT": self.key_right
        }
        self.keyImagesShift = {
            "BACKSPACE": self.key_backspace,
            "CLEAR": self.key_clr,
            "EXIT": self.key_esc,
            "OK": self.key_ok,
            "SHIFT": self.key_shift_sel,
            "SPACE": self.key_space,
            "LEFT": self.key_left,
            "RIGHT": self.key_right
        }

        self["country"] = StaticText("")
        self["header"] = Label()
        self["text"] = Input(currPos=len(
            kwargs.get("text", "").decode("utf-8", 'ignore')),
                             allMarked=False,
                             **kwargs)
        self["list"] = VirtualKeyBoardList([])

        self["actions"] = NumberActionMap(
            [
                "OkCancelActions", "WizardActions", "ColorActions",
                "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"
            ], {
                "gotAsciiCode": self.keyGotAscii,
                "ok": self.okClicked,
                "OKLong": self.okLongClicked,
                "cancel": self.exit,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.exit,
                "green": self.ok,
                "yellow": self.switchLang,
                "blue": self.shiftClicked,
                "deleteBackward": self.backClicked,
                "deleteForward": self.forwardClicked,
                "back": self.exit,
                "pageUp": self.cursorRight,
                "pageDown": self.cursorLeft,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal,
            }, -2)
        self.setLang()
        self.onExecBegin.append(self.setKeyboardModeAscii)
        self.onLayoutFinish.append(self.buildVirtualKeyBoard)
        self.onClose.append(self.__onClose)
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setup_title = _("Configuration save / load EPG")
        self.onChangedEntry = []
        self.prev_lastepgcachepath = config.misc.epgcache_filename.value
        self.current_epgpath = config.plugins.epgrefresh_extra.epgcachepath.value
        hddchoises = []
        if self.current_epgpath != '/etc/enigma2/':
            hddchoises = [('/etc/enigma2/', '/etc/enigma2/')]
        for p in harddiskmanager.getMountedPartitions():
            if os.path.exists(p.mountpoint) and os.access(
                    p.mountpoint, os.F_OK | os.R_OK):
                if p.mountpoint != '/':
                    d = os.path.normpath(p.mountpoint)
                    hddchoises.append((d + '/', p.mountpoint + '/'))
        if self.current_epgpath and self.current_epgpath != '/' and (
                self.current_epgpath, self.current_epgpath) in hddchoises:
            #hddchoises.append((self.current_epgpath, self.current_epgpath))
            default_epg = self.current_epgpath
        else:
            default_epg = None
        config.plugins.epgrefresh_extra.add_epgcachepath = NoSave(
            ConfigSelection(default=default_epg, choices=hddchoises))
        self.list = [
            getConfigListEntry(_("Manual save EPG"),
                               config.plugins.epgrefresh_extra.manual_save,
                               _("Manual saving EPG in current cachefile.")),
            getConfigListEntry(
                _("Manual load EPG"),
                config.plugins.epgrefresh_extra.manual_load,
                _("Manual loading EPG from current cachefile.")),
            getConfigListEntry(
                _("Manual reload EPG"),
                config.plugins.epgrefresh_extra.manual_reload,
                _("Manual saving and loading EPG from current cachefile.")),
            getConfigListEntry(
                _("Manual restore EPG backup"),
                config.plugins.epgrefresh_extra.restore_backup,
                _("Manual restore EPG from backup cachefile and loading.")),
            getConfigListEntry(
                _("Automatic save EPG"),
                config.plugins.epgrefresh_extra.cachesavesched,
                _("Automatic saving EPG in current cachefile after a specified time."
                  )),
            getConfigListEntry(_("Save every (in hours)"),
                               config.plugins.epgrefresh_extra.cachesavetimer,
                               _("Do not set too short period of time.")),
            getConfigListEntry(
                _("Automatic load EPG"),
                config.plugins.epgrefresh_extra.cacheloadsched,
                _("Automatic loading EPG from current cachefile after a specified time."
                  )),
            getConfigListEntry(
                _("Load every (in hours)"),
                config.plugins.epgrefresh_extra.cacheloadtimer,
                _("This option is not recommended to be used only in exceptional cases. Do not set too short period of time."
                  )),
            getConfigListEntry(
                _("EPG cache path"),
                config.plugins.epgrefresh_extra.add_epgcachepath,
                _("Select the path to EPG cache,not recommended to use the internal flash."
                  )),
            getConfigListEntry(
                _("EPG cache filename"),
                config.plugins.epgrefresh_extra.epgcachefilename,
                _("Select the file name EPG cache, if you do not like credit default name."
                  )),
            getConfigListEntry(
                _("Create backup when saving EPG"),
                config.plugins.epgrefresh_extra.save_backup,
                _("Create backup cachefile, after manual or automatic saving EPG."
                  )),
            getConfigListEntry(
                _("Auto restore EPG backup on boot"),
                config.plugins.epgrefresh_extra.autorestore_backup,
                _("Auto restore EPG from backup cachefile and loading on boot."
                  )),
            getConfigListEntry(_("Show manual change EPG in main menu"),
                               config.plugins.epgrefresh_extra.main_menu,
                               _("Changes are needed to restart enigma2.")),
            getConfigListEntry(
                _("Show download exUSSR EPG in list setup"),
                config.plugins.epgrefresh_extra.add_ruepg,
                _("If you want to download from the internet russian ERG, put to yes."
                  )),
            getConfigListEntry(
                _("Show \"AutoZap\" in extension menu"),
                config.plugins.epgrefresh_extra.show_autozap,
                _("Automatic switching of all the services in the current channel list after a specified time. Stop switch can only manually."
                  )),
            getConfigListEntry(
                _("Duration to stay on service (sec) for \"AutoZap\" "),
                config.plugins.epgrefresh_extra.timeout_autozap,
                _("This is the duration each service/channel will stay active during a refresh."
                  )),
        ]
        if config.plugins.epgrefresh_extra.add_ruepg:
            self.list.insert(
                3,
                getConfigListEntry(
                    _("Download internet EPG from exUSSR"),
                    config.plugins.epgrefresh_extra.load_ruepg,
                    _("Press OK to download EPG with http://linux-sat.tv.")))

        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=session,
                                  on_change=self.changed)

        def selectionChanged():
            if self["config"].current:
                self["config"].current[1].onDeselect(self.session)
            self["config"].current = self["config"].getCurrent()
            if self["config"].current:
                self["config"].current[1].onSelect(self.session)
            for x in self["config"].onSelectionChanged:
                x()

        self["config"].selectionChanged = selectionChanged
        self["config"].onSelectionChanged.append(self.updateHelp)
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))
        self["epgcachelocation"] = StaticText()
        self["help"] = StaticText()
        self["actions"] = ActionMap(["SetupActions", "ColorActions"], {
            "cancel": self.keyCancel,
            "save": self.keySave,
            "ok": self.keyOK,
        })
        self.updateDestination()
        self.changed()
        self.onLayoutFinish.append(self.setCustomTitle)
Esempio n. 13
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("About"))
		hddsplit = skin.parameters.get("AboutHddSplit", 0)

		AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
		AboutText += _("CPU: ") + about.getCPUInfoString() + "\n"
		AboutText += _("Image: ") + about.getImageTypeString() + "\n"
		AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
		AboutText += _("Last upgrade: ") + about.getUpdateDateString() + "\n"

		# [WanWizard] Removed until we find a reliable way to determine the installation date
		# AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

		EnigmaVersion = about.getEnigmaVersionString()
		EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
		if len(EnigmaVersion) == 3:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[2] + "-" + EnigmaVersion[1] + ")"
		else:
			EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
		EnigmaVersion = _("Enigma version: ") + EnigmaVersion
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		AboutText += "\n" + EnigmaVersion + "\n"

		AboutText += _("Kernel version: ") + about.getKernelVersionString() + "\n"

		AboutText += _("DVB driver version: ") + about.getDriverInstalledDate() + "\n"

		GStreamerVersion = _("GStreamer version: ") + about.getGStreamerVersionString().replace("GStreamer","")
		self["GStreamerVersion"] = StaticText(GStreamerVersion)
		AboutText += GStreamerVersion + "\n"

		AboutText += _("Python version: ") + about.getPythonVersionString() + "\n"

		AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %s") % fp_version
			AboutText += fp_version + "\n"

		self["FPVersion"] = StaticText(fp_version)

		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		AboutText += "\n" + _("Detected NIMs:") + "\n"

		nims = nimmanager.nimListCompressed()
		for count in range(len(nims)):
			if count < 4:
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")
			AboutText += nims[count] + "\n"

		self["HDDHeader"] = StaticText(_("Detected HDD:"))
		AboutText += "\n" + _("Detected HDD:") + "\n"

		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free()/1024.0, "G", _("free"))
				else:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		AboutText += hddinfo + "\n\n" + _("Network Info:")
		for x in about.GetIPsFromNetworkInterfaces():
			AboutText += "\n" + x[0] + ": " + x[1]

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
		self["key_green"] = Button(_("Translations"))
		self["key_red"] = Button(_("Latest Commits"))
		self["key_yellow"] = Button(_("Troubleshoot"))
		self["key_blue"] = Button(_("Memory Info"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"red": self.showCommits,
				"green": self.showTranslationInfo,
				"blue": self.showMemoryInfo,
				"yellow": self.showTroubleshoot,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
	def __init__(self, session):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.list = []
		# Summary
		self.setup_title = _("EPGRefresh Configuration")
		self.onChangedEntry = []
		
		self.session = session
		
		# Although EPGRefresh keeps services in a Set we prefer a list
		self.services = (
			[x for x in epgrefresh.services[0]],
			[x for x in epgrefresh.services[1]]
		)

		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
		self._getConfig()

		self["config"].onSelectionChanged.append(self.updateHelp)

		# Initialize Buttons
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["key_yellow"] = StaticText(_("Functions"))
		self["key_blue"] = StaticText(_("Edit Services"))

		self["help"] = StaticText()

		# Define Actions
		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
				"yellow": (self.showFunctionMenu, _("Show more Functions")),
				"blue": (self.editServices, _("Edit Services")),
			}
		)
		self["actions"] = HelpableActionMap(self, "ChannelSelectEPGActions",
			{
				"showEPGList": (self.keyInfo, _("Show last EPGRefresh - Time")),
			}
		)
		self["ChannelSelectBaseActions"] = HelpableActionMap(self, "ChannelSelectBaseActions",
			{
				"nextBouquet": (self.pageup, _("Move page up")),
				"prevBouquet": (self.pagedown, _("Move page down")),
			}
		)
		self["actionstmp"] = ActionMap(["HelpActions"],
			{
				"displayHelp": self.showHelp,
			}
		)
		self["SetupActions"] = HelpableActionMap(self, "SetupActions",
			{
				"cancel": (self.keyCancel, _("Close and forget changes")),
				"save": (self.keySave, _("Close and save changes")),
			}
		)
		
		# Trigger change
		self.changed()
		self.needsEnigmaRestart = False
		self.ServicesChanged = False
		
		self.onLayoutFinish.append(self.setCustomTitle)
		self.onFirstExecBegin.append(self.firstExec)
		self["config"].isChanged = self._ConfigisChanged
Esempio n. 15
0
    def __init__(self, session, text):
        self.showsource = CfgPlTr.showsource.getValue()
        if self.showsource == "yes":
            size = MySD.tMyes
        else:
            size = MySD.tMno

        self.dict = {'size': size, 'plug_loc': plugin_location}
        self.skin = applySkinVars(MySD.translatorMain_skin, self.dict)
        self.session = session
        Screen.__init__(self, session)
        if self.showsource != "yes":
            self.skinName = ["translatorMainSingle", "translatorMain"]

        self.text = text
        self.hideflag = True
        self.refresh = False
        self.max = 1
        self.count = 0
        self.list = []
        self.eventName = ''

        self['flag'] = Pixmap()
        self['flag2'] = Pixmap()
        self['timing'] = Label('')
        self['text'] = ScrollLabel('')
        self['text2'] = ScrollLabel('')
        self['label'] = Label('= Hide')
        self['label2'] = Label('= Clear cache')

        # Add the helptext for the default destination now
        lang = CfgPlTr.destination.getValue()
        if lang not in self.helptext:
            self.helptext[lang] = DO_translation(self.helptext['en'], 'en',
                                                 lang)

        AMbindings = {
            'ok': self.get_text,
            'cancel': self.exit,
            'down': self.down,
            'up': self.up,
            'yellow': self.clear_cache,
            'red': self.getEPG,
            'green': self.showHelp,
            'blue': self.hideScreen,
            'contextMenu': self.config,
            'bluelong': self.showHelp,
            'showEventInfo': self.showHelp
        }
        # We need to know whether we are playing a recording as, if so, we do
        # NOT want to activate the service-changing keys, nor programme text
        # changes.
        # We also don't need to set-up a ServiceEventTracker for a recording, as
        # the even can't occur.
        # The playback state is also needed for getEPG(), so save it.
        # Do NOT use:
        #   self.session.nav.getCurrentlyPlayingServiceOrGroup().isPlayback()
        # as that isPlayback() is Vix-specific. So just replicate the code here.
        #
        self.inPlayBack = "0:0:0:0:0:0:0:0:0" in self.My_Sref(
        ).toCompareString()

        # Add the channel name.
        wintitle = 'EPG Translator'
        try:
            cur_serv = self.My_Sref().getServiceName()
            wintitle += " - " + cur_serv
        except:
            pass
        self.setTitle(wintitle)

        if not self.inPlayBack:  # We can add in service-change keys
            AMbindings.update({
                'right': self.rightDown,
                'left': self.leftUp,
                'nextBouquet': self.zapDown,
                'prevBouquet': self.zapUp
            })
            # Also add the event tracker for changing service for not-in-Playback
            # This means we can call getEPG() *after* the service changes, even
            # if there may be a user prompt related to timeshift.
            #
            self.__event_tracker = ServiceEventTracker(
                screen=self,
                eventmap={iPlayableService.evTunedIn: self.__serviceTuned})

        self['actions'] = ActionMap([
            'OkCancelActions', 'DirectionActions', 'ChannelSelectBaseActions',
            'ColorActions', 'MovieSelectionActions', 'HelpActions'
        ], AMbindings, -1)
        self.onLayoutFinish.append(self.onLayoutFinished)

        self["key_red"] = StaticText(_("Refresh EPG"))
        self["key_green"] = StaticText(_("Info"))
        self["key_yellow"] = StaticText(_("Clear cache"))
        self["key_blue"] = StaticText(_("Hide"))
        self["key_menu"] = StaticText(_("MENU"))
        self["key_ok"] = StaticText(_("Translate text"))
Esempio n. 16
0
	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Network Information"))
		self.skinName = ["SystemNetworkInfo", "WlanStatus"]
		self["LabelBSSID"] = StaticText()
		self["LabelESSID"] = StaticText()
		self["LabelQuality"] = StaticText()
		self["LabelSignal"] = StaticText()
		self["LabelBitrate"] = StaticText()
		self["LabelEnc"] = StaticText()
		self["BSSID"] = StaticText()
		self["ESSID"] = StaticText()
		self["quality"] = StaticText()
		self["signal"] = StaticText()
		self["bitrate"] = StaticText()
		self["enc"] = StaticText()

		self["IFtext"] = StaticText()
		self["IF"] = StaticText()
		self["Statustext"] = StaticText()
		self["statuspic"] = MultiPixmap()
		self["statuspic"].setPixmapNum(1)
		self["statuspic"].show()

		self.iface = None
		self.createscreen()
		self.iStatus = None

		if iNetwork.isWirelessInterface(self.iface):
			try:
				from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus
				self.iStatus = iStatus
			except:
				pass
			self.resetList()
			self.onClose.append(self.cleanup)
		self.updateStatusbar()

		self["key_red"] = StaticText(_("Close"))

		self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Esempio n. 17
0
File: About.py Progetto: OpenVu/mybh
    def __init__(self, session):
        Screen.__init__(self, session)

        bhVer = "Black Hole"
        f = open("/etc/bhversion", 'r')
        bhVer = f.readline().strip()
        f.close()

        bhRev = ""
        f = open("/etc/bhrev", 'r')
        bhRev = f.readline().strip()
        f.close()

        self["EnigmaVersion"] = StaticText("Firmware: " + bhVer + " " + bhRev)

        self["ImageVersion"] = StaticText("Build: " +
                                          about.getEnigmaVersionString())
        driverdate = self.getDriverInstalledDate()
        if driverdate == "unknown":
            driverdate = self.getDriverInstalledDate_proxy()
        self["DriverVersion"] = StaticText(_("DVB drivers: ") + driverdate)
        self["KernelVersion"] = StaticText(
            _("Kernel version: ") + self.getKernelVersionString())

        self["FPVersion"] = StaticText("Team Homesite: vuplus-community.net")

        self["CpuInfo"] = StaticText(_("CPU: ") + self.getCPUInfoString())
        self["TunerHeader"] = StaticText(_("Detected NIMs:"))

        nims = nimmanager.nimList()
        if len(nims) <= 4:
            for count in (0, 1, 2, 3):
                if count < len(nims):
                    self["Tuner" + str(count)] = StaticText(nims[count])
                else:
                    self["Tuner" + str(count)] = StaticText("")
        else:
            desc_list = []
            count = 0
            cur_idx = -1
            while count < len(nims):
                data = nims[count].split(":")
                idx = data[0].strip('Tuner').strip()
                desc = data[1].strip()
                if desc_list and desc_list[cur_idx]['desc'] == desc:
                    desc_list[cur_idx]['end'] = idx
                else:
                    desc_list.append({'desc': desc, 'start': idx, 'end': idx})
                    cur_idx += 1
                count += 1

            for count in (0, 1, 2, 3):
                if count < len(desc_list):
                    if desc_list[count]['start'] == desc_list[count]['end']:
                        text = "Tuner %s: %s" % (desc_list[count]['start'],
                                                 desc_list[count]['desc'])
                    else:
                        text = "Tuner %s-%s: %s" % (desc_list[count]['start'],
                                                    desc_list[count]['end'],
                                                    desc_list[count]['desc'])
                else:
                    text = ""

                self["Tuner" + str(count)] = StaticText(text)

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        hddlist = harddiskmanager.HDDList()
        hdd = hddlist and hddlist[0][1] or None
        if hdd is not None and hdd.model() != "":
            self["hddA"] = StaticText(
                _("%s\n(%s, %d MB free)") %
                (hdd.model(), hdd.capacity(), hdd.free()))
        else:
            self["hddA"] = StaticText(_("none"))

        self["actions"] = ActionMap(["SetupActions", "ColorActions"], {
            "cancel": self.close,
            "ok": self.close,
        })
Esempio n. 18
0
    def __init__(self,
                 session,
                 menumode,
                 mselection,
                 mlist,
                 service,
                 selections,
                 currentPath,
                 playlist=False):
        Screen.__init__(self, session)
        self.mode = menumode
        self.mselection = mselection
        self.mlist = mlist
        self.service = service
        self.selections = selections
        self.currentPath = currentPath
        self.plist = playlist
        self.reloadafterclose = False

        self.menu = []
        if menumode == "normal":
            self["title"] = StaticText(_("Choose operation"))

            if os.path.realpath(self.currentPath) != os.path.realpath(
                    config.EMC.movie_homepath.value):
                self.menu.append(
                    (_("Movie home"), boundFunction(self.close, "Movie home")))

            if currentPath == config.EMC.movie_pathlimit.value:
                self.menu.append(
                    (_("Directory up"), boundFunction(self.close, "dirup")))

            self.menu.append((_("Reload current directory"),
                              boundFunction(self.close, "reloadwithoutcache")))

            self.menu.append(
                (_("Playlist Options"), boundFunction(self.close,
                                                      "emcPlaylist")))
            if service is not None:
                ext = os.path.splitext(service.getPath())[1].lower()
                if ext in extMedia:
                    self.menu.append((_("Add to current Playlist"),
                                      boundFunction(self.close,
                                                    "addPlaylist")))

            self.menu.append(
                (_("Play last"), boundFunction(self.close, "Play last")))

            self.menu.append(
                (_("Play All"), boundFunction(self.close, "playall")))
            self.menu.append(
                (_("Shuffle All"), boundFunction(self.close, "shuffleall")))

            self.menu.append(
                (_("Cover search"), boundFunction(self.close, "imdb")))
            if service is not None:
                path = service.getPath()
                if os.path.isdir(
                        path
                ) and not path == config.EMC.movie_trashcan_path.value and not path.endswith(
                        os.sep + '..'):
                    self.menu.append((_("Directory-Cover search"),
                                      boundFunction(self.close,
                                                    "imdbdirectory")))
            if self.selections:
                self.menu.append((_("Delete"),
                                  boundFunction(self.close, "del",
                                                self.selections)))
            else:
                self.menu.append(
                    (_("Delete"), boundFunction(self.close, "del")))

            if config.EMC.movie_trashcan_enable.value and os.path.exists(
                    config.EMC.movie_trashcan_path.value):
                if service is not None:
                    if self.selections:
                        self.menu.append(
                            (_("Delete permanently"),
                             boundFunction(self.close, "delete",
                                           self.selections)))
                    else:
                        self.menu.append((_("Delete permanently"),
                                          boundFunction(self.close, "delete")))
                self.menu.append(
                    (_("Empty trashcan"), boundFunction(self.emptyTrash)))
                self.menu.append(
                    (_("Go to trashcan"), boundFunction(self.close, "trash")))

            self.menu.append(
                (_("Mark all movies"), boundFunction(self.close, "markall")))
            self.menu.append(
                (_("Remove rogue files"), boundFunction(self.remRogueFiles)))

            self.menu.append(
                (_("Delete cut file(s)"), boundFunction(self.deleteCutFileQ)))

            self.menu.append(
                (_("Create link"), boundFunction(self.createLink,
                                                 currentPath)))
            self.menu.append((_("Create directory"),
                              boundFunction(self.createDir, currentPath)))

            self.menu.append((_("(Un-)Lock Directory"),
                              boundFunction(self.lockDir, currentPath)))

            if service is not None:
                if os.path.isfile(service.getPath()):
                    # can we use it for both ?
                    # selections comes also with one file !!! so we can it use.
                    if self.selections:
                        self.menu.append(
                            (_("Copy Files"),
                             boundFunction(self.close, "Copy Movie",
                                           self.selections)))
                        self.menu.append(
                            (_("Move Files"),
                             boundFunction(self.close, "Move Movie",
                                           self.selections)))
                    else:
                        self.menu.append(
                            (_("Copy File"),
                             boundFunction(self.close, "Copy Movie")))
                        self.menu.append(
                            (_("Move File"),
                             boundFunction(self.close, "Move Movie")))
                    #self.menu.append((_("Download Movie Information"), boundFunction(self.close, "Movie Information")))
                if service.getPath() != config.EMC.movie_trashcan_path.value:
                    if not service.getPath().endswith(
                            "/..") and not service.getPath().endswith(
                                "/Latest Recordings"):
                        self.menu.append(
                            (_("Download Movie Information"),
                             boundFunction(self.close, "Movie Information")))
                        #self.menu.append((_("Download Movie Cover"), boundFunction(self.close, "dlcover")))

            if self.service is not None or self.selections:
                self.menu.append((_("Rename selected movie(s)"),
                                  boundFunction(self.renameMovies)))
                self.menu.append((_("Remove cut list marker"),
                                  boundFunction(self.remCutListMarker)))
                self.menu.append((_("Reset marker from selected movie(s)"),
                                  boundFunction(self.resMarker)))
                show_plugins = True
                if self.selections:
                    for service in self.selections:
                        ext = os.path.splitext(service.getPath())[1].lower()
                        if ext not in extTS:
                            show_plugins = False
                            break
                else:
                    ext = os.path.splitext(self.service.getPath())[1].lower()
                    if ext not in extTS:
                        show_plugins = False
                if show_plugins:
                    # Only valid for ts files: CutListEditor, DVDBurn, ...
                    self.menu.extend([(p.description,
                                       boundFunction(self.execPlugin, p))
                                      for p in plugins.getPlugins(
                                          PluginDescriptor.WHERE_MOVIELIST)])

            self.menu.append((_("Open E2 Bookmark path"),
                              boundFunction(self.close, "openE2Bookmarks")))
            if not self.isE2Bookmark(currentPath):
                self.menu.append((_("Add directory to E2 Bookmarks"),
                                  boundFunction(self.addDirToE2Bookmarks,
                                                currentPath)))
            else:
                self.menu.append((_("Remove directory from E2 Bookmarks"),
                                  boundFunction(self.removeDirFromE2Bookmarks,
                                                currentPath)))
            if service is not None:
                if self.isE2Bookmark(service.getPath()):
                    self.menu.append(
                        (_("Remove selected E2 Bookmark"),
                         boundFunction(self.close, "removeE2Bookmark",
                                       service)))

            self.menu.append((_("Open EMC Bookmark path"),
                              boundFunction(self.close, "openEMCBookmarks")))
            if not self.isEMCBookmark(currentPath):
                self.menu.append((_("Add directory to EMC Bookmarks"),
                                  boundFunction(self.addDirToEMCBookmarks,
                                                currentPath)))
            else:
                self.menu.append((_("Remove directory from EMC Bookmarks"),
                                  boundFunction(self.removeDirFromEMCBookmarks,
                                                currentPath)))
            if service is not None:
                if self.isEMCBookmark(service.getPath()):
                    self.menu.append(
                        (_("Remove selected EMC Bookmark"),
                         boundFunction(self.close, "removeEMCBookmark",
                                       service)))

            self.menu.append((_("Set permanent sort"),
                              boundFunction(self.setPermanentSort, currentPath,
                                            mlist.actualSort)))
            if mlist.hasFolderPermanentSort(currentPath):
                self.menu.append((_("Remove permanent sort"),
                                  boundFunction(self.removePermanentSort,
                                                currentPath)))
            else:
                path = mlist.hasParentPermanentSort(currentPath)
                if path:
                    self.menu.append((_("Remove permanent sort from parent"),
                                      boundFunction(self.removePermanentSort,
                                                    path)))

            #self.menu.append((_("Open shell script menu"), boundFunction(self.close, "oscripts")))
            self.menu.append(
                (_("EMC Setup"), boundFunction(self.execPlugin, emcsetup)))

        elif menumode == "plugins":
            self["title"] = StaticText(_("Choose plugin"))
            if self.service is not None:
                for p in plugins.getPlugins(PluginDescriptor.WHERE_MOVIELIST):
                    self.menu.append(
                        (p.description, boundFunction(self.execPlugin, p)))

        elif menumode == "emcBookmarks":
            self["title"] = StaticText(_("Choose bookmark"))
            bm = self.getEMCBookmarks()
            if bm:
                for line in bm:
                    self.menu.append((line, boundFunction(self.close, line)))

        elif menumode == "emcPlaylist":
            self["title"] = StaticText(_("Playlist Options"))
            self.menu.append((_("Show current Playlist"),
                              boundFunction(self.close, "showPlaylist")))
            if service is not None:
                ext = os.path.splitext(service.getPath())[1].lower()
                if ext in extMedia:
                    self.menu.append((_("Add to current Playlist"),
                                      boundFunction(self.close,
                                                    "addPlaylist")))
            if self.plist:
                self.menu.append((_("Play current Playlist"),
                                  boundFunction(self.close, "playPlaylist")))
                self.menu.append((_("Play random current Playlist"),
                                  boundFunction(self.close,
                                                "playPlaylistRandom")))
                self.menu.append((_("Delete current Playlist"),
                                  boundFunction(self.close, "delPlaylist")))
            self.menu.append(
                (_("Playlist Setup"), boundFunction(self.close,
                                                    "setupPlaylist")))

        self["menu"] = List(self.menu)
        self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {
            "ok": self.okButton,
            "cancel": self.close,
            "red": self.redButton,
        })
        self.onShow.append(self.onDialogShow)
Esempio n. 19
0
    def __init__(self,
                 session,
                 job,
                 parent=None,
                 cancelable=True,
                 backgroundable=True,
                 afterEventChangeable=True,
                 afterEvent="nothing"):
        from Components.Sources.StaticText import StaticText
        from Components.Sources.Progress import Progress
        from Components.Sources.Boolean import Boolean
        from Components.ActionMap import ActionMap
        Screen.__init__(self, session, parent)
        Screen.setTitle(self, _("Job View"))
        InfoBarNotifications.__init__(self)
        ConfigListScreen.__init__(self, [])
        self.parent = parent
        self.job = job
        if afterEvent:
            self.job.afterEvent = afterEvent

        self["job_name"] = StaticText(job.name)
        self["job_progress"] = Progress()
        self["job_task"] = StaticText()
        self["summary_job_name"] = StaticText(job.name)
        self["summary_job_progress"] = Progress()
        self["summary_job_task"] = StaticText()
        self["job_status"] = StaticText()
        self["finished"] = Boolean()
        self["cancelable"] = Boolean(cancelable)
        self["backgroundable"] = Boolean(backgroundable)

        self["key_blue"] = StaticText(_("Background"))

        self.onShow.append(self.windowShow)
        self.onHide.append(self.windowHide)

        self["setupActions"] = ActionMap(
            ["ColorActions", "SetupActions"], {
                "green": self.ok,
                "red": self.abort,
                "blue": self.background,
                "cancel": self.ok,
                "ok": self.ok,
            }, -2)

        self.settings = ConfigSubsection()
        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.settings.afterEvent = ConfigSelection(choices=[
            ("nothing", _("do nothing")), ("close", _("Close")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString)
        ],
                                                   default=self.job.afterEvent
                                                   or "nothing")
        self.job.afterEvent = self.settings.afterEvent.value
        self.afterEventChangeable = afterEventChangeable
        self.setupList()
        self.state_changed()
Esempio n. 20
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent=parent)
     self["message"] = StaticText("")
     self.parent.onText.append(self.onText)
Esempio n. 21
0
    def __init__(self, session, piclist, lastindex, path):

        self.textcolor = config.pic.textcolor.value
        self.color = config.pic.bgcolor.value
        self.spaceX, self.picX, self.spaceY, self.picY, textsize, thumtxt = skin.parameters.get(
            "PicturePlayerThumb", (35, 190, 30, 200, 20, 14))

        pic_frame = resolveFilename(SCOPE_CURRENT_SKIN, "icons/pic_frame.png")

        size_w = getDesktop(0).size().width()
        size_h = getDesktop(0).size().height()
        self.thumbsX = size_w / (self.spaceX + self.picX)  # thumbnails in X
        self.thumbsY = size_h / (self.spaceY + self.picY)  # thumbnails in Y
        self.thumbsC = self.thumbsX * self.thumbsY  # all thumbnails

        self.positionlist = []
        skincontent = ""

        posX = -1
        for x in range(self.thumbsC):
            posY = x / self.thumbsX
            posX += 1
            if posX >= self.thumbsX:
                posX = 0

            absX = self.spaceX + (posX * (self.spaceX + self.picX))
            absY = self.spaceY + (posY * (self.spaceY + self.picY))
            self.positionlist.append((absX, absY))
            skincontent += "<widget source=\"label" + str(x) + "\" render=\"Label\" position=\"" + str(absX+5) + "," + str(absY+self.picY-textsize) + "\" size=\"" + str(self.picX - 10) + ","  + str(textsize) \
              + "\" font=\"Regular;" + str(thumtxt) + "\" zPosition=\"2\" transparent=\"1\" noWrap=\"1\" foregroundColor=\"" + self.textcolor + "\" />"
            skincontent += "<widget name=\"thumb" + str(
                x) + "\" position=\"" + str(absX + 5) + "," + str(
                    absY + 5
                ) + "\" size=\"" + str(self.picX - 10) + "," + str(
                    self.picY - (textsize * 2)
                ) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />"

        # Screen, backgroundlabel and MovingPixmap
        self.skin = "<screen position=\"0,0\" size=\"" + str(size_w) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \
			<eLabel position=\"0,0\" zPosition=\"0\" size=\""                                                          + str(size_w) + "," + str(size_h) + "\" backgroundColor=\"" + self.color + "\" />" \
         + "<widget name=\"frame\" position=\"" + str(self.spaceX)+ "," + str(self.spaceY)+ "\" size=\"" + str(self.picX) + "," + str(self.picY) + "\" pixmap=\"" + pic_frame + "\" zPosition=\"1\" alphatest=\"on\" />" \
         + skincontent + "</screen>"

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "MovieSelectionActions"
            ], {
                "cancel": self.Exit,
                "ok": self.KeyOk,
                "left": self.key_left,
                "right": self.key_right,
                "up": self.key_up,
                "down": self.key_down,
                "showEventInfo": self.StartExif,
            }, -1)

        self["frame"] = MovingPixmap()
        for x in range(self.thumbsC):
            self["label" + str(x)] = StaticText()
            self["thumb" + str(x)] = Pixmap()

        self.Thumbnaillist = []
        self.filelist = []
        self.currPage = -1
        self.dirlistcount = 0
        self.path = path

        index = 0
        framePos = 0
        Page = 0
        for x in piclist:
            if x[0][1] == False:
                self.filelist.append(
                    (index, framePos, Page, x[0][0], path + x[0][0]))
                index += 1
                framePos += 1
                if framePos > (self.thumbsC - 1):
                    framePos = 0
                    Page += 1
            else:
                self.dirlistcount += 1

        self.maxentry = len(self.filelist) - 1
        self.index = lastindex - self.dirlistcount
        if self.index < 0:
            self.index = 0

        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.showPic)

        self.onLayoutFinish.append(self.setPicloadConf)

        self.ThumbTimer = eTimer()
        self.ThumbTimer.callback.append(self.showPic)
Esempio n. 22
0
    def __init__(self,
                 session,
                 showSteps=True,
                 showStepSlider=True,
                 showList=True,
                 showConfig=True,
                 showMulticontentList=False):
        Screen.__init__(self, session)

        self.isLastWizard = False  # can be used to skip a "goodbye"-screen in a wizard

        self.stepHistory = []
        self.__nextStepAnimation = Wizard.NEXT_STEP_ANIMATION_KEY
        self.__previousStepAnimation = Wizard.PREVIOUS_STEP_ANIMATION_KEY

        self.wizard = {}
        parser = make_parser()
        if not isinstance(self.xmlfile, list):
            self.xmlfile = [self.xmlfile]
        print "Reading ", self.xmlfile
        wizardHandler = self.parseWizard(self.wizard, self)
        parser.setContentHandler(wizardHandler)
        for xmlfile in self.xmlfile:
            if xmlfile[0] != '/':
                parser.parse(eEnv.resolve('${datadir}/enigma2/') + xmlfile)
            else:
                parser.parse(xmlfile)

        self.showSteps = showSteps
        self.showStepSlider = showStepSlider
        self.showList = showList
        self.showConfig = showConfig
        self.showMulticontentList = showMulticontentList

        self.numSteps = len(self.wizard)
        self.currStep = self.getStepWithID("start") + 1

        self.timeoutTimer = eTimer()
        self.timeoutTimer_conn = self.timeoutTimer.timeout.connect(
            self.timeoutCounterFired)

        self["text"] = Label()

        if showConfig:
            self["config"] = ConfigList([], session=session)
        self["configEntry"] = StaticText("")
        self["configValue"] = StaticText("")

        if self.showSteps:
            self["step"] = Label()

        if self.showStepSlider:
            self["stepslider"] = Slider(1, self.numSteps)

        if self.showMulticontentList:
            self.multicontentlist = []
            self["multicontentlist"] = List(self.multicontentlist)
            self["multicontentlist"].onSelectionChanged.append(self.selChanged)

        if self.showList:
            self.list = []
            self["list"] = List(self.list, enableWrapAround=True)
            self["list"].onSelectionChanged.append(self.selChanged)
            #self["list"] = MenuList(self.list, enableWrapAround = True)

        self.onShown.append(self.updateValues)
        self.onShow.append(self._setTitle)

        self.configInstance = None
        self.currentConfigIndex = None

        self.lcdCallbacks = []

        self.disableKeys = False

        self["actions"] = NumberActionMap(
            [
                "WizardActions", "NumberActions", "ColorActions",
                "SetupActions", "InputAsciiActions", "KeyboardInputActions"
            ], {
                "gotAsciiCode": self.keyGotAscii,
                "ok": self.ok,
                "back": self.back,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.red,
                "green": self.green,
                "yellow": self.yellow,
                "blue": self.blue,
                "deleteBackward": self.deleteBackward,
                "deleteForward": self.deleteForward,
                "video": self.setNoAnimations,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1)

        self.__title = None

        self["VirtualKB"] = NumberActionMap(
            ["VirtualKeyboardActions"], {
                "showVirtualKeyboard": self.KeyText,
            }, -2)

        self["VirtualKB"].setEnabled(False)

        self.onHideFinished.append(self.__hideFinished)
        self.onFirstExecBegin.append(self._initAnimation)
	def __init__(self, session, parent):
		Screen.__init__(self, session, parent = parent)
		self["Name"] = StaticText("")
		if hasattr(self.parent,"onChangedEntry"):
			self.onShow.append(self.addWatcher)
			self.onHide.append(self.removeWatcher)
    def __init__(self, session):
        Screen.__init__(self, session)

        # Summary
        self.setup_title = _("AutoTimer Settings")
        self.onChangedEntry = []

        ConfigListScreen.__init__(self, [
            getConfigListEntry(
                _("Poll automatically"), config.plugins.autotimer.autopoll,
                _("Unless this is enabled AutoTimer will NOT automatically look for events matching your AutoTimers but only when you leave the GUI with the green button."
                  )),
            getConfigListEntry(
                _("Poll Interval (in h)"), config.plugins.autotimer.interval,
                _("This is the delay in hours that the AutoTimer will wait after a search to search the EPG again."
                  )),
            getConfigListEntry(
                _("Only add timer for next x days"),
                config.plugins.autotimer.maxdaysinfuture,
                _("You can control for how many days in the future timers are added. Set this to 0 to disable this feature."
                  )),
            getConfigListEntry(
                _("Show in extension menu"),
                config.plugins.autotimer.show_in_extensionsmenu,
                _("Enable this to be able to access the AutoTimer Overview from within the extension menu."
                  )),
            getConfigListEntry(
                _("Show in event menu"),
                config.plugins.autotimer.show_in_furtheroptionsmenu,
                _("Enable this to add item for create the AutoTimer into event menu (needs restart GUI)."
                  )),
            getConfigListEntry(
                _("Modify existing timers"), config.plugins.autotimer.refresh,
                _("This setting controls the behavior when a timer matches a found event."
                  )),
            getConfigListEntry(
                _("Guess existing timer based on begin/end"),
                config.plugins.autotimer.try_guessing,
                _("If this is enabled an existing timer will also be considered recording an event if it records at least 80%% of the it."
                  )),
            getConfigListEntry(
                _("Add similar timer on conflict"),
                config.plugins.autotimer.addsimilar_on_conflict,
                _("If a timer conflict occurs, AutoTimer will search outside the timespan for a similar event and add it."
                  )),
            getConfigListEntry(
                _("Add timer as disabled on conflict"),
                config.plugins.autotimer.disabled_on_conflict,
                _("This toggles the behavior on timer conflicts. If an AutoTimer matches an event that conflicts with an existing timer it will not ignore this event but add it disabled."
                  )),
            getConfigListEntry(
                _("Show notification on conflicts"),
                config.plugins.autotimer.notifconflict,
                _("By enabling this you will be notified about timer conflicts found during automated polling. There is no intelligence involved, so it might bother you about the same conflict over and over."
                  )),
            getConfigListEntry(
                _("Show notification on similars"),
                config.plugins.autotimer.notifsimilar,
                _("By enabling this you will be notified about similar timers added during automated polling. There is no intelligence involved, so it might bother you about the same conflict over and over."
                  )),
            getConfigListEntry(
                _("Editor for new AutoTimers"),
                config.plugins.autotimer.editor,
                _("The editor to be used for new AutoTimers. This can either be the Wizard or the classic editor."
                  )),
            getConfigListEntry(
                _("Support \"Fast Scan\"?"), config.plugins.autotimer.fastscan,
                _("When supporting \"Fast Scan\" the service type is ignored. You don't need to enable this unless your Image supports \"Fast Scan\" and you are using it."
                  )),
        ],
                                  session=session,
                                  on_change=self.changed)

        def selectionChanged():
            if self["config"].current:
                self["config"].current[1].onDeselect(self.session)
            self["config"].current = self["config"].getCurrent()
            if self["config"].current:
                self["config"].current[1].onSelect(self.session)
            for x in self["config"].onSelectionChanged:
                x()

        self["config"].selectionChanged = selectionChanged
        self["config"].onSelectionChanged.append(self.updateHelp)

        # Initialize widgets
        self["key_green"] = StaticText(_("OK"))
        self["key_red"] = StaticText(_("Cancel"))
        self["help"] = StaticText()

        # Define Actions
        self["actions"] = ActionMap(["SetupActions"], {
            "cancel": self.keyCancel,
            "save": self.keySave,
        })

        # Trigger change
        self.changed()

        self.onLayoutFinish.append(self.setCustomTitle)
Esempio n. 25
0
    def __init__(self, session, iface):
        Screen.__init__(self, session)
        self.session = session
        self.iface = iface

        self["LabelBSSID"] = StaticText(_('Accesspoint:'))
        self["LabelESSID"] = StaticText(_('SSID:'))
        self["LabelQuality"] = StaticText(_('Link Quality:'))
        self["LabelSignal"] = StaticText(_('Signal Strength:'))
        self["LabelBitrate"] = StaticText(_('Bitrate:'))
        self["LabelEnc"] = StaticText(_('Encryption:'))

        self["BSSID"] = StaticText()
        self["ESSID"] = StaticText()
        self["quality"] = StaticText()
        self["signal"] = StaticText()
        self["bitrate"] = StaticText()
        self["enc"] = StaticText()

        self["IFtext"] = StaticText()
        self["IF"] = StaticText()
        self["Statustext"] = StaticText()
        self["statuspic"] = MultiPixmap()
        self["statuspic"].hide()
        self["key_red"] = StaticText(_("Close"))

        self.resetList()
        self.updateStatusbar()

        self["actions"] = NumberActionMap([
            "WizardActions", "InputActions", "EPGSelectActions",
            "ShortcutActions"
        ], {
            "ok": self.exit,
            "back": self.exit,
            "red": self.exit,
        }, -1)
        self.timer = eTimer()
        self.timer.timeout.get().append(self.resetList)
        self.onShown.append(lambda: self.timer.start(5000))
        self.onLayoutFinish.append(self.layoutFinished)
        self.onClose.append(self.cleanup)
Esempio n. 26
0
    def __init__(self, session):
        Screen.__init__(self, session)

        # Summary
        self.setup_title = _("AutoTimer Settings")
        self.onChangedEntry = []

        ConfigListScreen.__init__(
            self,
            [
                getConfigListEntry(
                    _("Poll automatically"), config.plugins.autotimer.autopoll,
                    _("Unless this is enabled AutoTimer will NOT automatically look for events matching your AutoTimers but only when you leave the GUI with the green button."
                      )),
                getConfigListEntry(
                    _("Startup delay (in min)"),
                    config.plugins.autotimer.delay,
                    _("This is the delay in minutes that the AutoTimer will wait on initial launch to not delay enigma2 startup time."
                      )),
                getConfigListEntry(
                    _("Delay after editing (in sec)"),
                    config.plugins.autotimer.editdelay,
                    _("This is the delay in seconds that the AutoTimer will wait after editing the AutoTimers."
                      )),
                getConfigListEntry(
                    _("Poll Interval (in h)"),
                    config.plugins.autotimer.interval,
                    _("This is the delay in hours that the AutoTimer will wait after a search to search the EPG again."
                      )),
                getConfigListEntry(
                    _("Timeout (in min)"), config.plugins.autotimer.timeout,
                    _("This is the duration in minutes that the AutoTimer is allowed to run."
                      )),
                getConfigListEntry(
                    _("Only add timer for next x days"),
                    config.plugins.autotimer.maxdaysinfuture,
                    _("You can control for how many days in the future timers are added. Set this to 0 to disable this feature."
                      )),
                getConfigListEntry(
                    _("Show in extension menu"),
                    config.plugins.autotimer.show_in_extensionsmenu,
                    _("Enable this to be able to access the AutoTimer Overview from within the extension menu."
                      )),
                getConfigListEntry(
                    _("Modify existing timers"),
                    config.plugins.autotimer.refresh,
                    _("This setting controls the behavior when a timer matches a found event."
                      )),
                # TRANSLATORS: the double-percent is intentional and required, please don't make me hunt you down individually
                getConfigListEntry(
                    _("Guess existing timer based on begin/end"),
                    config.plugins.autotimer.try_guessing,
                    _("If this is enabled an existing timer will also be considered recording an event if it records at least 80%% of it."
                      )),
                getConfigListEntry(
                    _("Add similar timer on conflict"),
                    config.plugins.autotimer.addsimilar_on_conflict,
                    _("If a timer conflict occurs, AutoTimer will search outside the timespan for a similar event and add it."
                      )),
                getConfigListEntry(
                    _("Add timer as disabled on conflict"),
                    config.plugins.autotimer.disabled_on_conflict,
                    _("This toggles the behavior on timer conflicts. If an AutoTimer matches an event that conflicts with an existing timer it will not ignore this event but add it disabled."
                      )),
                getConfigListEntry(
                    _("Include \"AutoTimer\" in tags"),
                    config.plugins.autotimer.add_autotimer_to_tags,
                    _("If this is selected, the tag \"AutoTimer\" will be given to timers created by this plugin."
                      )),
                getConfigListEntry(
                    _("Include AutoTimer name in tags"),
                    config.plugins.autotimer.add_name_to_tags,
                    _("If this is selected, the name of the respective AutoTimer will be added as a tag to timers created by this plugin."
                      )),
                getConfigListEntry(
                    _("Show notification on conflicts"),
                    config.plugins.autotimer.notifconflict,
                    _("By enabling this you will be notified about timer conflicts found during automated polling. There is no intelligence involved, so it might bother you about the same conflict over and over."
                      )),
                getConfigListEntry(
                    _("Show notification on similars"),
                    config.plugins.autotimer.notifsimilar,
                    _("By enabling this you will be notified about similar timers added during automated polling. There is no intelligence involved, so it might bother you about the same conflict over and over."
                      )),
                getConfigListEntry(
                    _("Editor for new AutoTimers"),
                    config.plugins.autotimer.editor,
                    _("The editor to be used for new AutoTimers. This can either be the Wizard or the classic editor."
                      )),
                getConfigListEntry(
                    _("Support \"Fast Scan\"?"),
                    config.plugins.autotimer.fastscan,
                    _("When supporting \"Fast Scan\" the service type is ignored. You don't need to enable this unless your Image supports \"Fast Scan\" and you are using it."
                      )),
                getConfigListEntry(
                    _("Skip poll during records"),
                    config.plugins.autotimer.skip_during_records,
                    _("If enabled, the polling will be skipped if the Dreambox is recording."
                      )),
                getConfigListEntry(
                    _("Skip poll during epg refresh"),
                    config.plugins.autotimer.skip_during_epgrefresh,
                    _("If enabled, the polling will be skipped if EPGRefres is currently running."
                      )),
                getConfigListEntry(_("Popup timeout in seconds"),
                                   config.plugins.autotimer.popup_timeout,
                                   _("If 0, the popup will remain open.")),
                getConfigListEntry(
                    _("Remove not existing events"),
                    config.plugins.autotimer.check_eit_and_remove,
                    _("Check the event id (eit) and remove the timer if there is no corresponding EPG event. Due to compatible issues with SerienRecorder and IPRec, only timer created by AutoTimer are affected."
                      )),
                getConfigListEntry(
                    _("Always write config"),
                    config.plugins.autotimer.always_write_config,
                    _("Write the config file after every change which the user quits by saving."
                      )),
                getConfigListEntry(_("Send debug messages to shell"),
                                   config.plugins.autotimer.log_shell,
                                   _("Send debug messages to shell")),
                getConfigListEntry(_("Write debug messages into file"),
                                   config.plugins.autotimer.log_write,
                                   _("Write debug messages into file")),
                getConfigListEntry(_("Location and name of log file"),
                                   config.plugins.autotimer.log_file,
                                   _("Location and name of log file")),
                getConfigListEntry(
                    _("Save/check labelled series in filter list (SeriesPlugin)"
                      ), config.plugins.autotimer.series_save_filter,
                    _("Save timer name generated by SeriesPlugin in filter list to use filter for future timer searches (only with SeriesPlugin)"
                      )),
                getConfigListEntry(
                    _("Show 'add to filter list' in movielist context menu"),
                    config.plugins.autotimer.show_addto_in_filmmenu,
                    _("Enable to add recordings to filter list from movielist context menu."
                      )),
                getConfigListEntry(
                    _("Match ratio for title duplicate check"),
                    config.plugins.autotimer.title_match_ratio,
                    _("Match ratio defines a minimum value to be met to consider a timer a duplicate when comparing the title (min.=80, max.=100; title must be identical to skip duplicates when set to 100, default=97)"
                      )),
                getConfigListEntry(
                    _("Match ratio for extended description duplicate check"),
                    config.plugins.autotimer.extdesc_match_ratio,
                    _("Match ratio defines a minimum value to be met to consider a timer a duplicate when comparing the extended description (min.=80, max.=100; extended description must be identical to skip duplicates when set to 100, default=90)"
                      )),
                getConfigListEntry(
                    _("Match ratio for short description duplicate check"),
                    config.plugins.autotimer.shortdesc_match_ratio,
                    _("Match ratio defines a minimum value to be met to consider a timer a duplicate when comparing the short description (min.=80, max.=100; short description must be identical to skip duplicates when set to 100, default=90)"
                      )),
                getConfigListEntry(
                    _("Location of autotimer_search.log"),
                    config.plugins.autotimer.searchlog_path,
                    _("Select the path where the autotimer_search.log should be saved"
                      )),
                getConfigListEntry(
                    _("Max number of retained search logs"),
                    config.plugins.autotimer.searchlog_max,
                    _("Define the number of search logs to be retained") +
                    " (min.=5, max.=20)"),
            ],
            session=session,
            on_change=self.changed)

        def selectionChanged():
            if self["config"].current:
                self["config"].current[1].onDeselect(self.session)
            self["config"].current = self["config"].getCurrent()
            if self["config"].current:
                self["config"].current[1].onSelect(self.session)
            for x in self["config"].onSelectionChanged:
                x()

        self["config"].selectionChanged = selectionChanged
        self["config"].onSelectionChanged.append(self.updateHelp)

        # Initialize widgets
        self["key_green"] = StaticText(_("OK"))
        self["key_red"] = StaticText(_("Cancel"))
        self["help"] = StaticText()

        # Define Actions
        self["actions"] = ActionMap(
            ["SetupActions", "ChannelSelectBaseActions"], {
                "cancel": self.keyCancel,
                "save": self.keySave,
                "nextBouquet": self.pageUp,
                "prevBouquet": self.pageDown,
            })

        # Trigger change
        self.changed()

        self.onLayoutFinish.append(self.setCustomTitle)
Esempio n. 27
0
    def __init__(self, session, key, args=None):
        Screen.__init__(self, session)
        self.session = session
        self.key = key
        self.setTitle(_("Hotkey Setup") + " " + key[0][0])
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Save"))
        self["key_yellow"] = StaticText("")
        self["h_prev"] = Pixmap()
        self["h_next"] = Pixmap()

        self.mode = "list"
        self.hotkeyFunctions = getHotkeyFunctions()
        self.config = eval("config.misc.hotkey." + key[0][1])
        self.expanded = []
        self.selected = []
        for x in self.config.value.split(','):
            if x.startswith("ZapPanic"):
                self.selected.append(
                    ChoiceEntryComponent(
                        '', ((_("Panic to") + " " + ServiceReference(
                            eServiceReference(x.split(
                                "/", 1)[1]).toString()).getServiceName()), x)))
            elif x.startswith("Zap"):
                self.selected.append(
                    ChoiceEntryComponent(
                        '', ((_("Zap to") + " " + ServiceReference(
                            eServiceReference(x.split(
                                "/", 1)[1]).toString()).getServiceName()), x)))
            else:
                function = list(function for function in self.hotkeyFunctions
                                if function[1] == x)
                if function:
                    self.selected.append(
                        ChoiceEntryComponent(
                            '', ((function[0][0]), function[0][1])))
        self.prevselected = self.selected[:]
        if self.prevselected:
            self["key_yellow"].setText(_("Edit selection"))
        self["choosen"] = ChoiceList(list=self.selected, selection=0)
        self["list"] = ChoiceList(list=self.getFunctionList(), selection=0)
        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "KeyboardInputActions", "MenuActions"
            ], {
                "ok": self.keyOk,
                "cancel": self.cancel,
                "red": self.cancel,
                "green": self.save,
                "yellow": self.toggleMode,
                "up": self.keyUp,
                "down": self.keyDown,
                "left": self.keyLeft,
                "right": self.keyRight,
                "upRepeated": self.keyUp,
                "downRepeated": self.keyDown,
                "leftRepeated": self.keyLeft,
                "rightRepeated": self.keyRight,
                "pageUp": self.toggleMode,
                "pageDown": self.toggleMode,
                "moveUp": self.moveUp,
                "moveDown": self.moveDown,
                "menu": boundFunction(self.close, True),
            }, -1)

        self.showPrevNext()

        self.onLayoutFinish.append(self.__layoutFinished)
Esempio n. 28
0
	def __init__(self, session, parent):
		Screen.__init__(self, session, parent)
		self["text"] = StaticText("")
		self.onShow.append(self.setCallback)
Esempio n. 29
0
    def __init__(self,
                 session,
                 title="",
                 list=[],
                 keys=None,
                 selection=0,
                 skin_name=[],
                 reorderConfig="",
                 windowTitle=None):
        Screen.__init__(self, session)

        if isinstance(skin_name, str):
            skin_name = [skin_name]
        self.skinName = skin_name + ["ChoiceBox"]

        self.reorderConfig = reorderConfig
        self["autoresize"] = Label("")  # do not remove, used for autoResize()
        self["description"] = Label()
        self["text"] = Label(title)
        self.list = []
        self.summarylist = []
        if keys is None:
            self.__keys = [
                "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "red",
                "green", "yellow", "blue"
            ] + (len(list) - 14) * [""]
        else:
            self.__keys = keys + (len(list) - len(keys)) * [""]

        self.keymap = {}
        pos = 0
        if self.reorderConfig:
            self.config_type = eval("config.misc.pluginlist." +
                                    self.reorderConfig)
            if self.config_type.value:
                prev_list = zip(list, self.__keys)
                new_list = []
                for x in self.config_type.value.split(","):
                    for entry in prev_list:
                        if entry[0][0] == x:
                            new_list.append(entry)
                            prev_list.remove(entry)
                list = zip(*(new_list + prev_list))
                list, self.__keys = list[0], list[1]
                number = 1
                new_keys = []
                for x in self.__keys:
                    if (not x or x.isdigit()) and number <= 10:
                        new_keys.append(str(number % 10))
                        number += 1
                    else:
                        new_keys.append(not x.isdigit() and x or "")
                self.__keys = new_keys
        for x in list:
            if x:
                strpos = str(self.__keys[pos])
                self.list.append(ChoiceEntryComponent(key=strpos, text=x))
                if self.__keys[pos] != "":
                    self.keymap[self.__keys[pos]] = list[pos]
                self.summarylist.append((self.__keys[pos], x[0]))
                pos += 1

        self["list"] = ChoiceList(list=self.list, selection=selection)
        self["summary_list"] = StaticText()
        self["summary_selection"] = StaticText()
        self.updateSummary(selection)

        self["actions"] = NumberActionMap(
            [
                "WizardActions", "InputActions", "ColorActions",
                "DirectionActions", "MenuActions"
            ], {
                "ok": self.go,
                "back": self.cancel,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal,
                "red": self.keyRed,
                "green": self.keyGreen,
                "yellow": self.keyYellow,
                "blue": self.keyBlue,
                "up": self.up,
                "down": self.down,
                "moveUp": self.additionalMoveUp,
                "moveDown": self.additionalMoveDown,
                "menu": self.setDefaultChoiceList
            }, -1)
        self.setTitle(windowTitle or _("Select"))
Esempio n. 30
0
	def __init__(self, session, text, type=TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, picon=True, simple=False, wizard=False, list=None, skin_name=None, timeout_default=None):
		if not list:
			list = []
		if not skin_name:
			skin_name = []
		self.type = type
		Screen.__init__(self, session)
		self.skinName = ["MessageBox"]
		if self.type == self.TYPE_YESNO:
			self.setTitle(_("Question"))
		elif self.type == self.TYPE_INFO:
			self.setTitle(_("Information"))
		elif self.type == self.TYPE_WARNING:
			self.setTitle(_("Warning"))
		elif self.type == self.TYPE_ERROR:
			self.setTitle(_("Error"))
		else:
			self.setTitle(_("Message"))
		if wizard:
			from Components.config import config
			from Components.Pixmap import MultiPixmap
			self["rc"] = MultiPixmap()
			self["rc"].setPixmapNum(config.misc.rcused.value)
			self.skinName = ["MessageBoxWizard"]

		if simple:
			self.skinName = ["MessageBoxSimple"]

		if isinstance(skin_name, str):
			self.skinName = [skin_name] + self.skinName

		self.msgBoxID = msgBoxID

		self["text"] = Label(_(text))
		self["Text"] = StaticText(_(text))
		self["selectedChoice"] = StaticText()

		self.text = _(text)
		self.close_on_any_key = close_on_any_key
		self.timeout_default = timeout_default

		self["ErrorPixmap"] = Pixmap()
		self["ErrorPixmap"].hide()
		self["QuestionPixmap"] = Pixmap()
		self["QuestionPixmap"].hide()
		self["InfoPixmap"] = Pixmap()
		self["InfoPixmap"].hide()

		self.timerRunning = False
		self.initTimeout(timeout)

		if picon:
			picon = type
			if picon == self.TYPE_ERROR:
				self["ErrorPixmap"].show()
			elif picon == self.TYPE_YESNO:
				self["QuestionPixmap"].show()
			elif picon == self.TYPE_INFO:
				self["InfoPixmap"].show()

		self.messtype = type
		if type == self.TYPE_YESNO:
			if list:
				self.list = list
			elif default:
				self.list = [(_("yes"), True), (_("no"), False)]
			else:
				self.list = [(_("no"), False), (_("yes"), True)]
		else:
			self.list = []

		self["list"] = MenuList(self.list)
		if self.list:
			self["selectedChoice"].setText(self.list[0][0])
		else:
			self["list"].hide()

		if enable_input:
			self["actions"] = ActionMap(["MsgBoxActions", "DirectionActions"],
				{
					"cancel": self.cancel,
					"ok": self.ok,
					"alwaysOK": self.alwaysOK,
					"up": self.up,
					"down": self.down,
					"left": self.left,
					"right": self.right,
					"upRepeated": self.up,
					"downRepeated": self.down,
					"leftRepeated": self.left,
					"rightRepeated": self.right
				}, -1)