示例#1
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = NumberActionMap(
            ["NumberActions", "RassInteractiveActions"], {
                "exit": self.close,
                "0": lambda x: self.numPressed(0),
                "1": lambda x: self.numPressed(1),
                "2": lambda x: self.numPressed(2),
                "3": lambda x: self.numPressed(3),
                "4": lambda x: self.numPressed(4),
                "5": lambda x: self.numPressed(5),
                "6": lambda x: self.numPressed(6),
                "7": lambda x: self.numPressed(7),
                "8": lambda x: self.numPressed(8),
                "9": lambda x: self.numPressed(9),
                "nextPage": self.nextPage,
                "prevPage": self.prevPage,
                "nextSubPage": self.nextSubPage,
                "prevSubPage": self.prevSubPage
            })

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evUpdatedRassInteractivePicMask:
                self.recvRassInteractivePicMaskChanged
            })

        self["subpages_1"] = Pixmap()
        self["subpages_2"] = Pixmap()
        self["subpages_3"] = Pixmap()
        self["subpages_4"] = Pixmap()
        self["subpages_5"] = Pixmap()
        self["subpages_6"] = Pixmap()
        self["subpages_7"] = Pixmap()
        self["subpages_8"] = Pixmap()
        self["subpages_9"] = Pixmap()
        self["Marker"] = Label(">")

        self.subpage = {
            1: self["subpages_1"],
            2: self["subpages_2"],
            3: self["subpages_3"],
            4: self["subpages_4"],
            5: self["subpages_5"],
            6: self["subpages_6"],
            7: self["subpages_7"],
            8: self["subpages_8"],
            9: self["subpages_9"]
        }

        self.subpage_png = {
            1:
            LoadPixmap(
                resolveFilename(SCOPE_ACTIVE_SKIN, "icons/rass_page1.png")),
            2:
            LoadPixmap(
                resolveFilename(SCOPE_ACTIVE_SKIN, "icons/rass_page2.png")),
            3:
            LoadPixmap(
                resolveFilename(SCOPE_ACTIVE_SKIN, "icons/rass_page3.png")),
            4:
            LoadPixmap(
                resolveFilename(SCOPE_ACTIVE_SKIN, "icons/rass_page4.png"))
        }

        self.current_page = 0
        self.current_subpage = 0
        self.showRassPage(0, 0)
        self.onLayoutFinish.append(self.updateSubPagePixmaps)
示例#2
0
	def __init__(self, session, parent, showStepSlider = True):
		Screen.__init__(self, session, parent)

		self["Title"] = Label(parent.title or _("Service scan"))
		self["Service"] = Label(_("No service"))
		self["scan_progress"] = ProgressBar()
示例#3
0
 def __init__(self, session, parent):
     Screen.__init__(self, session)
     self["headline"] = Label(_("OFDb Plugin"))
示例#4
0
文件: BpSet.py 项目: kingvuplus/az-bh
    def __init__(self, session):
        Screen.__init__(self, session)

        self["lab1"] = Label(_(""))
        self["lab1a"] = Label(_("OpenVPN Panel - by Black Hole Team."))
        self["lab2"] = Label(_("Startup Module:"))
        self["labactive"] = Label(_("Inactive"))
        self["lab3"] = Label(_("Current Status:"))
        self["labstop"] = Label(_("Stopped"))
        self["labrun"] = Label(_("Running"))
        self["key_red"] = Label(_("Start"))
        self["key_green"] = Label(_("Stop"))
        self["key_yellow"] = Label(_("Set Active"))
        self["key_blue"] = Label(_("Show Log"))
        self.my_vpn_active = False
        self.my_vpn_run = False

        self["actions"] = ActionMap(
            ["WizardActions", "ColorActions"], {
                "ok": self.close,
                "back": self.close,
                "red": self.restartVpn,
                "green": self.stopVpnstop,
                "yellow": self.activateVpn,
                "blue": self.Vpnshowlog
            })

        self.onLayoutFinish.append(self.updateVpn)
示例#5
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 = []
        _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 = self.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 = self.type
        if self.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)
示例#6
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent)
     self["Title"] = Label("")
     self["Time"] = Label("")
     self["Chapter"] = Label("")
     self["FullChapters"] = Label("")
示例#7
0
	def __init__(self, session):
		Screen.__init__(self, session)
		
		OpenNFRVersion = _("OpenNFR %s") % about.getImageVersionString()
		self["OpenNFRVersion"] = Label(OpenNFRVersion)
		
		AboutText = _("Model:\t\t%s %s\n") % (getMachineBrand(), getMachineName())
		
		bootloader = ""
                if path.exists('/sys/firmware/devicetree/base/bolt/tag'):
		        f = open('/sys/firmware/devicetree/base/bolt/tag', 'r')
	                bootloader = f.readline().replace('\x00', '').replace('\n', '')
		        f.close()
			AboutText += _("Bootloader:\t\t%s\n") % (bootloader)

		if path.exists('/proc/stb/info/chipset'):
			AboutText += _("Chipset:\t\tBCM%s") % about.getChipSetString() + "\n"

		cpuMHz = ""
		if getMachineBuild() in ('vusolo4k'):
			cpuMHz = "   (1,5 GHz)"
		elif getMachineBuild() in ('formuler1', 'triplex'):
			cpuMHz = "   (1,3 GHz)"
		elif getMachineBuild() in ('u5','u53','u52','u51','u5pvr','h9','cc1','sf8008'):
			cpuMHz = "   (1,6 GHz)"			
		elif getMachineBuild() in ('vuuno4k','vuultimo4k', 'gb7252', 'dags7252'):
			cpuMHz = "   (1,7 GHz)"
		elif getMachineBuild() in ('sf5008','et13000','et1x000','hd52','hd51','sf4008','vs1500','h7'):
                        try:
				import binascii
				f = open('/sys/firmware/devicetree/base/cpus/cpu@0/clock-frequency', 'rb')
				clockfrequency = f.read()
				f.close()
				cpuMHz = "   (%s MHz)" % str(round(int(binascii.hexlify(clockfrequency), 16)/1000000,1))
			except:
				cpuMHz = "   (1,7 GHz)"
		else:
			if path.exists('/proc/cpuinfo'):
				f = open('/proc/cpuinfo', 'r')
				temp = f.readlines()
				f.close()
				try:
					for lines in temp:
						lisp = lines.split(': ')
						if lisp[0].startswith('cpu MHz'):
							#cpuMHz = "   (" +  lisp[1].replace('\n', '') + " MHz)"
							cpuMHz = "   (" +  str(int(float(lisp[1].replace('\n', '')))) + " MHz)"
							break
				except:
					pass

		AboutText += _("CPU:\t\t%s") % about.getCPUString() + cpuMHz + "\n"
		AboutText += _("Cores:\t\t%s") % about.getCpuCoresString() + "\n"
		imagestarted = ""
		bootname = ''
	        if path.exists('/boot/bootname'):
	                f = open('/boot/bootname', 'r')
		        bootname = f.readline().split('=')[1]
		        f.close()

		if getMachineBuild() in ('cc1','sf8008'):
			if path.exists('/boot/STARTUP'):
				f = open('/boot/STARTUP', 'r')
				f.seek(5)
				image = f.read(4)
				if image == "emmc":
					image = "1"
				elif image == "usb0":
					f.seek(13)
					image = f.read(1)
					if image == "1":
						image = "2"
					elif image == "3":
						image = "3"
					elif image == "5":
						image = "4"
					elif image == "7":
						image = "5"
				f.close()
				if bootname: bootname = "   (%s)" %bootname 
				AboutText += _("Selected Image:\t\t%s") % "STARTUP_" + image + bootname + "\n"
		elif path.exists('/boot/STARTUP'):
			f = open('/boot/STARTUP', 'r')
			f.seek(22)
			image = f.read(1) 
			f.close()
			if bootname: bootname = "   (%s)" %bootname 
		        AboutText += _("Selected Image:\t\t%s") % "STARTUP_" + image + bootname + "\n"
		string = getDriverDate()
		year = string[0:4]
		month = string[4:6]
		day = string[6:8]
		driversdate = '-'.join((year, month, day))
		AboutText += _("Drivers:\t\t%s") % driversdate + "\n"
		AboutText += _("Image:\t\t%s") % about.getImageVersionString() + "\n"
		AboutText += _("Build:\t\t%s") % getImageBuild() + "\n"		
		AboutText += _("Kernel: \t\t%s") % about.getKernelVersionString() + "\n"
		AboutText += _("Oe-Core:\t\t%s") % getOEVersion() + "\n"
		AboutText += _("Enigma (re)starts:\t%d\n") % config.misc.startCounter.value
		AboutText += _("GStreamer:\t\t%s") % about.getGStreamerVersionString() + "\n"	
		AboutText += _("Python:\t\t%s") % about.getPythonVersionString() + "\n"

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		elif fp_version != 0:
			fp_version = _("Front Panel:\t\t%s") % fp_version 
			AboutText += fp_version + "\n\n"
		else:
			fp_version = _("Front Panel:\t\tVersion unknown")
			AboutText += fp_version + "\n\n"

		AboutText += _("Installed:\t\t%s") % about.getFlashDateString() + "\n"			
		AboutText += _("Last Upgrade:\t\t%s") % about.getLastUpdateString() + "\n\n" 
		AboutText += _("WWW:\t\t%s") % about.getImageUrlString() + "\n\n"
		AboutText += _("based on:\t\t%s") % "www.github.com/oe-alliance" + "\n\n"

		self["FPVersion"] = StaticText(fp_version)

		tempinfo = ""
		if path.exists('/proc/stb/sensors/temp0/value'):
			f = open('/proc/stb/sensors/temp0/value', 'r')
			tempinfo = f.read()
			f.close()
		elif path.exists('/proc/stb/fp/temp_sensor'):
			f = open('/proc/stb/fp/temp_sensor', 'r')
			tempinfo = f.read()
			f.close()
		if tempinfo and int(tempinfo.replace('\n', '')) > 0:
			mark = str('\xc2\xb0')
			AboutText += _("System temperature: %s") % tempinfo.replace('\n', '') + mark + "C\n\n"

		# don't remove the string out of the _(), or it can't be "translated" anymore.
		# TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline)
		info = _("TRANSLATOR_INFO")

		if info == _("TRANSLATOR_INFO"):
			info = ""

		infolines = _("").split("\n")
		infomap = {}
		for x in infolines:
			l = x.split(': ')
			if len(l) != 2:
				continue
			(type, value) = l
			infomap[type] = value

		translator_name = infomap.get("Language-Team", "none")
		if translator_name == "none":
			translator_name = infomap.get("Last-Translator", "")

		self["FPVersion"] = StaticText(fp_version)

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

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

		self["HDDHeader"] = StaticText(_("Detected HDD:"))

		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += "%s\n(%s, %d GB %s)" % (hdd.model(), hdd.capacity(), hdd.free()/1024, _("free"))
				else:
					hddinfo += "%s\n(%s, %d MB %s)" % (hdd.model(), hdd.capacity(), hdd.free(), _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		
		self["AboutScrollLabel"] = ScrollLabel(AboutText)

		self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"], 
			{
				"cancel": self.close,
				"ok": self.close,
				"green": self.showTranslationInfo,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
示例#8
0
	def __init__(self, session, *args):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Software Panel"))
		skin = """
		<screen name="SoftwarePanel" position="center,center" size="650,605" title="Software Panel">
			<widget name="a_off" pixmap="/usr/lib/enigma2/python/OPENDROID/icons/aoff.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="a_red" pixmap="/usr/lib/enigma2/python/OPENDROID/icons/ared.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="a_yellow" pixmap="/usr/lib/enigma2/python/OPENDROID/icons/ayellow.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="a_green" pixmap="/usr/lib/enigma2/python/OPENDROID/icons/agreen.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="feedstatusRED" position="60,14" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" />
			<widget name="feedstatusYELLOW" position="60,46" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" />
			<widget name="feedstatusGREEN" position="60,78" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" />
			<widget name="packagetext" position="180,50" size="350,30" zPosition="1" font="Regular;25" halign="right" transparent="1" />
			<widget name="packagenr" position="511,50" size="50,30" zPosition="1" font="Regular;25" halign="right" transparent="1" />
			<widget source="list" render="Listbox" position="10,120" size="630,365" scrollbarMode="showOnDemand">
				<convert type="TemplatedMultiContent">
					{"template": [
							MultiContentEntryText(pos = (5, 1), size = (540, 28), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
							MultiContentEntryText(pos = (5, 26), size = (540, 20), font=1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is the description
							MultiContentEntryPixmapAlphaTest(pos = (545, 2), size = (48, 48), png = 4), # index 4 is the status pixmap
							MultiContentEntryPixmapAlphaTest(pos = (5, 50), size = (610, 2), png = 5), # index 4 is the div pixmap
						],
					"fonts": [gFont("Regular", 22),gFont("Regular", 14)],
					"itemHeight": 52
					}
				</convert>
			</widget>
			<ePixmap pixmap="skin_default/buttons/red.png" position=" 30,570" size="35,27" alphatest="blend" />
			<widget name="key_green_pic" pixmap="skin_default/buttons/green.png" position="290,570" size="35,27" alphatest="blend" />
			<widget name="key_red" position=" 80,573" size="200,26" zPosition="1" font="Regular;22" halign="left" transparent="1" />
			<widget name="key_green" position="340,573" size="200,26" zPosition="1" font="Regular;22" halign="left" transparent="1" />
		</screen> """
		self.skin = skin
		self.list = []
		self.statuslist = []
		self["list"] = List(self.list)
		self['a_off'] = Pixmap()
		self['a_red'] = Pixmap()
		self['a_yellow'] = Pixmap()
		self['a_green'] = Pixmap()
		self['key_green_pic'] = Pixmap()
		self['key_red_pic'] = Pixmap()
		self['key_red'] = Label(_("Cancel"))
		self['key_green'] = Label(_("Update"))
		self['packagetext'] = Label(_("Updates Available:"))
		self['packagenr'] = Label("0")
		self['feedstatusRED'] = Label("<  " + _("feed status"))
		self['feedstatusYELLOW'] = Label("<  " + _("feed status"))
		self['feedstatusGREEN'] = Label("<  " + _("feed status"))
		self['key_green'].hide()
		self['key_green_pic'].hide()
		self.update = False
		self.packages = 0
		self.ipkg = IpkgComponent()
		self.ipkg.addCallback(self.ipkgCallback)
		self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ColorActions", "SetupActions"],
		{
			"cancel": self.Exit,
			"green": self.Green,
			"red": self.Exit,
		}, -2)

		self.onLayoutFinish.append(self.layoutFinished)
示例#9
0
    def __init__(self,
                 session,
                 epgConfig,
                 startBouquet=None,
                 startRef=None,
                 bouquets=None):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        self.epgConfig = epgConfig
        self.bouquets = bouquets
        self.originalPlayingServiceOrGroup = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.startBouquet = startBouquet
        self.startRef = startRef
        self.choiceBoxDialog = None
        self.closeRecursive = False
        self.eventviewDialog = None
        self.eventviewWasShown = False
        self.session.pipshown = False
        self.pipServiceRelation = getRelationDict(
        ) if plugin_PiPServiceRelation_installed else {}
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self["lab1"] = Label(_("Please wait while gathering EPG data..."))
        self["lab1"].hide()
        self["key_red"] = Button(_("IMDb Search"))
        self["key_green"] = Button(_("Add Timer"))
        self["key_yellow"] = Button(_("EPG Search"))
        self["key_blue"] = Button(_("Add AutoTimer"))

        helpDescription = _("EPG Commands")
        self["dialogactions"] = HelpableActionMap(
            self,
            "WizardActions", {
                "back": (self.closeChoiceBoxDialog, _("Close dialog box")),
            },
            prio=-1,
            description=helpDescription)
        self["dialogactions"].setEnabled(False)
        self["okactions"] = HelpableActionMap(
            self,
            "OkCancelActions", {
                "cancel": (self.closeScreen, _("Exit EPG")),
                "OK":
                (ignoreLongKeyPress(self.OK), _("Zap to channel/service")),
                "OKLong": (self.OKLong, _("Zap to channel/service and close"))
            },
            prio=-1,
            description=helpDescription)
        self["colouractions"] = HelpableActionMap(
            self,
            "ColorActions", {
                "red": (ignoreLongKeyPress(
                    self.openIMDb), _("IMDB search for current event")),
                "redlong": (self.sortEPG, _("Sort the EPG list")),
                "green": (ignoreLongKeyPress(self.addEditTimer),
                          _("Add/Remove timer for current event")),
                "greenlong": (self.openTimerList, _("Show timer list")),
                "yellow": (ignoreLongKeyPress(
                    self.openEPGSearch), _("Search for similar events")),
                "blue": (ignoreLongKeyPress(self.addAutoTimer),
                         _("Add an autotimer for current event")),
                "bluelong": (self.openAutoTimerList, _("Show autotimer list"))
            },
            prio=-1,
            description=helpDescription)
        self["recordingactions"] = HelpableActionMap(
            self,
            "InfobarInstantRecord", {
                "ShortRecord": (self.recordTimerQuestion,
                                _("Add a record timer for current event")),
                "LongRecord":
                (self.doZapTimer, _("Add a zap timer for current event"))
            },
            prio=-1,
            description=helpDescription)
        self["epgactions"] = HelpableActionMap(self, "EPGSelectActions", {},
                                               -1)

        self.noAutotimer = _(
            "The AutoTimer plugin is not installed!\nPlease install it.")
        self.noEPGSearch = _(
            "The EPGSearch plugin is not installed!\nPlease install it.")
        self.noIMDb = _(
            "The IMDb plugin is not installed!\nPlease install it.")
        self.refreshTimer = eTimer()
        self.refreshTimer.timeout.get().append(self.refreshList)
        self.onLayoutFinish.append(self.onCreate)
示例#10
0
文件: Wizard.py 项目: gigirock/stbgui
	def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True):
		Screen.__init__(self, session)

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

		self.stepHistory = []

		self.wizard = {}
		parser = make_parser()
		if not isinstance(self.xmlfile, list):
			self.xmlfile = [self.xmlfile]
		print "Reading ", self.xmlfile
		wizardHandler = self.parseWizard(self.wizard)
		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.numSteps = len(self.wizard)
		self.currStep = self.getStepWithID("start") + 1

		self.timeoutTimer = eTimer()
		self.timeoutTimer.callback.append(self.timeoutCounterFired)

		self["text"] = Label()

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

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

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

		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.configInstance = None
		self.currentConfigIndex = None

		Wizard.instance = self

		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,
			"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["VirtualKB"] = NumberActionMap(["VirtualKeyboardActions"],
		{
			"showVirtualKeyboard": self.KeyText,
		}, -2)

		self["VirtualKB"].setEnabled(False)
示例#11
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"))
示例#12
0
文件: Ci.py 项目: trunca/malasuerte
	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("CIHelper Setup"))
		self.skinName = "CIHelper"
		self.onChangedEntry = [ ]
		self['ci0'] = Label(_("CIHelper for SLOT CI0"))
		self['ci0active'] = Pixmap()
		self['ci0inactive'] = Pixmap()
		self['ci1'] = Label(_("CIHelper for SLOT CI1"))
		self['ci1active'] = Pixmap()
		self['ci1inactive'] = Pixmap()

		self['autostart'] = Label(_("Autostart:"))
		self['labactive'] = Label(_(_("Active")))
		self['labdisabled'] = Label(_(_("Disabled")))
		self['status'] = Label(_("Current Status:"))
		self['labstop'] = Label(_("Stopped"))
		self['labrun'] = Label(_("Running"))
		self['key_red'] = Label()
		self['key_green'] = Label(_("Start"))
		self['key_yellow'] = Label(_("Autostart"))
		self['key_blue'] = Label()
		self.Console = Console()
		self.my_cihelper_active = False
		self.my_cihelper_run = False
		self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'SetupActions'], {'ok': self.setupcihelper, 'back': self.close, 'menu': self.setupcihelper, 'green': self.CIHelperStartStop, 'yellow': self.CIHelperset})
		self.onLayoutFinish.append(self.updateService)
示例#13
0
文件: plugin.py 项目: Akki01/dvbapp
	def __init__(self, session, feid):
		self.skin = PositionerSetup.skin
		Screen.__init__(self, session)
		self.feid = feid
		self.oldref = None

		cur = { }
		if not self.openFrontend():
			self.oldref = session.nav.getCurrentlyPlayingServiceReference()
			service = session.nav.getCurrentService()
			feInfo = service and service.frontendInfo()
			if feInfo:
				cur = feInfo.getTransponderData(True)
			del feInfo
			del service
			session.nav.stopService() # try to disable foreground service
			if not self.openFrontend():
				if session.pipshown: # try to disable pip
					service = self.session.pip.pipservice
					feInfo = service and service.frontendInfo()
					if feInfo:
						cur = feInfo.getTransponderData()
					del feInfo
					del service
					session.pipshown = False
					del session.pip
					if not self.openFrontend():
						self.frontend = None # in normal case this should not happen
		
		self.frontendStatus = { }
		self.diseqc = Diseqc(self.frontend)
		self.tuner = Tuner(self.frontend, True) #True means we dont like that the normal sec stuff sends commands to the rotor!

		tp = ( cur.get("frequency", 0) / 1000,
			cur.get("symbol_rate", 0) / 1000,
			cur.get("polarization", eDVBFrontendParametersSatellite.Polarisation_Horizontal),
			cur.get("fec_inner", eDVBFrontendParametersSatellite.FEC_Auto),
			cur.get("inversion", eDVBFrontendParametersSatellite.Inversion_Unknown),
			cur.get("orbital_position", 0),
			cur.get("system", eDVBFrontendParametersSatellite.System_DVB_S),
			cur.get("modulation", eDVBFrontendParametersSatellite.Modulation_QPSK),
			cur.get("rolloff", eDVBFrontendParametersSatellite.RollOff_alpha_0_35),
			cur.get("pilot", eDVBFrontendParametersSatellite.Pilot_Unknown))

		self.tuner.tune(tp)
		self.createConfig()
		
		self.isMoving = False
		self.stopOnLock = False
		
		self.red = Label("")
		self["red"] = self.red
		self.green = Label("")
		self["green"] = self.green
		self.yellow = Label("")
		self["yellow"] = self.yellow
		self.blue = Label("")
		self["blue"] = self.blue

		self.list = []
		self["list"] = ConfigList(self.list)
		self.createSetup()

		self["snr_db"] = TunerInfo(TunerInfo.SNR_DB, statusDict = self.frontendStatus)
		self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, statusDict = self.frontendStatus)
		self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, statusDict = self.frontendStatus)
		self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, statusDict = self.frontendStatus)
		self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, statusDict = self.frontendStatus)
		self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, statusDict = self.frontendStatus)

		self["frequency_value"] = Label("")
		self["symbolrate_value"] = Label("")
		self["fec_value"] = Label("")
		
		self["actions"] = ActionMap(["DirectionActions", "OkCancelActions", "ColorActions"],
		{
			"ok": self.go,
			"cancel": self.keyCancel,
			"up": self.up,
			"down": self.down,
			"left": self.left,
			"right": self.right,
			"red": self.redKey,
			"green": self.greenKey,
			"yellow": self.yellowKey,
			"blue": self.blueKey,
		}, -1)
		
		self.updateColors("tune")
		
		self.statusTimer = eTimer()
		self.statusTimer.callback.append(self.updateStatus)
		self.statusTimer.start(50, True)
		self.onClose.append(self.__onClose)
示例#14
0
    def __init__(self, session, infobar):
        Screen.__init__(self, session)
        self.infobar = infobar or self.session.infobar

        self.wait = eTimer()
        self.wait.timeout.get().append(self.resyncSubtitles)

        self.resume = eTimer()
        self.resume.timeout.get().append(self.resyncSubtitlesResume)

        self["videofps"] = Label("")

        sub = self.infobar.selected_subtitle
        if sub[0] == 0:  # dvb
            menu = [
                getConfigMenuItem("config.subtitles.dvb_subtitles_yellow"),
                getConfigMenuItem("config.subtitles.dvb_subtitles_centered"),
                getConfigMenuItem("config.subtitles.dvb_subtitles_backtrans"),
                getConfigMenuItem(
                    "config.subtitles.dvb_subtitles_original_position"),
                getConfigMenuItem("config.subtitles.subtitle_position"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_bad_timing_delay"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_noPTSrecordingdelay"),
            ]
        elif sub[0] == 1:  # teletext
            menu = [
                getConfigMenuItem("config.subtitles.ttx_subtitle_colors"),
                getConfigMenuItem(
                    "config.subtitles.ttx_subtitle_original_position"),
                getConfigMenuItem("config.subtitles.subtitle_fontsize"),
                getConfigMenuItem("config.subtitles.subtitle_position"),
                getConfigMenuItem("config.subtitles.subtitle_rewrap"),
                getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
                getConfigMenuItem("config.subtitles.subtitle_alignment"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_bad_timing_delay"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_noPTSrecordingdelay"),
            ]
        else:  # pango
            menu = [
                getConfigMenuItem("config.subtitles.pango_subtitles_delay"),
                getConfigMenuItem("config.subtitles.pango_subtitle_colors"),
                getConfigMenuItem("config.subtitles.subtitle_fontsize"),
                getConfigMenuItem("config.subtitles.subtitle_position"),
                getConfigMenuItem("config.subtitles.subtitle_alignment"),
                getConfigMenuItem("config.subtitles.subtitle_rewrap"),
                getConfigMenuItem("config.subtitles.pango_subtitle_removehi"),
                getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
                getConfigMenuItem("config.subtitles.pango_subtitles_fps"),
            ]
            self["videofps"].setText(
                _("Video: %s fps") % (self.getFps().rstrip(".000")))

        ConfigListScreen.__init__(self,
                                  menu,
                                  self.session,
                                  on_change=self.changedEntry)

        self["actions"] = NumberActionMap(
            ["SetupActions"], {
                "cancel": self.cancel,
                "ok": self.ok,
                "1": self.keyNumber,
                "3": self.keyNumber,
                "4": self.keyNumber,
                "6": self.keyNumber,
                "7": self.keyNumber,
                "9": self.keyNumber,
                "0": self.keyNumber,
            }, -2)
示例#15
0
    def __init__(self, session):
        Screen.__init__(self, session)
        fn = 'NewImage'
        sourcelist = []
        for fn in os.listdir('%sImagesUpload' % getNeoLocation()):
            if fn.find('.zip') != -1:
                fn = fn.replace('.zip', '')
                sourcelist.append((fn, fn))
                continue
            if fn.find('.tar.xz') != -1:
                fn = fn.replace('.tar.xz', '')
                sourcelist.append((fn, fn))
                continue
            if fn.find('.nfi') != -1:
                fn = fn.replace('.nfi', '')
                sourcelist.append((fn, fn))
                continue
        if len(sourcelist) == 0:
            sourcelist = [('None', 'None')]
        self.source = ConfigSelection(choices=sourcelist)
        self.target = ConfigText(fixed_size=False)
        self.stopenigma = ConfigYesNo(default=False)
        self.CopyFiles = ConfigYesNo(default=True)
        self.CopyKernel = ConfigYesNo(default=True)
        self.TvList = ConfigYesNo(default=False)
        self.Sterowniki = ConfigYesNo(default=False)
        self.InstallSettings = ConfigYesNo(default=False)
        self.ZipDelete = ConfigYesNo(default=False)
        self.RepairFTP = ConfigYesNo(default=False)
        self.SoftCam = ConfigYesNo(default=False)
        self.MediaPortal = ConfigYesNo(default=False)
        self.BlackHole = ConfigYesNo(default=False)
        self.target.value = ''
        self.curselimage = ''
        try:
            if self.curselimage != self.source.value:
                self.target.value = self.source.value[:-13]
                self.curselimage = self.source.value
        except:
            pass

        self.createSetup()
        ConfigListScreen.__init__(self, self.list, session=session)
        self.source.addNotifier(self.typeChange)
        self['actions'] = ActionMap(
            [
                'OkCancelActions', 'ColorActions', 'CiSelectionActions',
                'VirtualKeyboardActions'
            ], {
                'cancel': self.cancel,
                'red': self.cancel,
                'green': self.imageInstall,
                'yellow': self.HelpInstall,
                'blue': self.openKeyboard
            }, -2)
        self['key_green'] = Label(_('Install'))
        self['key_red'] = Label(_('Cancel'))
        self['key_yellow'] = Label(_('Help'))
        self['key_blue'] = Label(_('Keyboard'))
        self['HelpWindow'] = Pixmap()
        self['HelpWindow'].hide()
示例#16
0
    def __init__(self, session, dvd_device=None, dvd_filelist=[], args=None):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        self.subtitle_window.real_hide = self.subtitle_window.hide
        self.subtitle_window.hide = self.SubtitleWindowFakeHide
        InfoBarExtensions.__init__(self)
        InfoBarPlugins.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.save_infobar_seek_config()
        self.change_infobar_seek_config()
        InfoBarSeek.__init__(self)
        InfoBarPVRState.__init__(self)
        self.dvdScreen = self.session.instantiateDialog(DVDOverlay)

        self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.session.nav.stopService()
        self["audioLabel"] = Label("n/a")
        self["subtitleLabel"] = Label("")
        self["angleLabel"] = Label("")
        self["chapterLabel"] = Label("")
        self["anglePix"] = Pixmap()
        self["anglePix"].hide()
        self.last_audioString = None
        self.last_subtitleString = None
        self.last_angleTuple = None
        self.totalChapters = 0
        self.currentChapter = 0
        self.totalTitles = 0
        self.currentTitle = 0
        self._subs_enabled = False

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evEnd: self.__serviceStopped,
                iPlayableService.evStopped: self.__serviceStopped,
                iPlayableService.evAudioListChanged: self.__osdAudioInfoAvail,
                iPlayableService.evSubtitleListChanged:
                self.__osdSubtitleInfoAvail,
                iPlayableService.evUser + 1: self.__statePlay,
                iPlayableService.evUser + 2: self.__statePause,
                iPlayableService.evUser + 3: self.__osdFFwdInfoAvail,
                iPlayableService.evUser + 4: self.__osdFBwdInfoAvail,
                iPlayableService.evUser + 5: self.__osdStringAvail,
                iPlayableService.evUser + 6: self.__osdAngleInfoAvail,
                iPlayableService.evUser + 7: self.__chapterUpdated,
                iPlayableService.evUser + 8: self.__titleUpdated,
                iPlayableService.evUser + 9: self.__menuOpened,
                iPlayableService.evUser + 10: self.__menuClosed
            })

        self["DVDPlayerDirectionActions"] = ActionMap(
            ["DirectionActions"],
            {
                #MENU KEY DOWN ACTIONS
                "left": self.keyLeft,
                "right": self.keyRight,
                "up": self.keyUp,
                "down": self.keyDown,

                #MENU KEY REPEATED ACTIONS
                "leftRepeated": self.doNothing,
                "rightRepeated": self.doNothing,
                "upRepeated": self.doNothing,
                "downRepeated": self.doNothing,

                #MENU KEY UP ACTIONS
                "leftUp": self.doNothing,
                "rightUp": self.doNothing,
                "upUp": self.doNothing,
                "downUp": self.doNothing,
            })

        self["OkCancelActions"] = ActionMap(["OkCancelActions"], {
            "ok": self.keyOk,
            "cancel": self.keyCancel,
        })

        self["DVDPlayerPlaybackActions"] = HelpableActionMap(
            self,
            "DVDPlayerActions",
            {
                #PLAYER ACTIONS
                "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")),
                "toggleInfo":
                (self.toggleInfo,
                 _("toggle time, chapter, audio, subtitle info")),
                "nextChapter":
                (self.nextChapter, _("forward to the next chapter")),
                "prevChapter":
                (self.prevChapter, _("rewind to the previous chapter")),
                "nextTitle":
                (self.nextTitle, _("jump forward to the next title")),
                "prevTitle":
                (self.prevTitle, _("jump back to the previous title")),
                "tv": (self.askLeavePlayer,
                       _("exit DVD player or return to file browser")),
                "dvdAudioMenu":
                (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")),
                "AudioSelection":
                (self.enterAudioSelection, _("Select audio track")),
                "nextAudioTrack":
                (self.nextAudioTrack, _("switch to the next audio track")),
                "nextSubtitleTrack":
                (self.nextSubtitleTrack,
                 _("switch to the next subtitle language")),
                "nextAngle": (self.nextAngle, _("switch to the next angle")),
                "seekBeginning":
                self.seekBeginning,
            },
            -2)

        self["NumberActions"] = NumberActionMap(
            ["NumberActions"], {
                "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,
            })

        self.onClose.append(self.__onClose)

        from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
        hotplugNotifier.append(self.hotplugCB)

        self.autoplay = dvd_device or dvd_filelist

        if dvd_device:
            self.physicalDVD = True
        else:
            self.scanHotplug()

        self.dvd_filelist = dvd_filelist
        self.onFirstExecBegin.append(self.opened)
        self.service = None
        self.in_menu = False
示例#17
0
    def __init__(self, session, dvd_device=None, dvd_filelist=[], args=None):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self)
        InfoBarNotifications.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)
        self.save_infobar_seek_config()
        self.change_infobar_seek_config()
        InfoBarSeek.__init__(self)
        InfoBarPVRState.__init__(self)

        self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
        self.dvdScreen = None
        self.session.nav.stopService()
        self["audioLabel"] = Label("n/a")
        self["subtitleLabel"] = Label("")
        self["angleLabel"] = Label("")
        self["chapterLabel"] = Label("")
        self["anglePix"] = Pixmap()
        self["anglePix"].hide()
        self.last_audioTuple = None
        self.last_subtitleTuple = None
        self.last_angleTuple = None
        self.totalChapters = 0
        self.currentChapter = 0
        self.totalTitles = 0
        self.currentTitle = 0

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evEnd: self.__serviceStopped,
                iPlayableService.evStopped: self.__serviceStopped,
                iPlayableService.evUser: self.__timeUpdated,
                iPlayableService.evUser + 1: self.__statePlay,
                iPlayableService.evUser + 2: self.__statePause,
                iPlayableService.evUser + 3: self.__osdFFwdInfoAvail,
                iPlayableService.evUser + 4: self.__osdFBwdInfoAvail,
                iPlayableService.evUser + 5: self.__osdStringAvail,
                iPlayableService.evUser + 6: self.__osdAudioInfoAvail,
                iPlayableService.evUser + 7: self.__osdSubtitleInfoAvail,
                iPlayableService.evUser + 8: self.__chapterUpdated,
                iPlayableService.evUser + 9: self.__titleUpdated,
                iPlayableService.evUser + 11: self.__menuOpened,
                iPlayableService.evUser + 12: self.__menuClosed,
                iPlayableService.evUser + 13: self.__osdAngleInfoAvail
            })

        self["DVDPlayerDirectionActions"] = ActionMap(
            ["DirectionActions"],
            {
                #MENU KEY DOWN ACTIONS
                "left": self.keyLeft,
                "right": self.keyRight,
                "up": self.keyUp,
                "down": self.keyDown,

                #MENU KEY REPEATED ACTIONS
                "leftRepeated": self.doNothing,
                "rightRepeated": self.doNothing,
                "upRepeated": self.doNothing,
                "downRepeated": self.doNothing,

                #MENU KEY UP ACTIONS
                "leftUp": self.doNothing,
                "rightUp": self.doNothing,
                "upUp": self.doNothing,
                "downUp": self.doNothing,
            })

        self["OkCancelActions"] = ActionMap(["OkCancelActions"], {
            "ok": self.keyOk,
            "cancel": self.keyCancel,
        }, -2)

        self["DVDPlayerPlaybackActions"] = HelpableActionMap(
            self,
            "DVDPlayerActions",
            {
                #PLAYER ACTIONS
                "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")),
                "toggleInfo":
                (self.toggleInfo,
                 _("toggle time, chapter, audio, subtitle info")),
                "nextChapter":
                (self.nextChapter, _("forward to the next chapter")),
                "prevChapter":
                (self.prevChapter, _("rewind to the previous chapter")),
                "nextTitle":
                (self.nextTitle, _("jump forward to the next title")),
                "prevTitle":
                (self.prevTitle, _("jump back to the previous title")),
                "tv": (self.askLeavePlayer,
                       _("exit DVD player or return to file browser")),
                "dvdAudioMenu":
                (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")),
                "AudioSelection":
                (self.enterAudioSelection, _("Select audio track")),
                "nextAudioTrack":
                (self.nextAudioTrack, _("switch to the next audio track")),
                "nextSubtitleTrack":
                (self.nextSubtitleTrack,
                 _("switch to the next subtitle language")),
                "nextAngle": (self.nextAngle, _("switch to the next angle")),
                "seekBeginning":
                self.seekBeginning,
            },
            -2)

        self["DVDPlayerColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "blue": (self.chapterZap, _("jump to chapter by number")),
            }, -2)

        self.onClose.append(self.__onClose)

        try:
            from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
            hotplugNotifier.append(self.hotplugCB)
        except:
            pass

        self.autoplay = dvd_device or dvd_filelist

        if dvd_device:
            self.physicalDVD = True
        else:
            self.scanHotplug()

        self.dvd_filelist = dvd_filelist
        self.onFirstExecBegin.append(self.opened)
        self.service = None
        self.in_menu = False
        if fileExists("/proc/stb/fb/dst_left"):
            self.left = open("/proc/stb/fb/dst_left", "r").read()
            self.width = open("/proc/stb/fb/dst_width", "r").read()
            self.top = open("/proc/stb/fb/dst_top", "r").read()
            self.height = open("/proc/stb/fb/dst_height", "r").read()
            if self.left != "00000000" or self.top != "00000000" or self.width != "000002d0" or self.height != "0000000240":
                open("/proc/stb/fb/dst_left", "w").write("00000000")
                open("/proc/stb/fb/dst_width", "w").write("000002d0")
                open("/proc/stb/fb/dst_top", "w").write("00000000")
                open("/proc/stb/fb/dst_height", "w").write("0000000240")
                self.onClose.append(self.__restoreOSDSize)
示例#18
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")
示例#19
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["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:
			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"))
示例#20
0
文件: Weather.py 项目: vasilich07/xta
    def __init__(self, session):
        path = "/usr/lib/enigma2/python/Plugins/Extensions/iSkin/Skin/Weather.xml" 
        with open(path, "r") as f:
		self.skin = f.read()
		f.close() 	         	
        Screen.__init__(self, session)		
        self['lab1'] = Label(_('Retrieving data ...'))
        self['lab1b'] = Label('')
        self['lab2'] = Label('')
        self['lab3'] = Label('')
        self['lab4'] = Label('')
        self['lab4b'] = Label('')
        self['lab5'] = Pixmap()
        self['lab6'] = Label('')
        self['lab7'] = Label('')
        self['lab7b'] = Label('')
        self['lab8'] = Label('')
        self['lab8b'] = Label('')
        self['lab9'] = Label('')
        self['lab9b'] = Label('')
        self['lab10'] = Label('')
        self['lab10b'] = Label('')
        self['lab11'] = Label('')
        self['lab11b'] = Label('')
        self['lab12'] = Label('')
        self['lab12b'] = Label('')
        self['lab13'] = Label('')
        self['lab14'] = Label('')
        self['lab14b'] = Label('')
        self['lab15'] = Label('')
        self['lab15b'] = Label('')
        self['lab16'] = Label('')
        self['lab17'] = Pixmap()
        self['lab18'] = Label('')
        self['lab19'] = Label('')
        self['lab19b'] = Label('')
        self['lab20'] = Label('')
        self['lab20b'] = Label('')
        self['lab21'] = Label('')
        self['lab22'] = Pixmap()
        self['lab23'] = Label('')
        self['lab24'] = Label('')
        self['lab24b'] = Label('')
        self['lab25'] = Label('')
        self['lab25b'] = Label('')
        self['lab26'] = Label('')
        self['lab26b'] = Label('')
        self['lab27'] = Label('')
        self['lab27b'] = Label('')
        self['lab28'] = Pixmap()
        self['lab28a'] = Label('')
        self['lab28b'] = Label('')
        self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {
         'red': self.key_red,
         'back': self.close,
         'ok': self.close})
        self.activityTimer = eTimer()
        self.activityTimer.timeout.get().append(self.startConnection)
        self.onShow.append(self.startShow)
        self.onClose.append(self.delTimer)
        self.bhv = 2
示例#21
0
文件: BpSet.py 项目: kingvuplus/az-bh
    def __init__(self, session):
        Screen.__init__(self, session)

        self["lab1"] = Label(_("Activate Inadyn"))
        self["lactive"] = Pixmap()
        self["linactive"] = Pixmap()
        self["lab2"] = Label(_("Time Update in Minutes:"))
        self["labtime"] = Label()
        self["lab3"] = Label(_("Username:"******"labuser"] = Label()
        self["lab4"] = Label(_("Password:"******"labpass"] = Label()
        self["lab5"] = Label(_("Alias:"))
        self["labalias"] = Label()
        self["sactive"] = Pixmap()
        self["sinactive"] = Pixmap()
        self["lab6"] = Label(_("System:"))
        self["labsys"] = Label()
        self["lab7"] = Label(_("Status:"))
        self["labstop"] = Label(_("Stopped"))
        self["labrun"] = Label(_("Running !"))
        self["key_red"] = Label(_("Start"))
        self["key_green"] = Label(_("Show Log"))
        self["key_yellow"] = Label(_("Setup"))

        self["lactive"].hide()
        self["sactive"].hide()
        self["labrun"].hide()

        self["actions"] = ActionMap(
            ["WizardActions", "ColorActions"], {
                "ok": self.KeyOk,
                "back": self.close,
                "red": self.restartIna,
                "green": self.inaLog,
                "yellow": self.setupin
            })

        self.onLayoutFinish.append(self.updateIna)
示例#22
0
文件: plugin.py 项目: kingvuplus/bh-2
    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        InfoBarAudioSelection.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarNotifications.__init__(self)
        InfoBarBase.__init__(self)
        InfoBarScreenSaver.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)
        self.summary = None
        self.oldService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
        self.session.nav.stopService()

        self.playlistparsers = {}
        self.addPlaylistParser(PlaylistIOM3U, "m3u")
        self.addPlaylistParser(PlaylistIOPLS, "pls")
        self.addPlaylistParser(PlaylistIOInternal, "e2pls")

        # 'None' is magic to start at the list of mountpoints
        defaultDir = config.mediaplayer.defaultDir.getValue()
        self.filelist = FileList(
            defaultDir,
            matchingPattern=
            "(?i)^.*\.(mp2|mp3|ogg|ts|mts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|flv|mov|dts|3gp|3g2|asf|wmv|wma)",
            useServiceRef=True,
            additionalExtensions="4098:m3u 4098:e2pls 4098:pls")
        self["filelist"] = self.filelist

        self.playlist = MyPlayList()
        self.is_closing = False
        self.delname = ""
        self.playlistname = ""
        self["playlist"] = self.playlist

        self["PositionGauge"] = ServicePositionGauge(self.session.nav)

        self["currenttext"] = Label("")

        self["artisttext"] = Label(_("Artist") + ':')
        self["artist"] = Label("")
        self["titletext"] = Label(_("Title") + ':')
        self["title"] = Label("")
        self["albumtext"] = Label(_("Album") + ':')
        self["album"] = Label("")
        self["yeartext"] = Label(_("Year") + ':')
        self["year"] = Label("")
        self["genretext"] = Label(_("Genre") + ':')
        self["genre"] = Label("")
        self["coverArt"] = MediaPixmap()
        self["repeat"] = MultiPixmap()

        self.seek_target = None

        try:
            from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
            hotplugNotifier.append(self.hotplugCB)
        except Exception, ex:
            print "[MediaPlayer] No hotplug support", ex
示例#23
0
 def __init__(self,
              event,
              Ref,
              callback=None,
              similarEPGCB=None,
              parent=None):
     self.similarEPGCB = similarEPGCB
     self.cbFunc = callback
     self.currentService = Ref
     self.isRecording = (not Ref.ref.flags
                         & eServiceReference.isGroup) and Ref.ref.getPath()
     self.event = event
     self["Service"] = ServiceEvent()
     self["Event"] = Event()
     self["epg_eventname"] = ScrollLabel()
     self["epg_description"] = ScrollLabel()
     self["FullDescription"] = ScrollLabel()
     self["datetime"] = Label()
     self["channel"] = Label()
     self["duration"] = Label()
     if self['Event'] == StaticText:
         self["key_red"] = StaticText("")
     else:
         self["key_red"] = Button("")
     if similarEPGCB is not None:
         self.SimilarBroadcastTimer = eTimer()
         self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents)
     else:
         self.SimilarBroadcastTimer = None
     self.key_green_choice = self.ADD_TIMER
     if self.isRecording:
         if self["Event"] == StaticText:
             self["key_green"] = StaticText("")
         else:
             self["key_green"] = Button("")
     else:
         if self["Event"] == StaticText:
             self["key_green"] = StaticText(_("Add timer"))
         else:
             self["key_green"] = Button(_("Add timer"))
     if self["Event"] == StaticText:
         self["key_yellow"] = StaticText("")
         self["key_blue"] = StaticText("")
     else:
         self["key_yellow"] = Button("")
         self["key_blue"] = Button("")
     self["actions"] = ActionMap(
         ["OkCancelActions", "EventViewActions"], {
             "cancel": self.close,
             "ok": self.close,
             "pageUp": self.pageUp,
             "pageDown": self.pageDown,
             "prevEvent": self.prevEvent,
             "nextEvent": self.nextEvent,
             "timerAdd": self.timerAdd,
             "openSimilarList": self.openSimilarList,
             "contextMenu": self.doContext,
         })
     if parent and hasattr(parent, "fallbackTimer"):
         self.fallbackTimer = parent.fallbackTimer
         self.onLayoutFinish.append(self.onCreate)
     else:
         self.fallbackTimer = FallbackTimerList(self, self.onCreate)
示例#24
0
文件: plugin.py 项目: kingvuplus/bh-2
 def __init__(self, session, parent):
     Screen.__init__(self, session)
     self["text1"] = Label("Media player")
     self["text3"] = Label("")
     self["text4"] = Label("")
示例#25
0
    def __init__(self,
                 session,
                 text="",
                 filename="",
                 currDir=None,
                 bookmarks=None,
                 userMode=False,
                 windowTitle=_("Select location"),
                 minFree=None,
                 autoAdd=False,
                 editDir=False,
                 inhibitDirs=None,
                 inhibitMounts=None):
        # Init parents
        if not inhibitDirs:
            inhibitDirs = []
        if not inhibitMounts:
            inhibitMounts = []
        Screen.__init__(self, session)
        NumericalTextInput.__init__(self, handleTimeout=False)
        HelpableScreen.__init__(self)

        # Set useable chars
        self.setUseableChars(u'1234567890abcdefghijklmnopqrstuvwxyz')

        # Quickselect Timer
        self.qs_timer = eTimer()
        self.qs_timer.callback.append(self.timeout)
        self.qs_timer_type = 0

        # Initialize Quickselect
        self.curr_pos = -1
        self.quickselect = ""

        # Set Text
        self["text"] = Label(text)
        self["textbook"] = Label(_("Bookmarks"))

        # Save parameters locally
        self.text = text
        self.filename = filename
        self.minFree = minFree
        self.realBookmarks = bookmarks
        self.bookmarks = bookmarks and bookmarks.value[:] or []
        self.userMode = userMode
        self.autoAdd = autoAdd
        self.editDir = editDir
        self.inhibitDirs = inhibitDirs

        # Initialize FileList
        self["filelist"] = FileList(currDir,
                                    showDirectories=True,
                                    showFiles=False,
                                    inhibitMounts=inhibitMounts,
                                    inhibitDirs=inhibitDirs)

        # Initialize BookList
        self["booklist"] = MenuList(self.bookmarks)

        # Buttons
        self["key_green"] = Button(_("OK"))
        self["key_yellow"] = Button(_("Rename"))
        self["key_blue"] = Button(_("Remove bookmark"))
        self["key_red"] = Button(_("Cancel"))

        # Background for Buttons
        self["green"] = Pixmap()
        self["yellow"] = Pixmap()
        self["blue"] = Pixmap()
        self["red"] = Pixmap()

        # Initialize Target
        self["target"] = Label()
        self["targetfreespace"] = Label()

        if self.userMode:
            self.usermodeOn()

        # Custom Action Handler
        class LocationBoxActionMap(HelpableActionMap):
            def __init__(self, parent, context, actions=None, prio=0):
                if not actions:
                    actions = {}
                HelpableActionMap.__init__(self, parent, context, actions,
                                           prio)
                self.box = parent

            def action(self, contexts, action):
                # Reset Quickselect
                self.box.timeout(force=True)

                return HelpableActionMap.action(self, contexts, action)

        # Actions that will reset quickselect
        self["WizardActions"] = LocationBoxActionMap(self, "WizardActions", {
            "ok": (self.ok, _("select")),
            "back": (self.cancel, _("Cancel")),
        }, -2)

        self["DirectionActions"] = LocationBoxActionMap(
            self, "DirectionActions", {
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
            }, -2)

        self["ColorActions"] = LocationBoxActionMap(
            self, "ColorActions", {
                "red": self.cancel,
                "green": self.select,
                "yellow": self.changeName,
                "blue": self.addRemoveBookmark,
            }, -2)

        self["EPGSelectActions"] = LocationBoxActionMap(
            self, "EPGSelectActions", {
                "prevService":
                (self.switchToBookList, _("switch to bookmarks")),
                "nextService":
                (self.switchToFileList, _("switch to filelist")),
            }, -2)

        self["MenuActions"] = LocationBoxActionMap(self, "MenuActions", {
            "menu": (self.showMenu, _("menu")),
        }, -2)

        # Actions used by quickselect
        self["NumberActions"] = NumberActionMap(
            ["NumberActions"], {
                "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
            })

        # Run some functions when shown
        self.onShown.extend((
            boundFunction(self.setTitle, _("Select Location")),
            self.updateTarget,
            self.showHideRename,
        ))

        self.onLayoutFinish.append(self.switchToFileListOnStart)

        # Make sure we remove our callback
        self.onClose.append(self.disableTimer)
示例#26
0
    def __init__(self,
                 session,
                 epgConfig,
                 startBouquet=None,
                 startRef=None,
                 bouquets=None):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        self.epgConfig = epgConfig
        self.bouquets = bouquets
        self.originalPlayingServiceOrGroup = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        self.startBouquet = startBouquet
        self.startRef = startRef
        self.popupDialog = None
        self.closeRecursive = False
        self.eventviewDialog = None
        self.eventviewWasShown = False
        self.session.pipshown = False
        self.pipServiceRelation = getRelationDict(
        ) if plugin_PiPServiceRelation_installed else {}
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self["lab1"] = Label(_("Please wait while gathering EPG data..."))
        self["lab1"].hide()
        self["key_red"] = Button(_("IMDb Search"))
        self["key_green"] = Button(_("Add Timer"))
        self["key_yellow"] = Button(_("EPG Search"))
        self["key_blue"] = Button(_("Add AutoTimer"))

        helpDescription = _("EPG Commands")

        self["okactions"] = HelpableActionMap(
            self,
            "OkCancelActions", {
                "cancel": (self.closeScreen, _("Exit EPG")),
                "OK": (self.helpKeyAction("ok")),
                "OKLong": (self.helpKeyAction("oklong"))
            },
            prio=-1,
            description=helpDescription)

        self["colouractions"] = HelpableActionMap(
            self,
            "ColorActions", {
                "red": self.helpKeyAction("red"),
                "redlong": self.helpKeyAction("redlong"),
                "green": self.helpKeyAction("green"),
                "greenlong": self.helpKeyAction("greenlong"),
                "yellow": self.helpKeyAction("yellow"),
                "yellowlong": self.helpKeyAction("yellowlong"),
                "blue": self.helpKeyAction("blue"),
                "bluelong": self.helpKeyAction("bluelong")
            },
            prio=-1,
            description="EPG Commands")
        self._updateButtonText()

        self["recordingactions"] = HelpableActionMap(
            self,
            "InfobarInstantRecord", {
                "ShortRecord": self.helpKeyAction("rec"),
                "LongRecord": self.helpKeyAction("reclong")
            },
            prio=-1,
            description=helpDescription)
        self["epgactions"] = HelpableActionMap(self, "EPGSelectActions", {},
                                               -1)

        self.noAutotimer = _(
            "The AutoTimer plugin is not installed!\nPlease install it.")
        self.noEPGSearch = _(
            "The EPGSearch plugin is not installed!\nPlease install it.")
        self.noIMDb = _(
            "The IMDb plugin is not installed!\nPlease install it.")
        self.refreshTimer = eTimer()
        self.refreshTimer.timeout.get().append(self.refreshList)
        self.onLayoutFinish.append(self.onCreate)
示例#27
0
    def __init__(self, session):
        self.session = session
        Screen.__init__(self, self.session)
        ProtectedScreen.__init__(self)

        # Lets get a list of elements for the config list
        self.list = [
            getConfigListEntry(_("Enabled"),
                               config.plugins.KiddyTimer.enabled),
            getConfigListEntry(_("PIN"), config.plugins.KiddyTimer.pin),
            getConfigListEntry(_("Don't monitor TV started before"),
                               config.plugins.KiddyTimer.monitorStartTime),
            getConfigListEntry(_("Don't monitor TV started after"),
                               config.plugins.KiddyTimer.monitorEndTime),
            getConfigListEntry(_("Style of timer"),
                               config.plugins.KiddyTimer.timerStyle),
            getConfigListEntry(
                _("Timeout for activation dialog"),
                config.plugins.KiddyTimer.activationDialogTimeout)
        ]
        for i in range(0, 7):
            self.list.append(
                getConfigListEntry(
                    KTglob.DAYNAMES[i],
                    config.plugins.KiddyTimer.dayTimes[i].timeValue))

        ConfigListScreen.__init__(self, self.list)

        self["config"].list = self.list

        self.skin_path = KTglob.plugin_path
        self.kiddyTimerStopped = False

        # Plugin Information
        self.remainingTime = config.plugins.KiddyTimer.remainingTime.value
        sRemainingTime = KTglob.getTimeFromSeconds(self.remainingTime, True)

        self["PluginInfo"] = Label(
            _("Plugin: %(plugin)s , Version: %(version)s") %
            dict(plugin=KTglob.PLUGIN_BASE, version=KTglob.PLUGIN_VERSION))
        self["RemainingTime"] = Label(_("Remaining time: %s") % sRemainingTime)
        self["LastDayStarted"] = Label(
            _("Last day started: %s") %
            config.plugins.KiddyTimer.lastStartDay.getValue())

        # BUTTONS
        self["key_red"] = Button(_("Cancel"))
        self["key_green"] = Button(_("Save"))
        self["key_yellow"] = Button(_("Reset clock"))
        self["key_blue"] = Button(_("Move clock"))

        self["setupActions"] = NumberActionMap(
            ["SetupActions", "ColorActions"], {
                "save": self.save,
                "cancel": self.cancel,
                "green": self.save,
                "red": self.cancel,
                "ok": self.save,
                "blue": self.keyPositioner,
                "yellow": self.resetTimer
            }, -2)
示例#28
0
    def __init__(self, session):
        global emuDir
        emuDir = "/etc/"
        self.service = None
        Screen.__init__(self, session)

        self.skin = SOFTCAM_SKIN
        self.onShown.append(self.setWindowTitle)
        self.partyfeed = None
        self.YellowAction = REFRESH

        self.mlist = []
        self["key_green"] = Label(_("Restart"))
        self["key_red"] = Label(_("Stop"))
        self["key_yellow"] = Label(_("Refresh"))
        self.partyfeed = os.path.exists(
            "/etc/opkg/3rdparty-feed.conf") or os.path.exists(
                "/etc/opkg/3rd-party-feed.conf")
        if self.partyfeed:
            self["key_blue"] = Label(_("Install"))
        else:
            self["key_blue"] = Label(_("Exit"))
        self["ecminfo"] = Label(_("No ECM info"))
        self["actifcam"] = Label(_("no CAM 1 active"))
        self["actifcam2"] = Label(_("no CAM 2 active"))

        #// create listings
        self.emuDirlist = []
        self.emuList = []
        self.emuBin = []
        self.emuStart = []
        self.emuStop = []
        self.emuRgui = []
        self.emuDirlist = os.listdir(emuDir)
        self.ecmtel = 0
        self.first = 0
        global count
        count = 0
        #// check emu dir for config files
        print "************ go in the emuloop ************"
        for x in self.emuDirlist:
            #// if file contains the string "emu" (then this is a emu config file)
            if x.find("emu") > -1:
                self.emuList.append(emuDir + x)
                em = open(emuDir + x)
                self.emuRgui.append(0)
                #// read the emu config file
                for line in em.readlines():
                    line1 = line
                    #// startcam
                    line = line1
                    if line.find("startcam") > -1:
                        line = line.split("=")
                        self.emuStart.append(line[1].strip())

                    #// stopcam
                    line = line1
                    if line.find("stopcam") > -1:
                        line = line.split("=")
                        self.emuStop.append(line[1].strip())

                    #// Restart GUI
                    line = line1
                    if line.find("restartgui") > -1:
                        self.emuRgui[count] = 1

                    #// binname
                    line = line1
                    if line.find("binname") > -1:
                        line = line.split("=")
                        self.emuBin.append(line[1].strip())

                em.close()
                count += 1

        self.maxcount = count

        self.onChangedEntry = []
        self.list = []
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=self.session,
                                  on_change=self.changedEntry)
        self.ReadMenu()
        self.createSetup()
        self["ecminfo"].show()

        self.read_shareinfo()
        self.Timer = eTimer()
        self.Timer.callback.append(self.layoutFinished)
        self.Timer.start(2000, True)
        #// get the remote buttons
        self["actions"] = ActionMap(
            ["OkCancelActions", "DirectionActions", "ColorActions"], {
                "cancel": self.Exit,
                "ok": self.ok,
                "blue": self.Blue,
                "red": self.Red,
                "green": self.Green,
                "yellow": self.Yellow,
            }, -1)
        #// update screen
        self.onLayoutFinish.append(self.layoutFinished)
示例#29
0
 def __init__(self,
              session,
              text,
              type=TYPE_YESNO,
              timeout=0,
              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,
              title=None):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     if text:
         self.text = _(text)
     else:
         self.text = text
     if type in range(self.TYPE_MESSAGE + 1):
         self.type = type
     else:
         self.type = self.TYPE_MESSAGE
     self.timeout = int(timeout)
     self.close_on_any_key = close_on_any_key
     if enable_input:
         self["actions"] = HelpableActionMap(
             self,
             ["MsgBoxActions", "DirectionActions"],
             {
                 "cancel": (self.cancel, _("Cancel the selection")),
                 "ok": (self.ok, _("Accept the current selection")),
                 "alwaysOK": (self.alwaysOK, _("Always select OK")),
                 "up": (self.up, _("Move up a line")),
                 "down": (self.down, _("Move down a line")),
                 "left": (self.left, _("Move up a page")),
                 "right": (self.right, _("Move down a page"))
                 # These actions are *ONLY* defined on OpenPLi!
                 # I don't believe thay add any functionality even for OpenPLi.
                 # "upRepeated": (self.up, _("Move up a line repeatedly")),
                 # "downRepeated": (self.down, _("Move down a line repeatedly")),
                 # "leftRepeated": (self.left, _("Move up a page repeatedly")),
                 # "rightRepeated": (self.right, _("Move down a page repeatedly"))
             },
             prio=-1,
             description=_("MessageBox Functions"))
     self.msgBoxID = msgBoxID
     # These six lines can go with new skins that only use self["icon"]...
     self["QuestionPixmap"] = Pixmap()
     self["QuestionPixmap"].hide()
     self["InfoPixmap"] = Pixmap()
     self["InfoPixmap"].hide()
     self["ErrorPixmap"] = Pixmap()
     self["ErrorPixmap"].hide()
     self["icon"] = MultiPixmap()
     self["icon"].hide()
     self.picon = picon
     if picon:
         # These five lines can go with new skins that only use self["icon"]...
         if self.type == self.TYPE_YESNO:
             self["QuestionPixmap"].show()
         elif self.type == self.TYPE_INFO:
             self["InfoPixmap"].show()
         elif self.type == self.TYPE_ERROR:
             self["ErrorPixmap"].show()
         self["icon"].show()
     self.skinName = ["MessageBox"]
     if simple:
         self.skinName = ["MessageBoxSimple"]
     if wizard:
         self["rc"] = MultiPixmap()
         self["rc"].setPixmapNum(config.misc.rcused.value)
         self.skinName = ["MessageBoxWizard"]
     if not skin_name:
         skin_name = []
     if isinstance(skin_name, str):
         self.skinName = [skin_name] + self.skinName
     if not list:
         list = []
     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.timeout_default = timeout_default
     self.baseTitle = title
     self.activeTitle = None
     # DEBUG: This is a temporary patch to stop the VuRemote and GigaBlueRemote plugins from crashing!
     # If this code is accepted then the offending lines from the plugins can safely be removed.
     self.timerRunning = None  # DEBG: See note above!
     self["text"] = Label(self.text)
     self["Text"] = StaticText(self.text)  # What is self["Text"] for?
     self["selectedChoice"] = StaticText()
     self["list"] = MenuList(self.list)
     if self.list:
         self["selectedChoice"].setText(self.list[0][0])
     else:
         self["list"].hide()
     self["key_help"] = StaticText(_("HELP"))
     self.timer = eTimer()
     self.timer.callback.append(self.processTimer)
     if self.layoutFinished not in self.onLayoutFinish:
         self.onLayoutFinish.append(self.layoutFinished)
示例#30
0
    def __init__(self, session):
        Screen.__init__(self, session)
        if config.usage.show_infobar_lite.getValue(
        ) and config.skin.primary_skin.getValue(
        ) == "DMConcinnity-HD/skin.xml":
            self.skinName = "InfoBarLite"

        self["actions"] = HelpableActionMap(
            self,
            "InfobarActions", {
                "showMovies": (self.showMovies, _("Play recorded movies...")),
                "showRadio":
                (self.showRadioButton, _("Show the radio player...")),
                "showTv": (self.showTvButton, _("Show the tv player...")),
                "toogleTvRadio":
                (self.toogleTvRadio, _("toggels betwenn tv and radio...")),
                "openBouquetList":
                (self.openBouquetList, _("open bouquetlist")),
                "showMediaPlayer":
                (self.showMediaPlayer, _("Show the media player...")),
                "openTimerList":
                (self.openTimerList, _("Show the tv player...")),
                "openAutoTimerList":
                (self.openAutoTimerList, _("Show the tv player...")),
                "openEPGSearch":
                (self.openEPGSearch, _("Show the tv player...")),
                "openIMDB": (self.openIMDB, _("Show the tv player...")),
                "showMC":
                (self.showMediaCenter, _("Show the media center...")),
                "openSleepTimer":
                (self.openPowerTimerList, _("Show the Sleep Timer...")),
                'ZoomInOut': (self.ZoomInOut, _('Zoom In/Out TV...')),
                'ZoomOff': (self.ZoomOff, _('Zoom Off...')),
                'HarddiskSetup': (self.HarddiskSetup, _('Select HDD')),
                "showWWW": (self.showPORTAL, _("Open MediaPortal...")),
                "showSetup": (self.showSetup, _("Show setup...")),
                "showFormat": (self.showFormat, _("Show Format Setup...")),
                "showPluginBrowser":
                (self.showPluginBrowser, _("Show the plugins...")),
                "showBoxPortal": (self.showBoxPortal, _("Show Box Portal...")),
            },
            prio=2)

        self["key_red"] = Label()
        self["key_yellow"] = Label()
        self["key_blue"] = Label()
        self["key_green"] = Label()

        self.allowPiP = True
        self.radioTV = 0

        for x in HelpableScreen, \
          InfoBarBase, InfoBarShowHide, \
          InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, \
          InfoBarInstantRecord, InfoBarAudioSelection, InfoBarRedButton, InfoBarTimerButton, InfoBarUnhandledKey, InfoBarINFOpanel, InfoBarResolutionSelection, InfoBarVmodeButton, \
          InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, InfoBarAspectSelection, \
          InfoBarTimeshift, InfoBarSeek, InfoBarCueSheetSupport, InfoBarSummarySupport, InfoBarTimeshiftState, \
          InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, InfoBarQuickMenu, InfoBarZoom, \
          InfoBarPlugins, InfoBarServiceErrorPopupSupport:
            x.__init__(self)

        self.helpList.append(
            (self["actions"], "InfobarActions", [("showMovies",
                                                  _("Watch recordings..."))]))
        self.helpList.append((self["actions"], "InfobarActions",
                              [("showRadio", _("Listen to the radio..."))]))

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                enigma.iPlayableService.evUpdatedEventInfo:
                self.__eventInfoChanged
            })

        self.current_begin_time = 0
        assert InfoBar.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
        InfoBar.instance = self
        self.zoomrate = 0
        self.zoomin = 1

        self.onShow.append(self.doButtonsCheck)