コード例 #1
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.hardware_info = HardwareInfo()
		self.device=self.hardware_info.get_device_name()
		self.mac=getMacAddress()
		self.mac_end=self.mac[6:]
		self.dreamIRCconf = ConfigSubsection()
		self.reloadFile()
		list = []
		list.append(getConfigListEntry(_('Nickname'), self.dreamIRCconf.nick))      
		if config.usage.setup_level.index > 1: # advanced
			list.append(getConfigListEntry(_('Passwd'), self.dreamIRCconf.passwd))      
		if config.usage.setup_level.index >= 1: # intermediate+
			list.append(getConfigListEntry(_('Server1'), self.dreamIRCconf.server1))      
		if config.usage.setup_level.index > 1: # advanced
			list.append(getConfigListEntry(_('Server2'), self.dreamIRCconf.server2))      
			list.append(getConfigListEntry(_('Server3'), self.dreamIRCconf.server3))      
		if config.usage.setup_level.index >= 1: # intermediate+
			list.append(getConfigListEntry(_('Port'), self.dreamIRCconf.port))          
		list.append(getConfigListEntry(_('Channel'), self.dreamIRCconf.channel))    
		if config.usage.setup_level.index > 1: # i
			list.append(getConfigListEntry(_('Debug'), self.dreamIRCconf.debug))        

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))

		ConfigListScreen.__init__(self, list)                                     
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
				{
						"green": self.saveAndExit,
						"red": self.dontSaveAndExit,
						"cancel": self.dontSaveAndExit
				}, -1)
コード例 #2
0
ファイル: Recordings.py プロジェクト: Huevos/enigma2
	def __init__(self, session, menu_path=""):
		Screen.__init__(self, session)
		self.skinName = "Setup"
		self.menu_path = menu_path
		self["menu_path_compressed"] = StaticText()
		self['footnote'] = Label()
		self["HelpWindow"] = Pixmap()
		self["HelpWindow"].hide()
		self["VKeyIcon"] = Boolean(False)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["description"] = Label(_(""))

		self.onChangedEntry = [ ]
		self.setup = "recording"
		list = []
		ConfigListScreen.__init__(self, list, session = session, on_change = self.changedEntry)
		self.createSetup()

		self["setupActions"] = ActionMap(["SetupActions", "ColorActions", "MenuActions"],
		{
			"green": self.keySave,
			"red": self.keyCancel,
			"cancel": self.keyCancel,
			"ok": self.ok,
			"menu": self.closeRecursive,
		}, -2)
		self.onLayoutFinish.append(self.layoutFinished)
コード例 #3
0
ファイル: ButtonSetup.py プロジェクト: rimasx/enigma2
	def __init__(self, session, menu_path="", args=None):
		Screen.__init__(self, session)
		screentitle = _("Button setup")
		if config.usage.show_menupath.value == 'large':
			menu_path += screentitle
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)
		self['description'] = Label(_('On your remote, click on the button you want to change'))
		self.session = session
		self.list = []
		self.ButtonSetupFunctions = getButtonSetupFunctions()
		for x in ButtonSetupKeys:
			self.list.append(ChoiceEntryComponent('',(_(x[0]), x[1])))
		self["list"] = ChoiceList(list=self.list[:config.misc.ButtonSetup.additional_keys.value and len(ButtonSetupKeys) or 10], selection = 0)
		self["choosen"] = ChoiceList(list=[])
		self.getFunctions()
		self["actions"] = ActionMap(["OkCancelActions"],
		{
			"cancel": self.close,
		}, -1)
		self["ButtonSetupButtonActions"] = ButtonSetupActionMap(["ButtonSetupActions"], dict((x[1], self.ButtonSetupGlobal) for x in ButtonSetupKeys))
		self.longkeyPressed = False
		self.onLayoutFinish.append(self.__layoutFinished)
		self.onExecBegin.append(self.getFunctions)
		self.onShown.append(self.disableKeyMap)
		self.onClose.append(self.enableKeyMap)
コード例 #4
0
ファイル: setup.py プロジェクト: kingvuplus/ME-OTHER
	def __init__(self, session, entry):
		Screen.__init__(self, session)
		self.title = _("WeatherPlugin: Edit Entry")
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"green": self.keySave,
			"red": self.keyCancel,
			"blue": self.keyDelete,
			"yellow": self.searchLocation,
			"cancel": self.keyCancel
		}, -2)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["key_blue"] = StaticText(_("Delete"))
		self["key_yellow"] = StaticText(_("Search Code"))

		if entry is None:
			self.newmode = 1
			self.current = initWeatherPluginEntryConfig()
		else:
			self.newmode = 0
			self.current = entry

		cfglist = [
			getConfigListEntry(_("City"), self.current.city),
			getConfigListEntry(_("Location code"), self.current.weatherlocationcode),
			getConfigListEntry(_("System"), self.current.degreetype)
		]

		ConfigListScreen.__init__(self, cfglist, session)
コード例 #5
0
ファイル: Recordings.py プロジェクト: Huevos/enigma2
	def __init__(self, session, parent):
		Screen.__init__(self, session, parent = parent)
		self["SetupTitle"] = StaticText(_(parent.setup_title))
		self["SetupEntry"] = StaticText("")
		self["SetupValue"] = StaticText("")
		self.onShow.append(self.addWatcher)
		self.onHide.append(self.removeWatcher)
コード例 #6
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.session = session
		self.setup_title = _("AutoBouquetsMaker Configure")
		Screen.setTitle(self, self.setup_title)

		self.onChangedEntry = [ ]
		self.list = []
		ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry)

		self.activityTimer = eTimer()
		self.activityTimer.timeout.get().append(self.prepare)

		self["actions"] = ActionMap(["SetupActions", 'ColorActions', 'VirtualKeyboardActions', "MenuActions"],
		{
			"ok": self.keySave,
			"cancel": self.keyCancel,
			"red": self.keyCancel,
			"green": self.keySave,
			"menu": self.keyCancel,
		}, -2)

		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("OK"))
		self["description"] = Label(_(""))
		self["pleasewait"] = Label()

		self.onLayoutFinish.append(self.populate)
コード例 #7
0
ファイル: Satconfig.py プロジェクト: HasBahCa/enigma2
	def __init__(self, session, slotid):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Tuner settings"))
		self.list = [ ]

		ServiceStopScreen.__init__(self)
		self.stopService()

		ConfigListScreen.__init__(self, self.list)

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

		self["actions"] = ActionMap(["SetupActions", "SatlistShortcutAction", "ColorActions"],
		{
			"ok": self.keySave,
			"cancel": self.keyCancel,
			"nothingconnected": self.nothingConnectedShortcut,
			"red": self.keyCancel,
			"green": self.keySave,
		}, -2)

		self.slotid = slotid
		self.nim = nimmanager.nim_slots[slotid]
		self.nimConfig = self.nim.config
		self.createConfigMode()
		self.createSetup()
コード例 #8
0
    def __init__(self, session, args = None):
        #self.skin = CurlyTx.skin
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        #self.skinName = [ "CurlyTx", "Setup" ]

        self["text"] = ScrollLabel("foo")

        self["key_red"]    = StaticText(_("Settings"))
        self["key_green"]  = StaticText(_("Reload"))
        self["key_yellow"] = StaticText(_("Prev"))
        self["key_blue"]   = StaticText(_("Next"))


        self["actions"] = ActionMap(
            ["WizardActions", "ColorActions", "InputActions", "InfobarEPGActions"], {
                "ok":   self.close,
                "back": self.close,
                "up":   self.pageUp,
                "down": self.pageDown,

                "red":    self.showSettings,
                "green":  self.reload,
                "yellow": self.prevPage,
                "blue":   self.nextPage,

                "showEventInfo": self.showHeader
            }, -1)

        self.loadHelp()
        self.loadButtons()
        self.onLayoutFinish.append(self.afterLayout)
コード例 #9
0
	def __init__(self, session, defaultUser):
		Screen.__init__(self, session)
		self.session = session
		self.userlist = YouTubeUserList()
		self.defaultUser = defaultUser

		self["label_info"] = Label(_("To use the selected feature you have to login to YouTube. Select a user-profile to login!"))
		self["userlist"] = self.userlist
		self["key_red"] = Button(_("delete user"))
		self["key_green"] = Button(_("add user"))
		self["key_yellow"] = Button(_("edit user"))
		self["key_blue"] = Button(_("set default"))

		self["actions"] = ActionMap(["YouTubeUserListScreenActions"],
		{
			"delete": 	self.keyDelete,
			"add": 		self.keyAddUser,
			"edit": 	self.keyEditUser,
			"default":	self.keySetAsDefault,
			
			"ok":		self.ok,
			"cancel": 	self.close,
			"up": 		self.up,
			"down": 	self.down,
			"left": 	self.left,
			"right": 	self.right,
		}, -2)
		
		self.onLayoutFinish.append(self.initialUserlistUpdate)
コード例 #10
0
	def __init__(self, session):
		self.skin = magicBackupPanel_Step3_Skin
		Screen.__init__(self, session)
		self['status'] = MultiPixmap()
		self['status'].setPixmapNum(0)
		self['label'] = Label('')
		self.mylist = ['Libraries', 'Firmwares', 'Binaries', 'SoftCams', 'Scripts', 'Bootlogos', 'Uninstall files', 'General Settings', 'Cron', 'Settings Channels Bouquets', 'Openvpn', 'Satellites Terrestrial', 'Plugins', 'END']
		self.mytmppath = '/media/hdd/'
		if fileExists('/etc/magic/.magicbackup_location'):
			fileExists('/etc/magic/.magicbackup_location')
			f = open('/etc/magic/.magicbackup_location', 'r')
			self.mytmppath = f.readline().strip()
			f.close()
		else:
			fileExists('/etc/magic/.magicbackup_location')
		self.mytmppath += 'magicbackup_location'
		self.activityTimer = eTimer()
		self.activityTimer.timeout.get().append(self.updatepix)
		self.onShow.append(self.startShow)
		self.onClose.append(self.delTimer)
		system('rm -rf ' + self.mytmppath)
		system('mkdir ' + self.mytmppath)
		system('mkdir ' + self.mytmppath + '/etc')
		system('mkdir ' + self.mytmppath + '/lib')
		system('mkdir ' + self.mytmppath + '/usr')
		system('mkdir ' + self.mytmppath + '/scripts')
		system('mkdir ' + self.mytmppath + '/media')
		system('mkdir ' + self.mytmppath + '/media/hdd')
		system('mkdir ' + self.mytmppath + '/media/usb')
		system('mkdir ' + self.mytmppath + '/media/usb2')
		system('mkdir ' + self.mytmppath + '/media/usb3')
		configfile.save()
コード例 #11
0
    def __init__(self, session, timer):
        Screen.__init__(self, session)
        self.skinName = "TimerLog"
        self.timer = timer
        self.log_entries = self.timer.log_entries[:]

        self.fillLogList()

        self["loglist"] = MenuList(self.list)
        self["logentry"] = Label()
        self["summary_description"] = StaticText("")

        self["key_red"] = Button(_("Delete entry"))
        self["key_green"] = Button()
        self["key_yellow"] = Button("")
        self["key_blue"] = Button(_("Clear log"))

        self.onShown.append(self.updateText)

        self["actions"] = NumberActionMap(
            ["OkCancelActions", "DirectionActions", "ColorActions"],
            {
                "ok": self.keyClose,
                "cancel": self.keyClose,
                "up": self.up,
                "down": self.down,
                "left": self.left,
                "right": self.right,
                "red": self.deleteEntry,
                "blue": self.clearLog,
            },
            -1,
        )
        self.setTitle(_("PowerManager log"))
コード例 #12
0
ファイル: BackupRestore.py プロジェクト: Antonio-Team/enigma2
	def __init__(self, session):
		Screen.__init__(self, session)
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["key_yellow"] = StaticText()

		self.selectedFiles = config.plugins.configurationbackup.backupdirs.value
		defaultDir = '/'
		inhibitDirs = ["/bin", "/boot", "/dev", "/autofs", "/lib", "/proc", "/sbin", "/sys", "/hdd", "/tmp", "/mnt", "/media"]
		self.filelist = MultiFileSelectList(self.selectedFiles, defaultDir, inhibitDirs = inhibitDirs )
		self["checkList"] = self.filelist

		self["actions"] = ActionMap(["DirectionActions", "OkCancelActions", "ShortcutActions"],
		{
			"cancel": self.exit,
			"red": self.exit,
			"yellow": self.changeSelectionState,
			"green": self.saveSelection,
			"ok": self.okClicked,
			"left": self.left,
			"right": self.right,
			"down": self.down,
			"up": self.up
		}, -1)
		if not self.selectionChanged in self["checkList"].onSelectionChanged:
			self["checkList"].onSelectionChanged.append(self.selectionChanged)
		self.onLayoutFinish.append(self.layoutFinished)
コード例 #13
0
ファイル: BackupRestore.py プロジェクト: Antonio-Team/enigma2
	def __init__(self, session, plugin_path):
		Screen.__init__(self, session)
		self.skin_path = plugin_path

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Restore"))
		self["key_yellow"] = StaticText(_("Delete"))

		self.sel = []
		self.val = []
		self.entry = False
		self.exe = False

		self.path = ""

		self["actions"] = NumberActionMap(["SetupActions"],
		{
			"ok": self.KeyOk,
			"cancel": self.keyCancel
		}, -1)

		self["shortcuts"] = ActionMap(["ShortcutActions"],
		{
			"red": self.keyCancel,
			"green": self.KeyOk,
			"yellow": self.deleteFile,
		})
		self.flist = []
		self["filelist"] = MenuList(self.flist)
		self.fill_list()
		self.onLayoutFinish.append(self.layoutFinished)
コード例 #14
0
ファイル: OTTMenu.py プロジェクト: miraclebox-git/stb-mbgui
	def __init__(self, session, timerinstance):
		self.session = session
		self.list = []
		self.timerinstance = timerinstance
		self.remotetimer_old = config.ipboxclient.remotetimers.value
		
		Screen.__init__(self, session)
		ConfigListScreen.__init__(self, self.list)
		
		self.setTitle(_('IPTV Client'))
		
		self["VKeyIcon"] = Boolean(False)
		self["text"] = StaticText(_('NOTE: the remote HDD feature require samba installed on server box.'))
		self["key_red"] = Button(_('Cancel'))
		self["key_green"] = Button(_('Save'))
		self["key_yellow"] = Button(_('Scan'))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"cancel": self.keyCancel,
			"red": self.keyCancel,
			"green": self.keySave,
			"yellow": self.keyScan
		}, -2)
		
		self.populateMenu()
		
		if not config.ipboxclient.firstconf.value:
			self.timer = eTimer()
			self.timer.callback.append(self.scanAsk)
			self.timer.start(100)
コード例 #15
0
ファイル: ProjectSettings.py プロジェクト: Anubisko/enigma2
	def __init__(self, session, project = None):
		Screen.__init__(self, session)
		self.project = project
		
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["key_yellow"] = StaticText(_("Load"))
		if config.usage.setup_level.index >= 2: # expert+
			self["key_blue"] = StaticText(_("Save"))
		else:
			self["key_blue"] = StaticText()
		
		if config.usage.setup_level.index >= 2: # expert+
			infotext = _("Available format variables") + ":\n$i=" + _("Track") + ", $t=" + _("Title") + ", $d=" + _("Description") + ", $l=" + _("length") + ", $c=" + _("chapters") + ",\n" + _("Record") + " $T=" + _("Begin time") + ", $Y=" + _("Year") + ", $M=" + _("month") + ", $D=" + _("day") + ",\n$A=" + _("audio tracks") + ", $C=" + _("Channel") + ", $f=" + _("filename")
		else:
			infotext = ""
		self["info"] = StaticText(infotext)

		self.keydict = {}
		self.settings = project.settings
		ConfigListScreen.__init__(self, [])
		self.initConfigList()
		
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
		{
		    "green": self.exit,
		    "red": self.cancel,
		    "blue": self.saveProject,
		    "yellow": self.loadProject,
		    "cancel": self.cancel,
		    "ok": self.ok,
		}, -2)
		self.onLayoutFinish.append(self.layoutFinished)
コード例 #16
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setup_title = _("Blind scan for dreambox DVB-S2 tuners")
		Screen.setTitle(self, _(self.setup_title))
		self.updateSatList()
		self.service = session.nav.getCurrentService()
		self.feinfo = None
		frontendData = None
		if self.service is not None:
			self.feinfo = self.service.frontendInfo()
			frontendData = self.feinfo and self.feinfo.getAll(True)
		self.createConfig(frontendData)
		del self.feinfo
		del self.service
		try:
			self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		except:
			self.session.postScanService = self.session.nav.getCurrentlyPlayingServiceReference()

		self["actions"] = NumberActionMap(["SetupActions"],
		{
			"ok": self.keyGo,
			"cancel": self.keyCancel,
		}, -2)

		self.list = []
		ConfigListScreen.__init__(self, self.list)
		if not self.scan_nims.value == "":
			self.createSetup()
			self["introduction"] = Label(_("Press OK to start the scan"))
		else:
			self["introduction"] = Label(_("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."))
コード例 #17
0
	def __init__(self, session, fe_num, text):
		Screen.__init__(self, session)
		self.setup_title = _("Blind scan state")
		Screen.setTitle(self, _(self.setup_title))
		self["list"]=List()
		self["text"]=Label()
		self["text"].setText(text)
		self["post_action"]=Label()
		self["progress"]=Label()
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"ok": self.keyOk,
			"cancel": self.keyCancel,
			"green": self.keyGreen,
		}, -2)
		self.fe_num = fe_num
		self["constellation"] = CanvasSource()
		self.onLayoutFinish.append(self.updateConstellation)
		self.tmr = eTimer()
		self.tmr.callback.append(self.updateConstellation)
		self.constellation_supported = None
		if fe_num != -1:
			self.post_action=1
			self.finished=0
			self.keyGreen()
		else:
			self.post_action=-1
コード例 #18
0
ファイル: plugin.py プロジェクト: hd75hd/enigma2-plugins
    def __init__(self, session, ref):
        Screen.__init__(self, session)
        self.session = session
        self["actions"] = HelpableActionMap(
            self, "MoviePlayerActions", {"leavePlayer": (self.leavePlayer, _("leave movie player..."))}
        )

        if config.plugins.yttrailer.close_player_with_exit.value:
            self["closeactions"] = HelpableActionMap(
                self, "WizardActions", {"back": (self.close, _("leave movie player..."))}
            )

        self.allowPiP = False
        for x in (
            InfoBarShowHide,
            InfoBarBase,
            InfoBarSeek,
            InfoBarAudioSelection,
            InfoBarNotifications,
            InfoBarServiceNotifications,
            InfoBarPVRState,
            InfoBarMoviePlayerSummarySupport,
        ):
            x.__init__(self)

        self.returning = False
        self.skinName = "MoviePlayer"
        self.lastservice = session.nav.getCurrentlyPlayingServiceReference()
        self.session.nav.playService(ref)
        self.onClose.append(self.__onClose)
コード例 #19
0
ファイル: plugin.py プロジェクト: Atsilla/enigma2-1
	def __init__(self, session, list, selected_caids):

		Screen.__init__(self, session)

		self.list = SelectionList()
		self["list"] = self.list

		for listindex in range(len(list)):
			if find_in_list(selected_caids,list[listindex][0],0):
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, True)
			else:
				self.list.addSelection(list[listindex][0], list[listindex][1], listindex, False)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["introduction"] = StaticText(_("Press OK to select/deselect a CAId."))

		self["actions"] = ActionMap(["ColorActions","SetupActions"],
		{
			"ok": self.list.toggleSelection, 
			"cancel": self.cancel, 
			"green": self.greenPressed,
			"red": self.cancel
		}, -1)
		self.onShown.append(self.setWindowTitle)
コード例 #20
0
	def __init__(self, session, userSatlist=""):
		Screen.__init__(self, session)
		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("Save"))
		self["key_yellow"] = Button(_("Sort by"))
		self["key_blue"] = Button(_("Select all"))
		self["hint"] = Label(_("Press OK to toggle the selection"))
		SatList = []
		if not isinstance(userSatlist, str):
			userSatlist = ""
		else:
			userSatlist = userSatlist.replace("]", "").replace("[", "")
		for sat in nimmanager.getSatList():
			selected = False
			sat_str = str(sat[0])
			if userSatlist and ("," not in userSatlist and sat_str == userSatlist) or ((', ' + sat_str + ',' in userSatlist) or (userSatlist.startswith(sat_str + ',')) or (userSatlist.endswith(', ' + sat_str))):
				selected = True
			SatList.append((sat[0], sat[1], sat[2], selected))
		sat_list = [SelectionEntryComponent(x[1], x[0], x[2], x[3]) for x in SatList]
		self["list"] = SelectionList(sat_list, enableWrapAround=True)
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"yellow": self.sortBy,
			"blue": self["list"].toggleAllSelection,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self["list"].toggleSelection,
		}, -2)
		self.setTitle(_("Select satellites"))
コード例 #21
0
ファイル: VideoMode.py プロジェクト: Tsakman/enigma2
	def __init__(self, session):
		Screen.__init__(self, session)
		# for the skin: first try VideoSetup, then Setup, this allows individual skinning
		self.skinName = ["VideoSetup", "Setup" ]
		self.setup_title = _("Video settings")
		self["HelpWindow"] = Pixmap()
		self["HelpWindow"].hide()
		self["VKeyIcon"] = Boolean(False)
		self['footnote'] = Label()

		self.hw = iAVSwitch
		self.onChangedEntry = [ ]

		# handle hotplug by re-creating setup
		self.onShow.append(self.startHotplug)
		self.onHide.append(self.stopHotplug)

		self.list = [ ]
		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)

		from Components.ActionMap import ActionMap
		self["actions"] = ActionMap(["SetupActions", "MenuActions", "ColorActions"],
			{
				"cancel": self.keyCancel,
				"save": self.apply,
				"menu": self.closeRecursive,
			}, -2)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["description"] = Label("")

		self.createSetup()
		self.grabLastGoodMode()
		self.onLayoutFinish.append(self.layoutFinished)
コード例 #22
0
	def __init__(self, session, args = 0):
		self.session = session
		Screen.__init__(self, session)

		self.list = []
		self.list.append(getConfigListEntry(_("NAS/Server Name or IP"), config.plugins.elektro.NASname))
		self.list.append(getConfigListEntry(_("Username"), config.plugins.elektro.NASuser))
		self.list.append(getConfigListEntry(_("Password"), config.plugins.elektro.NASpass))
		self.list.append(getConfigListEntry(_("Command [poweroff, shutdown -h,...]"), config.plugins.elektro.NAScommand))
		self.list.append(getConfigListEntry(_("Telnet Port"), config.plugins.elektro.NASport))
		self.list.append(getConfigListEntry(_("Waiting until poweroff"), config.plugins.elektro.NASwait))

		ConfigListScreen.__init__(self, self.list)

		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("Ok"))
		self["key_yellow"] = Button(_("Run"))
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"yellow": self.run,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self.save,
		}, -2)
コード例 #23
0
	def __init__(self, session, plugin_path):
		self.skin_path = plugin_path
		Screen.__init__(self, session)

		self.list = [ ]
		self.onChangedEntry = [ ]
		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)

		self.setup_title = _("Setup AnalogClock")
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.keyCancel,
				"red": self.keyCancel,
				"green": self.keySave,
				"ok": self.keySave,
				"blue": self.keyBlue,
			}, -2)

		self["key_green"] = Label(_("Ok"))
		self["key_red"] = Label(_("Cancel"))

		self["red"] = Pixmap()
		self["green"] = Pixmap()
		self["blue"] = Pixmap()

		self.changeItemsTimer = eTimer()
		self.changeItemsTimer.timeout.get().append(self.changeItems)

		self.enable = _("Enable AnalogClock")
		self.itemSize = _("Size")
		self.itemXpos = _("X Position")
		self.itemYpos = _("Y Position")
		self.extended = _("Extended settings")

		self.onLayoutFinish.append(self.layoutFinished)
コード例 #24
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(_("Only poll while in standby"), config.plugins.autotimer.onlyinstandby, _("When this is enabled AutoTimer will ONLY check for new events whilst in stanadby.")),
				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(_("Poll Interval (in mins)"), config.plugins.autotimer.interval, _("This is the delay in minutes 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 plugin browser"), config.plugins.autotimer.show_in_plugins, _("Enable this to be able to access the AutoTimer Overview from within the plugin browser.")),
				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.")),
				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(_("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 a recording is in progress.")),
			],
			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.Save,
			}
		)

		# Trigger change
		self.changed()

		self.onLayoutFinish.append(self.setCustomTitle)
コード例 #25
0
	def __init__(self, session, plugin_path):
		self.skin_path = plugin_path
		Screen.__init__(self, session)

		self.list = [ ]
		self.onChangedEntry = [ ]
		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedClockEntry)

		self.setup_title = _("Setup AnalogClock colors")
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.keyCancel,
				"red": self.keyCancel,
				"green": self.keySave,
				"ok": self.keySave,
			}, -2)

		self["key_green"] = Label(_("Ok"))
		self["key_red"] = Label(_("Cancel"))
		self["version"] = Label("v%s" % VERSION)

		cfg.background.value[0] = int(cfg.transparency.value)
		self.background = _("Background (a,r,g,b)")
		self.list.append(getConfigListEntry(_("Hand's color (a,r,g,b)"), cfg.hands_color))
		self.list.append(getConfigListEntry(_("Seconds color (a,r,g,b)"), cfg.shand_color))
		self.list.append(getConfigListEntry(_("Face's color (a,r,g,b)"), cfg.faces_color))
		self.list.append(getConfigListEntry( self.background, cfg.background))

		self["config"].list = self.list
		self["config"].setList(self.list)

		self.onLayoutFinish.append(self.layoutFinished)
コード例 #26
0
ファイル: PluginBrowser.py プロジェクト: Venom83/openNFR-gui
	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Plugin Browser"))

		self.firsttime = True

		self["key_red"] = Button(_("Remove plugins"))
		self["key_green"] = Button(_("Download plugins"))

		self.list = []
		self["list"] = PluginList(self.list)
		if config.usage.sort_pluginlist.getValue():
			self["list"].list.sort()

		self["actions"] = ActionMap(["WizardActions", "MenuActions"],
		{
			"ok": self.save,
			"back": self.close,
			"menu": self.openSetup,
		})
		self["PluginDownloadActions"] = ActionMap(["ColorActions"],
		{
			"red": self.delete,
			"green": self.download
		})

		self.onFirstExecBegin.append(self.checkWarnings)
		self.onShown.append(self.updateList)
		self.onChangedEntry = []
		self["list"].onSelectionChanged.append(self.selectionChanged)
		self.onLayoutFinish.append(self.saveListsize)
コード例 #27
0
ファイル: ui.py プロジェクト: ambrosa/test
	def __init__(self, session):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions"],
		{
			"cancel": self.KeyExit,
			"red": self.KeyExit,
			"green": self.KeyGreen,
			"yellow": self.KeyYellow,
			"blue": self.KeyBlue,
			"ok": self.KeyOk
		}, -1)

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Thumbnails"))
		self["key_yellow"] = StaticText("")
		self["key_blue"] = StaticText(_("Setup"))
		self["label"] = StaticText("")
		self["thn"] = Pixmap()

		currDir = config.pic.lastDir.value
		if not pathExists(currDir):
			currDir = "/"

		self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(jpeg|jpg|jpe|png|bmp|gif)")
		self["filelist"] = self.filelist
		self["filelist"].onSelectionChanged.append(self.selectionChanged)

		self.ThumbTimer = eTimer()
		self.ThumbTimer.callback.append(self.showThumb)

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

		self.onLayoutFinish.append(self.setConf)
コード例 #28
0
	def __init__(self, session, args = 0):
		self.session = session
		Screen.__init__(self, session)

		self.list = []

		for i in range(7):
			self.list.append(getConfigListEntry(" 1. " + weekdays[i] + ": "  + _("Wakeup"), config.plugins.elektro.wakeup[i]))
			self.list.append(getConfigListEntry(" 1. " + weekdays[i] + ": "  + _("Sleep"), config.plugins.elektro.sleep[i]))
		self.list.append(getConfigListEntry(" 1. " + _("Next day starts at"), config.plugins.elektro.nextday,
			_("If the box is supposed to enter deep standby e.g. monday night at 1 AM, it actually is already tuesday. To enable this anyway, differing next day start time can be specified here.")))
		for i in range(7):
			self.list.append(getConfigListEntry(" 2. " + weekdays[i] + ": "  + _("Wakeup"), config.plugins.elektro.wakeup2[i]))
			self.list.append(getConfigListEntry(" 2. " + weekdays[i] + ": "  + _("Sleep"), config.plugins.elektro.sleep2[i]))
		self.list.append(getConfigListEntry(" 2. " + _("Next day starts at"), config.plugins.elektro.nextday2,
			_("If the box is supposed to enter deep standby e.g. monday night at 1 AM, it actually is already tuesday. To enable this anyway, differing next day start time can be specified here.")))

		ConfigListScreen.__init__(self, self.list)

		self["key_red"] = Button(_("Cancel"))
		self["key_green"] = Button(_("Ok"))
		self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
		{
			"red": self.cancel,
			"green": self.save,
			"save": self.save,
			"cancel": self.cancel,
			"ok": self.save,
		}, -2)
コード例 #29
0
ファイル: plugin.py プロジェクト: kingvuplus/b-p2
 def __init__(self, session):
     Screen.__init__(self, session)
     self['connect'] = MultiPixmap()
     self['connect'].setPixmapNum(0)
     self['lab1'] = Label('')
     self.mylist = ['Libraries',
      'Binaries',
      'Cams',
      'Scripts',
      'Bootlogos',
      'Uninstall files',
      'General Settings',
      'Cron',
      'Settings Channels Bouquets',
      'Openvpn',
      'Satellites Terrestrial',
      'Plugins',
      'END']
     self.mytmppath = '/media/hdd/'
     if fileExists('/etc/bhpersonalbackup'):
         f = open('/etc/bhpersonalbackup', 'r')
         self.mytmppath = f.readline().strip()
         f.close()
     self.mytmppath += 'bhbackuptmp'
     self.activityTimer = eTimer()
     self.activityTimer.timeout.get().append(self.updatepix)
     self.onShow.append(self.startShow)
     self.onClose.append(self.delTimer)
     system('rm -rf ' + self.mytmppath)
     system('mkdir ' + self.mytmppath)
     system('mkdir ' + self.mytmppath + '/etc')
     system('mkdir ' + self.mytmppath + '/usr')
     configfile.save()
コード例 #30
0
	def __init__(self, session, slotid):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Tuner settings"))
		self.list = [ ]
		ServiceStopScreen.__init__(self)
		self.stopService()
		ConfigListScreen.__init__(self, self.list)

		self["key_red"] = Label(_("Close"))
		self["key_green"] = Label(_("Save"))
		self["key_yellow"] = Label(_("Configuration mode"))
		self["key_blue"] = Label()

		self["actions"] = ActionMap(["SetupActions", "SatlistShortcutAction", "ColorActions"],
		{
			"ok": self.keyOk,
			"save": self.keySave,
			"cancel": self.keyCancel,
			"changetype": self.changeConfigurationMode,
			"nothingconnected": self.nothingConnectedShortcut,
			"red": self.keyCancel,
			"green": self.keySave,
		}, -2)

		self.slotid = slotid
		self.nim = nimmanager.nim_slots[slotid]
		self.nimConfig = self.nim.config
		self.createConfigMode()
		self.createSetup()
		self.onLayoutFinish.append(self.layoutFinished)
コード例 #31
0
    def __init__(self, session, retvalue=1, timeout=-1, default_yes=True):
        self.retval = retvalue
        self.ptsmainloopvalue = retvalue
        recordings = session.nav.getRecordings(
            False,
            Components.RecordingConfig.recType(
                config.recording.warn_box_restart_rec_types.value))
        jobs = len(job_manager.getPendingJobs())
        inTimeshift = Screens.InfoBar.InfoBar and Screens.InfoBar.InfoBar.instance and Screens.InfoBar.InfoBar.ptsGetTimeshiftStatus(
            Screens.InfoBar.InfoBar.instance)
        self.connected = False
        reason = ""
        next_rec_time = -1
        if not recordings:
            next_rec_time = session.nav.RecordTimer.getNextRecordingTime()
#		if jobs:
#			reason = (ngettext("%d job is running in the background!", "%d jobs are running in the background!", jobs) % jobs) + '\n'
#			if jobs == 1:
#				job = job_manager.getPendingJobs()[0]
#				if job.name == "VFD Checker":
#					reason = ""
#				else:
#					reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end)))
#			else:
#				reason += (_("%d jobs are running in the background!") % jobs) + '\n'
        if inTimeshift:
            reason = _("You seem to be in timeshift!") + '\n'
            default_yes = True
            timeout = 30
        if recordings or (next_rec_time > 0 and
                          (next_rec_time - time()) < 360):
            default_yes = False
            reason = _(
                "Recording(s) are in progress or coming up in few seconds!"
            ) + '\n'

        if reason and inStandby:
            session.nav.record_event.append(self.getRecordEvent)
            self.skinName = ""
        elif reason and not inStandby:
            text = {
                1:
                _("Really shutdown now?"),
                2:
                _("Really reboot now?"),
                3:
                _("Really restart now?"),
                4:
                _("Really upgrade the frontprocessor and reboot now?"),
                16:
                _("Really reboot into Recovery Mode?"),
                42:
                _("Really upgrade your %s %s and reboot now?") %
                (getMachineBrand(), getMachineName()),
                43:
                _("Really reflash your %s %s and reboot now?") %
                (getMachineBrand(), getMachineName()),
                44:
                _("Really upgrade the front panel and reboot now?"),
                45:
                _("Really WOL now?")
            }.get(retvalue)
            if text:
                MessageBox.__init__(self,
                                    session,
                                    reason + text,
                                    type=MessageBox.TYPE_YESNO,
                                    timeout=timeout,
                                    default=default_yes)
                self.skinName = "MessageBoxSimple"
                session.nav.record_event.append(self.getRecordEvent)
                self.connected = True
                self.onShow.append(self.__onShow)
                self.onHide.append(self.__onHide)
                return
        self.skin = """<screen position="1310,0" size="0,0"/>"""
        Screen.__init__(self, session)
        self.close(True)
コード例 #32
0
ファイル: Wizard.py プロジェクト: kingvuplus/boom2
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent)
     self['text'] = StaticText('')
     self['entry'] = StaticText('')
     self.onShow.append(self.setCallback)
コード例 #33
0
ファイル: plugin.py プロジェクト: Toysoft/BlackPole-enigma2
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            ["SetupActions", "MenuActions"], {
                "ok": self.keyGo,
                "cancel": self.keyCancel,
                "menu": self.closeRecursive,
            }, -2)

        nim_list = []
        # collect all nims which are *not* set to "nothing"
        for n in nimmanager.nim_slots:
            if not n.isCompatible("DVB-S"):
                continue
            if n.config_mode == "nothing":
                continue
            if n.config_mode in ("loopthrough", "satposdepends"):
                root_id = nimmanager.sec.getRoot(
                    n.slot_id, int(n.config.connectedTo.value))
                if n.type == nimmanager.nim_slots[
                        root_id].type:  # check if connected from a DVB-S to DVB-S2 Nim or vice versa
                    continue
            nim_list.append((str(n.slot), n.friendly_full_description))

        self.scan_nims = ConfigSelection(choices=nim_list)
        provider_list = []
        provider_list.append((str(900), 'Canal Digitaal'))
        provider_list.append((str(910), 'TV Vlaanderen'))
        provider_list.append((str(920), 'TéléSAT'))
        provider_list.append((str(930), 'Mobistar NL'))
        provider_list.append((str(940), 'Mobistar FR'))
        provider_list.append((str(950), 'AustriaSat'))
        provider_list.append((str(30), 'Czech Republic'))
        provider_list.append((str(31), 'Slovak Republic'))

        self.scan_provider = ConfigSelection(choices=provider_list)
        self.scan_hd = ConfigYesNo(default=True)
        self.scan_keepnumbering = ConfigYesNo(default=False)
        self.scan_keepsettings = ConfigYesNo(default=False)

        self.list = []
        self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
        self.list.append(self.tunerEntry)

        self.scanProvider = getConfigListEntry(_("Provider"),
                                               self.scan_provider)
        self.list.append(self.scanProvider)

        self.scanHD = getConfigListEntry(_("HD list"), self.scan_hd)
        self.list.append(self.scanHD)

        self.list.append(
            getConfigListEntry(_("Use fastscan channel numbering"),
                               self.scan_keepnumbering))

        self.list.append(
            getConfigListEntry(_("Use fastscan channel names"),
                               self.scan_keepsettings))

        ConfigListScreen.__init__(self, self.list)
        self["config"].list = self.list
        self["config"].l.setList(self.list)

        self.finished_cb = None

        self["introduction"] = Label(
            _("Select your provider, and press OK to start the scan"))
コード例 #34
0
ファイル: ServiceScan.py プロジェクト: linuxbox10/atv-e2
    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()
コード例 #35
0
    def __init__(self, session, mrl, title, currentList, contextMenuEntries,
                 infoCallback, name):
        Screen.__init__(self, session)
        InfoBarNotifications.__init__(self)
        self.contextMenuEntries = contextMenuEntries
        self.infoCallback = infoCallback
        self.name = name
        self.skinName = "MoviePlayer"
        self.session = session
        self.service = eServiceReference(4097, 0, mrl)
        self.service.setName(title)
        self.currentList = currentList
        self.infoCallback = infoCallback
        self.screen_timeout = 5000

        class DirectYouTubePlayerActionMap(ActionMap):
            def __init__(self, player, contexts=[], actions={}, prio=0):
                ActionMap.__init__(self, contexts, actions, prio)
                self.player = player

            def action(self, contexts, action):
                if action[:5] == "seek:":
                    time = int(action[5:])
                    self.player.seekRelative(time * 90000)
                    return 1
                elif action[:8] == "seekdef:":
                    key = int(action[8:])
                    time = [
                        -config.seek.selfdefined_13.value, False,
                        config.seek.selfdefined_13.value,
                        -config.seek.selfdefined_46.value, False,
                        config.seek.selfdefined_46.value,
                        -config.seek.selfdefined_79.value, False,
                        config.seek.selfdefined_79.value
                    ][key - 1]
                    self.player.seekRelative(time * 90000)
                    return 1
                else:
                    return ActionMap.action(self, contexts, action)

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evSeekableStatusChanged:
                self.__seekableStatusChanged,
                iPlayableService.evStart: self.__serviceStarted,
                iPlayableService.evEOF: self.__evEOF
            })

        self["actions"] = DirectYouTubePlayerActionMap(
            self,
            [
                "OkCancelActions", "TvRadioActions", "InfobarSeekActions",
                "MediaPlayerActions", "YouTubePlayerScreenActions"
            ],
            {
                "ok": self.ok,
                "cancel": self.close,
                "keyTV": self.close,
                "pauseService": self.playpauseService,
                "unPauseService": self.playpauseService,
                "play": self.play,
                #				"seekFwd": self.seekFwd,
                #				"seekBack": self.seekBack,
                #				"seekFwdDown": self.seekFwd,
                #				"seekBackDown": self.seekBack,
                #				"seekFwdManual": self.seekManual,
                #				"seekBackManual": self.seekManual,
                "next": self.playNextFile,
                "previous": self.playPrevFile,
                "menu": self.openContextMenu,
                "info": self.showVideoInfo,
            },
            -2)

        self.oldservice = self.session.screen["CurrentService"]
        self.oldNavService = session.nav.getCurrentlyPlayingServiceReference()

        self.hidetimer = eTimer()
        self.hidetimer_conn = self.hidetimer.timeout.connect(self.ok)
        self.returning = False

        self.state = self.STATE_PLAYING
        self.lastseekstate = self.STATE_PLAYING

        self.onPlayStateChanged = []
        self.__seekableStatusChanged()

        self.onClose.append(self.__onClose)

        self.play()
コード例 #36
0
 def __init__(self, session, parent):
     Screen.__init__(self, session)
     self.skinName = "InfoBarMoviePlayerSummary"
コード例 #37
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "Standby"
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"

        if os.path.exists("/usr/script/StandbyEnter.sh"):
            Console().ePopen("/usr/script/StandbyEnter.sh &")

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()
        self.stopService()
        if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
            # set LCDminiTV off
            setLCDModeMinitTV("0")

        self.paused_service = None
        self.prev_running_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.startswith("1:") and service.rsplit(
                    ":", 1)[1].startswith("/"):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
            else:
                self.timeHandler = eDVBLocalTimeHandler.getInstance()
                if self.timeHandler.ready():
                    if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                        self.stopService()
                    else:
                        self.standbyStopServiceTimer.startLongTimer(5)
                    self.timeHandler = None
                else:
                    self.timeHandler.m_timeUpdated.get().append(
                        self.stopService)

        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("off")

        if int(
                config.usage.hdd_standby_in_standby.value
        ) != -1:  # HDD standby timer value (box in standby) / -1 = same as when box is active
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
コード例 #38
0
ファイル: ImageBackup.py プロジェクト: n3wb13/enigma2
    def __init__(self, session, args=0):
        Screen.__init__(self, session)
        self.session = session
        self.selection = 0
        self.MODEL = getBoxType()
        self.OEM = getBrandOEM()
        self.MACHINEBUILD = getMachineBuild()
        self.MACHINENAME = getMachineName()
        self.MACHINEBRAND = getMachineBrand()
        self.IMAGEFOLDER = getImageFolder()
        self.UBINIZE_ARGS = getMachineUBINIZE()
        self.MKUBIFS_ARGS = getMachineMKUBIFS()
        self.MTDKERNEL = getMachineMtdKernel()
        self.MTDROOTFS = getMachineMtdRoot()
        self.ROOTFSBIN = getMachineRootFile()
        self.KERNELBIN = getMachineKernelFile()
        self.ROOTFSTYPE = getImageFileSystem().strip()

        if self.MACHINEBUILD in ("hd51", "vs1500", "h7", "8100s"):
            self.MTDBOOT = "mmcblk0p1"
            self.EMMCIMG = "disk.img"
        elif self.MACHINEBUILD in ("xc7439", "osmio4k"):
            self.MTDBOOT = "mmcblk1p1"
            self.EMMCIMG = "emmc.img"
#		elif self.MACHINEBUILD in ("cc1","sf8008","ustym4kpr"):
#			self.MTDBOOT = "none"
#			self.EMMCIMG = "usb_update.bin"
        else:
            self.MTDBOOT = "none"
            self.EMMCIMG = "none"

        print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" % self.MACHINEBUILD
        print "[FULL BACKUP] BOX MACHINENAME = >%s<" % self.MACHINENAME
        print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" % self.MACHINEBRAND
        print "[FULL BACKUP] BOX MODEL = >%s<" % self.MODEL
        print "[FULL BACKUP] OEM MODEL = >%s<" % self.OEM
        print "[FULL BACKUP] IMAGEFOLDER = >%s<" % self.IMAGEFOLDER
        print "[FULL BACKUP] UBINIZE = >%s<" % self.UBINIZE_ARGS
        print "[FULL BACKUP] MKUBIFS = >%s<" % self.MKUBIFS_ARGS
        print "[FULL BACKUP] MTDBOOT = >%s<" % self.MTDBOOT
        print "[FULL BACKUP] MTDKERNEL = >%s<" % self.MTDKERNEL
        print "[FULL BACKUP] MTDROOTFS = >%s<" % self.MTDROOTFS
        print "[FULL BACKUP] ROOTFSBIN = >%s<" % self.ROOTFSBIN
        print "[FULL BACKUP] KERNELBIN = >%s<" % self.KERNELBIN
        print "[FULL BACKUP] ROOTFSTYPE = >%s<" % self.ROOTFSTYPE
        print "[FULL BACKUP] EMMCIMG = >%s<" % self.EMMCIMG

        self.error_files = ''
        self.list = self.list_files("/boot")
        self["key_green"] = StaticText("USB")
        self["key_red"] = StaticText("HDD")
        self["key_blue"] = StaticText(_("Exit"))
        if SystemInfo["HaveMultiBoot"]:
            self["key_yellow"] = StaticText(_("STARTUP"))
            self["info-multi"] = Label(
                _("You can select with yellow the OnlineFlash Image\n or select Recovery to create a USB Disk Image for clean Install."
                  ))
            self.read_current_multiboot()
        else:
            self["key_yellow"] = StaticText("")
            self["info-multi"] = Label(" ")
        self["info-usb"] = Label(
            _("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."
              ))
        self["info-hdd"] = Label(
            _("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."
              ))
        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "blue": self.quit,
                "yellow": self.yellow,
                "green": self.green,
                "red": self.red,
                "cancel": self.quit,
            }, -2)
        self.onShown.append(self.show_Errors)
コード例 #39
0
ファイル: ui.py プロジェクト: kingvuplus/bh-2
    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=\"skin_default/icons/record.png\" alphatest=\"on\" /> \
			<widget name=\"play_icon\" position=\"" + str(space + 25) + "," + str(
                    space + 2
                ) + "\" size=\"20,20\" zPosition=\"2\" pixmap=\"skin_default/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)
コード例 #40
0
ファイル: plugin.py プロジェクト: xmasmc/enigma2-plugins
    def __init__(self, session):
        self.session = session
        size_w = int(getDesktop(0).size().width() * 0.9)
        size_h = int(getDesktop(0).size().height() * 0.9)
        pos_w = int((getDesktop(0).size().width() - size_w) / 2)
        pos_h = int((getDesktop(0).size().height() - size_h) / 2)
        p_h = int(size_h / 3)

        infopanel_width = int(size_w - (p_h * 3))
        infopanel_height = size_h
        label_height = 30
        font = "Regular;21"
        self.dict = {
            'font':
            font,
            'screen.size':
            "%i,%i" % (size_w, size_h),
            'screen.position':
            "%i,%i" % (pos_w, pos_h),
            'pixmap.size':
            '%i,%i' % (p_h, p_h),
            'pixmap1.pos':
            '0,0',
            'pixmap2.pos':
            '%i,0' % (p_h),
            'pixmap3.pos':
            '%i,0' % (int(p_h * 2)),
            'pixmap4.pos':
            '0,%i' % (p_h),
            'pixmap5.pos':
            '%i,%i' % (p_h, p_h),
            'pixmap6.pos':
            '%i,%i' % (int(p_h * 2), p_h),
            'pixmap7.pos':
            '0,%i' % (int(p_h * 2)),
            'pixmap8.pos':
            '%i,%i' % (p_h, int(p_h * 2)),
            'pixmap9.pos':
            '%i,%i' % (int(p_h * 2), int(p_h * 2)),
            'infopanel.pos':
            '%i,0' % (int(p_h * 3)),
            'infopanel.size':
            '%i,%i' % (infopanel_width, infopanel_height),
            'posx.pos':
            '%i,0' % (int(p_h * 3)),
            'posx.size':
            '%i,%i' % (infopanel_width, label_height),
            'posy.pos':
            '%i,%i' % (int(p_h * 3), label_height),
            'posy.size':
            '%i,%i' % (infopanel_width, label_height),
            'posz.pos':
            '%i,%i' % (int(p_h * 3), int(label_height * 2)),
            'posz.size':
            '%i,%i' % (infopanel_width, label_height),
            'placeslist.pos':
            '%i,%i' % (int(p_h * 3), int(label_height * 3)),
            'placeslist.size':
            '%i,%i' %
            (infopanel_width, int(infopanel_height - (label_height * 4))),
            'buttonmenu.pos':
            '%i,%i' % (int(p_h * 3),
                       int(infopanel_height - (label_height * 4) +
                           (label_height * 3))),
            'buttonmenu.size':
            '%i,%i' % (int(infopanel_width / 3), label_height),
            'buttonsearch.pos':
            '%i,%i' % (int(p_h * 3 + (infopanel_width / 3)),
                       int(infopanel_height - (label_height * 4) +
                           (label_height * 3))),
            'buttonsearch.size':
            '%i,%i' % (int(infopanel_width / 3), label_height),
            'buttonhelp.pos':
            '%i,%i' % (int(p_h * 3 + ((infopanel_width / 3) * 2)),
                       int(infopanel_height - (label_height * 4) +
                           (label_height * 3))),
            'buttonhelp.size':
            '%i,%i' % (int(infopanel_width / 3), label_height),
        }

        self.skin = applySkinVars(GoogleMapsMainScreen.raw_skin, self.dict)
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        #self["infopanel"] = Label()
        self["posx"] = Label("")
        self["posy"] = Label("")
        self["posz"] = Label("")
        self["placeslist"] = MenuList([])
        self["buttonmenu"] = Label(_("Menu"))
        self["buttonsearch"] = Label(_("Search"))
        self["buttonhelp"] = Label(_("Help"))

        #self["pic1b"] = WebPixmap(default=plugin_path+not_found_pic)
        self["pic1"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic2"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic3"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic4"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic5"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic6"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic7"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic8"] = WebPixmap(default=plugin_path + not_found_pic)
        self["pic9"] = WebPixmap(default=plugin_path + not_found_pic)

        self["pic1o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic2o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic3o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic4o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic5o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic6o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic7o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic8o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)
        self["pic9o"] = WebPixmap(default=plugin_path + not_found_pic_overlay)

        self["actionmap"] = ActionMap(
            [
                "OkCancelActions", "NumberActions", "DirectionActions",
                "MenuActions", "ColorActions", "InfobarChannelSelection"
            ], {
                "cancel": self.close,
                "ok": self.keyOk,
                "1": self.key1,
                "2": self.key2,
                "3": self.key3,
                "4": self.key4,
                "5": self.key5,
                "6": self.key6,
                "7": self.key7,
                "8": self.key8,
                "9": self.key9,
                "0": self.key0,
                "red": self.openSearchScreen,
                "menu": self.keymenu,
                "historyNext": self.toggleMapOverlay,
            }, -1)

        self.helpList.append(
            (self["actionmap"], "OkCancelActions", [("cancel",
                                                     _("quit Google Maps"))]))
        self.helpList.append((self["actionmap"], "DirectionActions",
                              [("up", _("navigate thru Placemarks"))]))
        self.helpList.append((self["actionmap"], "DirectionActions",
                              [("down", _("navigate thru Placemarks"))]))
        self.helpList.append((self["actionmap"], "DirectionActions",
                              [("left", _("navigate thru Placemarks"))]))
        self.helpList.append((self["actionmap"], "DirectionActions",
                              [("right", _("navigate thru Placemarks"))]))
        self.helpList.append((self["actionmap"], "OkCancelActions",
                              [("ok", _("show selected Placemark"))]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("1", 'move north-west')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("2", 'move north')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("3", 'move north-east')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("4", 'move west')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("6", 'move east')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("7", 'move south-west')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("8", 'move south')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("9", 'move south-east')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("5", 'zoom in')]))
        self.helpList.append(
            (self["actionmap"], "NumberActions", [("0", 'zoom out')]))
        self.helpList.append((self["actionmap"], "ColorActions",
                              [("red", 'open Search Screen')]))
        self.helpList.append((self["actionmap"], "InfobarChannelSelection",
                              [("historyNext", 'show/unshow Map Overlay')]))

        self.onLayoutFinish.append(self.onLayoutFinished)
コード例 #41
0
ファイル: e2ivk.py プロジェクト: OpenVisionE2/e2iplayer-ov
    def __init__(self, session, title="", text="", additionalParams={}):
        self.session = session

        # autocomplete engine
        self.autocomplete = additionalParams.get('autocomplete')
        self.isAutocompleteEnabled = False

        self.searchHistory = additionalParams.get('search_history', [])

        self.skin = self.prepareSkin()

        Screen.__init__(self, session)
        self.onLayoutFinish.append(self.setGraphics)
        self.onShown.append(self.onWindowShow)
        self.onClose.append(self.__onClose)

        self["actions"] = NumberActionMap(["WizardActions", "DirectionActions", "ColorActions", "E2iPlayerVKActions", "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"],
        {
            "gotAsciiCode": self.keyGotAscii,
            "ok": self.keyOK,
            "ok_repeat": self.keyOK,
            "back": self.keyBack,
            "left": self.keyLeft,
            "right": self.keyRight,
            "up": self.keyUp,
            "down": self.keyDown,
            "red": self.keyRed,
            "red_repeat": self.keyRed,
            "green": self.keyGreen,
            "yellow": self.keyYellow,
            "blue": self.keyBlue,
            "deleteBackward": self.backClicked,
            "deleteForward": self.forwardClicked,
            "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)

        # Left list
        self['left_header'] = Label(" ")
        self['left_list'] = E2iVKSelectionList()

        # Right list
        if self.autocomplete:
            self['right_header'] = Label(" ")
            self['right_list'] = E2iVKSelectionList(False)
        self.isSuggestionVisible = None

        self.graphics = {}
        for key in ['pb', 'pr', 'pg', 'py', 'l', 'b', 'e', 'e_m', 'k', 'k_m', 'k_s', 'k2_m', 'k2_s', 'k3', 'k3_m']:
            self.graphics[key] = LoadPixmap(GetIconDir('e2ivk_hd/%s.png' if self.fullHD else 'e2ivk/%s.png') % key)

        for i in range(0, 63):
            self[str(i)] = Cover3()

        for key in ['l', 'b', 'e_m', 'k_m', 'k2_m', 'k3_m']:
            self[key] = Cover3()

        for i in range(1, 63):
            self['_%s' % i] = Label(" ")

        for m in range(6):
            self['m_%d' % m] = Label(" ")

        self.graphicsMap = {'0': 'e', '1': 'k_s', '15': 'k_s', '29': 'k_s', '57': 'k_s', '58': 'k_s', '60': 'k_s', '61': 'k_s', '62': 'k_s', '59': 'k3',
                            '16': 'k2_s', '30': 'k2_s', '42': 'k2_s', '43': 'k2_s', '55': 'k2_s', '56': 'k2_s'}

        self.markerMap = {'0': 'e_m', '59': 'k3_m', '16': 'k2_m', '30': 'k2_m', '42': 'k2_m', '43': 'k2_m', '55': 'k2_m', '56': 'k2_m'}

        self.header = title if title else _('Enter the text')
        self.startText = text

        self["text"] = E2iInput(text="")
        self["header"] = Label(" ")

        self.colMax = len(self.KEYIDMAP[0])
        self.rowMax = len(self.KEYIDMAP)

        self.rowIdx = 0
        self.colIdx = 0

        self.colors = {'normal': gRGB(int('ffffff', 0x10)), 'selected': gRGB(int('39b54a', 0x10)), 'deadkey': gRGB(int('0275a0', 0x10)), 'ligature': gRGB(int('ed1c24', 0x10)), 'inactive': gRGB(int('979697', 0x10))}

        self.specialKeyState = self.SK_NONE
        self.currentVKLayout = self.DEFAULT_VK_LAYOUT
        self.selectedVKLayoutId = config.plugins.iptvplayer.osk_layout.value
        self.vkRequestedId = additionalParams.get('vk_layout_id', '')
        self.deadKey = u''
        self.focus = self.FOCUS_KEYBOARD
コード例 #42
0
	def __init__(self, session, parent):
		Screen.__init__(self, session)
		self["headline"] = Label(_("OFDb Plugin"))
コード例 #43
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.skin_path = resolveFilename(SCOPE_PLUGINS,
                                      "Extensions/RaedQuickSignal")
     dellog()
     if config.plugins.RaedQuickSignal.style.value == "AGC1":
         if config.plugins.RaedQuickSignal.piconpath.value == "PLUGIN":
             if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
                 if isHD():
                     self.skin = SKIN_AGC_Picon_SNRdB
                 else:
                     self.skin = SKIN_AGC_Picon_SNRdB_FHD
             else:
                 if isHD():
                     self.skin = SKIN_AGC_Picon_NOSNRdB
                 else:
                     self.skin = SKIN_AGC_Picon_NOSNRdB_FHD
         elif config.plugins.RaedQuickSignal.piconpath.value == "MEDIA":
             if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
                 if isHD():
                     self.skin = SKIN_AGC_Picon_media_SNRdB
                 else:
                     self.skin = SKIN_AGC_Picon_media_SNRdB_FHD
             else:
                 if isHD():
                     self.skin = SKIN_AGC_Picon_media_NOSNRdB
                 else:
                     self.skin = SKIN_AGC_Picon_media_NOSNRdB_FHD
     elif config.plugins.RaedQuickSignal.style.value == "AGC2":
         if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
             if isHD():
                 self.skin = SKIN_AGC_Event_Des_SNRdB
             else:
                 self.skin = SKIN_AGC_Event_Des_SNRdB_FHD
         else:
             if isHD():
                 self.skin = SKIN_AGC_Event_Des_NOSNRdB
             else:
                 self.skin = SKIN_AGC_Event_Des_NOSNRdB_FHD
     elif config.plugins.RaedQuickSignal.style.value == "AGC3":
         if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
             if isHD():
                 self.skin = SKIN_AGC_Weather_SNRdB
             else:
                 self.skin = SKIN_AGC_Weather_SNRdB_FHD
         else:
             if isHD():
                 self.skin = SKIN_AGC_Weather_NOSNRdB
             else:
                 self.skin = SKIN_AGC_Weather_NOSNRdB_FHD
     elif config.plugins.RaedQuickSignal.style.value == "Event1":
         if config.plugins.RaedQuickSignal.piconpath.value == "PLUGIN":
             if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
                 if isHD():
                     self.skin = SKIN_Event_Progress_Picon_SNRdB
                 else:
                     self.skin = SKIN_Event_Progress_Picon_SNRdB_FHD
             else:
                 if isHD():
                     self.skin = SKIN_Event_Progress_Picon_NOSNRdB
                 else:
                     self.skin = SKIN_Event_Progress_Picon_NOSNRdB_FHD
         elif config.plugins.RaedQuickSignal.piconpath.value == "MEDIA":
             if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
                 if isHD():
                     self.skin = SKIN_Event_Progress_Picon_media_SNRdB
                 else:
                     self.skin = SKIN_Event_Progress_Picon_media_SNRdB_FHD
             else:
                 if isHD():
                     self.skin = SKIN_Event_Progress_Picon_media_NOSNRdB
                 else:
                     self.skin = SKIN_Event_Progress_Picon_media_NOSNRdB_FHD
     elif config.plugins.RaedQuickSignal.style.value == "Event2":
         if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
             if isHD():
                 self.skin = SKIN_Event_Progress_Event_Des_SNRdB
             else:
                 self.skin = SKIN_Event_Progress_Event_Des_SNRdB_FHD
         else:
             if isHD():
                 self.skin = SKIN_Event_Progress_Event_Des_NOSNRdB
             else:
                 self.skin = SKIN_Event_Progress_Event_Des_NOSNRdB_FHD
     elif config.plugins.RaedQuickSignal.style.value == "Event3":
         if config.plugins.RaedQuickSignal.enabledb.value == "Enable":
             if isHD():
                 self.skin = SKIN_Event_Progress_Weather_SNRdB
             else:
                 self.skin = SKIN_Event_Progress_Weather_SNRdB_FHD
         else:
             if isHD():
                 self.skin = SKIN_Event_Progress_Weather_NOSNRdB
             else:
                 self.skin = SKIN_Event_Progress_Weather_NOSNRdB_FHD
     elif config.plugins.RaedQuickSignal.style.value == "Full":
         if isHD():
             self.skin = SKIN_Full_Screen
         else:
             self.skin = SKIN_Full_Screen_FHD
     self.session = session
     self.startupservice = config.servicelist.startupservice.value
     logdata('self.startupservice', self.startupservice)
     sref = self.session.nav.getCurrentService()
     from ServiceReference import ServiceReference
     p = ServiceReference(str(sref))
     servicename = str(p.getServiceName())
     serviceurl = p.getPath()
     logdata('serviceurl', serviceurl)
     logdata('servicename', servicename)
     logdata('playeble-sref', sref)
     config.servicelist.startupservice.value = serviceurl
     config.servicelist.startupservice.save()
     self.servicelist = self.session.instantiateDialog(ChannelSelection)
     self["setupActions"] = ActionMap(
         ["WizardActions", "SetupActions", "MenuActions"], {
             "cancel": self.exit,
             "menu": self.showsetup,
             "up": self.keyUp,
             "down": self.keyDown,
             "left": self.keyLeft,
             "right": self.keyRight,
         })
     shown = True
     self.onLayoutFinish.append(self.layoutFinished)
コード例 #44
0
ファイル: ui.py プロジェクト: kingvuplus/bh-2
    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,
                                    "skin_default/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)
コード例 #45
0
ファイル: SessionGlobals.py プロジェクト: henrylicious/test
    def __init__(self, session):
        Screen.__init__(self, session)
        self["CurrentService"] = CurrentService(session.nav)
        self["CurrentTime"] = Clock()
        self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
        self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)
        self["FrontendStatus"] = FrontendStatus(
            service_source=session.nav.getCurrentService)
        self["FrontendInfo"] = FrontendInfo(navcore=session.nav)
        self["VideoPicture"] = Source()
        self["TunerInfo"] = TunerInfo()
        self["RecordState"] = RecordState(session)
        self["Standby"] = Boolean(fixed=False)

        from Components.SystemInfo import SystemInfo

        combine = Combine(func=lambda s: {
            (False, False): 0,
            (False, True): 1,
            (True, False): 2,
            (True, True): 3
        }[(s[0].boolean, s[1].boolean)])
        combine.connect(self["Standby"])
        combine.connect(self["RecordState"])

        #                      |  two leds  | single led |
        # recordstate  standby   red green
        #    false      false    off   on     off
        #    true       false    blnk  on     blnk
        #    false      true      on   off    off
        #    true       true     blnk  off    blnk

        PATTERN_ON = (20, 0xffffffff, 0xffffffff)
        PATTERN_OFF = (20, 0, 0)
        PATTERN_BLINK = (20, 0x55555555, 0xa7fccf7a)

        have_display = SystemInfo.get("FrontpanelDisplay", False)
        have_touch_sensor = SystemInfo.get("HaveTouchSensor", False)
        nr_leds = SystemInfo.get("NumFrontpanelLEDs", 0)

        if nr_leds == 1:
            FrontpanelLed(which=0,
                          boolean=False,
                          patterns=[
                              PATTERN_OFF if have_display else PATTERN_ON,
                              PATTERN_BLINK, PATTERN_OFF, PATTERN_BLINK
                          ]).connect(combine)
        elif nr_leds == 2:
            if have_touch_sensor:
                FrontpanelLed(which=0,
                              boolean=False,
                              patterns=[
                                  PATTERN_ON, PATTERN_BLINK, PATTERN_OFF,
                                  PATTERN_BLINK
                              ]).connect(combine)
                FrontpanelLed(which=1,
                              boolean=False,
                              patterns=[
                                  PATTERN_OFF, PATTERN_OFF, PATTERN_OFF,
                                  PATTERN_OFF
                              ]).connect(combine)
            else:
                FrontpanelLed(which=0,
                              boolean=False,
                              patterns=[
                                  PATTERN_OFF, PATTERN_BLINK, PATTERN_ON,
                                  PATTERN_BLINK
                              ]).connect(combine)
                FrontpanelLed(which=1,
                              boolean=False,
                              patterns=[
                                  PATTERN_ON, PATTERN_ON, PATTERN_OFF,
                                  PATTERN_OFF
                              ]).connect(combine)
コード例 #46
0
    def __init__(self, session, feid, nr_of_ports, simple_tone,
                 simple_sat_change):
        Screen.__init__(self, session)

        self["statusbar"] = StaticText(" ")
        self["tunerstatusbar"] = StaticText(" ")

        self.list = []
        ConfigListScreen.__init__(self, self.list, session=self.session)

        self["config"].list = self.list
        self["config"].l.setList(self.list)

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

        self.index = 0
        self.port_index = 0
        self.feid = feid
        self.nr_of_ports = nr_of_ports
        self.simple_tone = simple_tone
        self.simple_sat_change = simple_sat_change
        self.found_sats = []
        self.circular_setup = False
        sat_found = False
        for x in self.sat_frequencies:
            if x[self.SAT_TABLE_ORBPOS] == 360:
                sat_found = True
        if self.nr_of_ports == 1:
            if not sat_found:
                self.sat_frequencies += self.circular_sat_frequencies
        elif sat_found:
            self.sat_frequencies.remove(x)

        if not self.openFrontend():
            self.oldref = self.session.nav.getCurrentlyPlayingServiceOrGroup()
            self.session.nav.stopService()
            if not self.openFrontend():
                if self.session.pipshown:
                    if hasattr(self.session, 'infobar'):
                        if self.session.infobar.servicelist and self.session.infobar.servicelist.dopipzap:
                            self.session.infobar.servicelist.togglePipzap()
                    if hasattr(self.session, 'pip'):
                        del self.session.pip
                    self.session.pipshown = False
                if not self.openFrontend():
                    self.frontend = None
                    self.raw_channel = None

        if self.raw_channel:
            self.raw_channel.receivedTsidOnid.get().append(self.gotTsidOnid)

        self["actions"] = ActionMap(["SetupActions"], {
            "cancel": self.keyCancel,
        }, -2)

        self.count = 0
        self.state = 0
        self.abort = False

        self.diseqc = [
            config.Nims[self.feid].diseqcA.value,
            config.Nims[self.feid].diseqcB.value,
            config.Nims[self.feid].diseqcC.value,
            config.Nims[self.feid].diseqcD.value,
        ]

        self.statusTimer = eTimer()
        self.statusTimer.callback.append(self.statusCallback)
        self.tunerStatusTimer = eTimer()
        self.tunerStatusTimer.callback.append(self.tunerStatusCallback)
        self.startStatusTimer()
        self.onClose.append(self.__onClose)
コード例 #47
0
 def __init__(self, session):
     from enigma import addFont
     addFont(
         '/usr/lib/enigma2/python/Plugins/Extensions/YahooWeather/Font/weather.ttf',
         'weather', 87, 1)
     if config.plugins.YahooWeather.compactskin.value == True:
         path = "/usr/lib/enigma2/python/Plugins/Extensions/YahooWeather/Skin/WeatherCompact.xml"
         with open(path, "r") as f:
             self.skin = f.read()
             f.close()
     else:
         path = "/usr/lib/enigma2/python/Plugins/Extensions/YahooWeather/Skin/Weather.xml"
         with open(path, "r") as f:
             self.skin = f.read()
             f.close()
     Screen.__init__(self, session)
     self.skinName = ["YahooWeather"]
     self['lab1'] = Label(_('Retrieving data ...'))
     self['5day'] = Label(_('5 Day Weather Forecast'))
     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["Key_Red"] = Label(_("Change city"))
     self["Key_Green"] = Label(_("Change skin"))
     #############test 3day#####
     self['3lab22'] = Pixmap()
     self['3lab19'] = Label('')
     self['3lab19b'] = Label('')
     self['3lab20'] = Label('')
     self['3lab20b'] = Label('')
     self['3lab18'] = Label('')
     self['3lab21'] = Label('')
     #############test 4day#####
     self['4lab22'] = Pixmap()
     self['4lab19'] = Label('')
     self['4lab19b'] = Label('')
     self['4lab20'] = Label('')
     self['4lab20b'] = Label('')
     self['4lab18'] = Label('')
     self['4lab21'] = Label('')
     #############test 5day#####
     self['5lab22'] = Pixmap()
     self['5lab19'] = Label('')
     self['5lab19b'] = Label('')
     self['5lab20'] = Label('')
     self['5lab20b'] = Label('')
     self['5lab18'] = Label('')
     self['5lab21'] = Label('')
     ##########################
     self['daydate0'] = Label('')
     self['daydate1'] = Label('')
     self['daydate2'] = Label('')
     self['daydate3'] = Label('')
     self['daydate4'] = Label('')
     self['actions'] = ActionMap(
         ['WizardActions', 'ColorActions', 'MenuActions'], {
             'red': self.key_red,
             'menu': self.key_red,
             'green': self.key_green,
             '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
コード例 #48
0
ファイル: catchup.py プロジェクト: mosadraja/XStreamity
    def __init__(self, session):
        Screen.__init__(self, session)
        self.session = session

        skin = skin_path + 'catchup.xml'

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = (_('Catch Up TV'))
        self.main_title = (_('Catch Up TV'))

        url = str(glob.current_playlist['playlist_info']['player_api']) + "&action=get_live_categories"

        self.level = 1
        self.category = 0

        glob.nextlist = []
        glob.nextlist.append({"playlist_url": url, "index": 0, "level": self.level})

        self["channel"] = StaticText(self.main_title)

        self.list = []
        self.channelList = []
        self["channel_list"] = List(self.channelList, enableWrapAround=True)
        self.selectedlist = self["channel_list"]

        # epg variables
        self["epg_bg"] = Pixmap()
        self["epg_bg"].hide()

        self["epg_title"] = StaticText()
        self["epg_description"] = StaticText()

        self.epgshortlist = []
        self["epg_short_list"] = List(self.epgshortlist, enableWrapAround=True)
        self["epg_short_list"].onSelectionChanged.append(self.displayShortEPG)

        self["epg_picon"] = Pixmap()
        self["epg_picon"].hide()

        self["key_red"] = StaticText(_('Back'))
        self["key_green"] = StaticText(_('OK'))
        self["key_rec"] = StaticText('')

        self.isStream = False
        self.pin = False

        self.protocol = glob.current_playlist['playlist_info']['protocol']
        self.domain = glob.current_playlist['playlist_info']['domain']
        self.host = glob.current_playlist['playlist_info']['host']
        self.livetype = glob.current_playlist['player_info']['livetype']
        self.username = glob.current_playlist['playlist_info']['username']
        self.password = glob.current_playlist['playlist_info']['password']
        self.output = glob.current_playlist['playlist_info']['output']

        self.live_categories = str(glob.current_playlist['playlist_info']['player_api']) + "&action=get_live_categories"
        self.live_streams = str(glob.current_playlist['playlist_info']['player_api']) + "&action=get_live_streams"
        self.simpledatatable = str(glob.current_playlist['playlist_info']['player_api']) + "&action=get_simple_data_table&stream_id="

        self["page"] = StaticText('')
        self["listposition"] = StaticText('')
        self.page = 0
        self.pageall = 0
        self.position = 0
        self.positionall = 0
        self.itemsperpage = 10

        self.showingshortEPG = False

        self.listType = ''

        self["actions"] = ActionMap(["XStreamityActions"], {
            'red': self.back,
            'cancel': self.back,
            'ok': self.__next__,
            'green': self.__next__,
            "left": self.pageUp,
            "right": self.pageDown,
            "up": self.goUp,
            "down": self.goDown,
            "channelUp": self.pageUp,
            "channelDown": self.pageDown,
            "0": self.reset,
            "rec": self.downloadVideo,
        }, -2)

        self.onFirstExecBegin.append(self.createSetup)
        self.onLayoutFinish.append(self.__layoutFinished)
コード例 #49
0
ファイル: Wizard.py プロジェクト: IanSav/enigma2-Beyonwiz
    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", "DirectionActions", "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)
コード例 #50
0
ファイル: plugin.py プロジェクト: iEjOriginal/OpenVPN-1
    def __init__(self, session):
        self.skin = """
              <screen name="Vpn Menu" backgroundColor="#00000000" position="center,center" size="666,420" title="Vpn" flags="wfNoBorder">
              <widget name="countryPng" position="30,5" alphatest="blend" size="50,33" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/VpnChanger/icon/default.png" zPosition="2" />
              <widget name="list" position="center,70" size="600,160" backgroundColor="#00000000" scrollbarMode="showOnDemand" zPosition="2" transparent="1" />
              <widget name="vpnLoad" position="center,70" size="600,160" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <widget name="ipLabel" position="80,5" size="600,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <eLabel position="30,253" size="5,33" zPosition="2" backgroundColor="#00ff0000" />
              <eLabel text="Start/Stop OpenVpn" position="40,253" size="333,33" backgroundColor="#00000000" transparent="1" foregroundColor="#00B8B8B8" zPosition="2" font="Regular; 24" valign="top" halign="left" />
              <widget name="vpnStatus" position="303,253" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <widget name="vpnInfo" position="303,293" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <eLabel position="30,293" size="5,33" zPosition="2" backgroundColor="#0000ff00" />
              <widget name="vpnDir" position="40,293" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <eLabel position="30,333" size="5,33" zPosition="2" backgroundColor="#00ebff00" />
              <widget name="check" position="40,333" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <widget name="checkLabel" position="303,333" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              <eLabel position="30,373" size="5,33" zPosition="2" backgroundColor="#003000ff" />
              <widget name="network" position="40,373" size="290,33" backgroundColor="#00000000" foregroundColor="#00B8B8B8" font="Regular; 24" valign="top" halign="left"  zPosition="2" transparent="1" />
              </screen>"""


        Screen.__init__(self, session)

        self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "SetupActions"], {
            "ok": self.keyOK,
            "red": self.keyRed,
            "green": self.keyGreen,
            "yellow": self.keyYellow,
            "blue": self.keyBlue,
            "cancel": self.keyCancel
        }, -1)

        self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
        if DESKTOPSIZE.width() == 1920:
            self.chooseMenuList.l.setFont(0, gFont('Regular', 29))
            self.chooseMenuList.l.setItemHeight(31)
        else:
            self.chooseMenuList.l.setFont(0, gFont('Regular', 19))
            self.chooseMenuList.l.setItemHeight(22)

        self['countryPng'] = Pixmap()
        self["ipLabel"] = Label("")
        self["check"] = Label("Start/Stop Check Vpn")
        self["network"] = Label(_("Restart Network"))
        if config.vpnChanger.vpnCheck.value:
            text = "Vpn Check is Enabled"
        else:
            text = "Vpn Check is Disabled"
        self["checkLabel"] = Label(text)
        self['vpnInfo'] = Label(config.vpnChanger.lastVpn.value)
        self['vpnDir'] = Label(config.vpnChanger.dir.value)
        self['list'] = self.chooseMenuList
        self['vpnLoad'] = Label("OpenVpn is Loading.....")
        if "openvpn" in str(os.listdir("/var/run")):
            text = "OpenVpn is Running"
        else:
            text = "OpenVpn is not Running"
        self['vpnStatus'] = Label(text)

        self['vpnLoad'].hide()
        self.Timer = 0
        self.StatusTimer = eTimer()
        self.StatusTimer.callback.append(self.statusVpn)

        self.onLayoutFinish.append(self.setList)
コード例 #51
0
    def __init__(self, session, inList, outList, numOfLockedItems=0, groupName='', groupObj=None):
        printDBG("PlayerSelectorWidget.__init__ --------------------------------")
        screenwidth = getDesktop(0).size().width()
        iconSize = GetAvailableIconSize()
        if len(inList) >= 30 and iconSize == 100 and screenwidth and screenwidth > 1100:
            numOfRow = 4
            numOfCol = 8
        elif len(inList) > 16 and iconSize == 100:
            numOfRow = 4
            numOfCol = 5
        elif len(inList) > 12 and iconSize == 100:
            numOfRow = 4
            numOfCol = 4
        elif len(inList) > 9:
            if screenwidth and screenwidth == 1920:
                numOfRow = 4
                numOfCol = 8
            else:
                numOfRow = 3
                numOfCol = 4
        elif len(inList) > 6:
            numOfRow = 3
            numOfCol = 3
        elif len(inList) > 3:
            numOfRow = 2
            numOfCol = 3
        else:
            numOfRow = 1
            numOfCol = 3

        try:
            confNumOfRow = int(config.plugins.iptvplayer.numOfRow.value)
            confNumOfCol = int(config.plugins.iptvplayer.numOfCol.value)
            # 0 - means AUTO
            if confNumOfRow > 0:
                numOfRow = confNumOfRow
            if confNumOfCol > 0:
                numOfCol = confNumOfCol
        except Exception:
            pass

        # position of first img
        offsetCoverX = 25
        if screenwidth and screenwidth == 1920:
            offsetCoverY = 100
        else:
            offsetCoverY = 80

        # image size
        coverWidth = iconSize
        coverHeight = iconSize

        # space/distance between images
        disWidth = int(coverWidth / 3)
        disHeight = int(coverHeight / 4)

        # marker size should be larger than img
        markerWidth = 45 + coverWidth
        markerHeight = 45 + coverHeight

        # position of first marker
        offsetMarkerX = offsetCoverX - (markerWidth - coverWidth) / 2
        offsetMarkerY = offsetCoverY - (markerHeight - coverHeight) / 2

        # how to calculate position of image with indexes indxX, indxY:
        #posX = offsetCoverX + (coverWidth + disWidth) * indxX
        #posY = offsetCoverY + (coverHeight + disHeight) * indxY

        # how to calculate position of marker for image with posX, posY
        #markerPosX = posX - (markerWidth - coverWidth)/2
        #markerPosY = posY - (markerHeight - coverHeight)/2

        tmpX = coverWidth + disWidth
        tmpY = coverHeight + disHeight

        self.numOfRow = numOfRow
        self.numOfCol = numOfCol
        # position of first cover
        self.offsetCoverX = offsetCoverX
        self.offsetCoverY = offsetCoverY
        # space/distance between images
        self.disWidth = disWidth
        self.disHeight = disHeight
        # image size
        self.coverWidth = coverWidth
        self.coverHeight = coverHeight
        # marker size should be larger than img
        self.markerWidth = markerWidth
        self.markerHeight = markerHeight

        self.inList = list(inList)
        self.currList = self.inList
        self.outList = outList

        self.groupName = groupName
        self.groupObj = groupObj
        self.numOfLockedItems = numOfLockedItems

        self.IconsSize = iconSize #do ladowania ikon
        self.MarkerSize = self.IconsSize + 45

        self.lastSelection = PlayerSelectorWidget.LAST_SELECTION.get(self.groupName, 0)
        self.calcDisplayVariables()

        # pagination
        self.pageItemSize = 16
        self.pageItemStartX = (offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth - self.numOfPages * self.pageItemSize) / 2
        if screenwidth and screenwidth == 1920:
            self.pageItemStartY = 60
        else:
            self.pageItemStartY = 40

        if screenwidth and screenwidth == 1920:
            skin = """
            <screen name="IPTVPlayerPlayerSelectorWidget" position="center,center" title="E2iPlayer %s" size="%d,%d">
            <widget name="statustext" position="0,0" zPosition="1" size="%d,50" font="Regular;36" halign="center" valign="center" transparent="1"/>
            <widget name="marker" zPosition="2" position="%d,%d" size="%d,%d" transparent="1" alphatest="blend" />
            <widget name="page_marker" zPosition="3" position="%d,%d" size="%d,%d" transparent="1" alphatest="blend" />
            <widget name="menu" zPosition="3" position="%d,10" size="70,30" transparent="1" alphatest="blend" />
            """ % (
              GetIPTVPlayerVerstion(),
              offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth,  # width of window
              offsetCoverY + tmpY * numOfRow + offsetCoverX - disHeight, # height of window
              offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth,  # width of status line
              offsetMarkerX, offsetMarkerY, # first marker position
              markerWidth, markerHeight,    # marker size
              self.pageItemStartX, self.pageItemStartY, # pagination marker
              self.pageItemSize, self.pageItemSize,
              offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth - 70,
              )
        else:
            skin = """
            <screen name="IPTVPlayerPlayerSelectorWidget" position="center,center" title="E2iPlayer %s" size="%d,%d">
            <widget name="statustext" position="0,0" zPosition="1" size="%d,50" font="Regular;26" halign="center" valign="center" transparent="1"/>
            <widget name="marker" zPosition="2" position="%d,%d" size="%d,%d" transparent="1" alphatest="blend" />
            <widget name="page_marker" zPosition="3" position="%d,%d" size="%d,%d" transparent="1" alphatest="blend" />
            <widget name="menu" zPosition="3" position="%d,10" size="70,30" transparent="1" alphatest="blend" />
            """ % (
              GetIPTVPlayerVerstion(),
              offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth,  # width of window
              offsetCoverY + tmpY * numOfRow + offsetCoverX - disHeight, # height of window
              offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth,  # width of status line
              offsetMarkerX, offsetMarkerY, # first marker position
              markerWidth, markerHeight,    # marker size
              self.pageItemStartX, self.pageItemStartY, # pagination marker
              self.pageItemSize, self.pageItemSize,
              offsetCoverX + tmpX * numOfCol + offsetCoverX - disWidth - 70,
              )

        for y in range(1, numOfRow + 1):
            for x in range(1, numOfCol + 1):
                skinCoverLine = """<widget name="cover_%s%s" zPosition="4" position="%d,%d" size="%d,%d" transparent="1" alphatest="blend" />""" % (x, y,
                    (offsetCoverX + tmpX * (x - 1)), # pos X image
                    (offsetCoverY + tmpY * (y - 1)), # pos Y image
                    coverWidth,
                    coverHeight
                )
                skin += '\n' + skinCoverLine

        # add pagination items
        for pageItemOffset in range(self.numOfPages):
            pageItemX = self.pageItemStartX + pageItemOffset * self.pageItemSize
            skinCoverLine = """<ePixmap zPosition="2" position="%d,%d" size="%d,%d" pixmap="%s" transparent="1" alphatest="blend" />""" % (pageItemX, self.pageItemStartY, self.pageItemSize, self.pageItemSize, GetIconDir('radio_button_off.png'))
            skin += '\n' + skinCoverLine
        skin += '</screen>'
        self.skin = skin

        self.session = session
        Screen.__init__(self, session)

        self.session.nav.event.append(self.__event)
        self.onClose.append(self.__onClose)

        # load icons
        self.pixmapList = []
        for idx in range(0, self.numOfItems):
            self.pixmapList.append(LoadPixmap(GetIconDir('PlayerSelector/' + self.currList[idx][1] + '%i.png' % self.IconsSize)))

        self.markerPixmap = LoadPixmap(GetIconDir('PlayerSelector/marker%i.png' % self.MarkerSize))
        self.markerPixmapSel = LoadPixmap(GetIconDir('PlayerSelector/markerSel%i.png' % self.MarkerSize))
        self.pageMarkerPixmap = LoadPixmap(GetIconDir('radio_button_on.png'))
        self.menuPixmap = LoadPixmap(GetIconDir('menu.png'))

        self["actions"] = ActionMap(["WizardActions", "DirectionActions", "ColorActions", "IPTVPlayerListActions"],
        {
            "ok": self.ok_pressed,
            "back": self.back_pressed,
            "left": self.keyLeft,
            "right": self.keyRight,
            "up": self.keyUp,
            "down": self.keyDown,
            "blue": self.keyBlue,
            "menu": self.keyMenu,
        }, -1)

        self["marker"] = Cover3()
        self["page_marker"] = Cover3()
        self["menu"] = Cover3()

        for y in range(1, self.numOfRow + 1):
            for x in range(1, self.numOfCol + 1):
                strIndex = "cover_%s%s" % (x, y)
                self[strIndex] = Cover3()

        self["statustext"] = Label(self.currList[0][0])

        self.onLayoutFinish.append(self.onStart)
        self.visible = True
        self.reorderingMode = False
        self.reorderingItemSelected = False
コード例 #52
0
ファイル: plugin.py プロジェクト: DoeEensGek/e2plugins
    def __init__(self, session, pindex, startslide=True):

        #pindex = 0
        print "SlideShow is running ......."
        self.textcolor = "#ffffff"
        self.bgcolor = "#000000"
        space = 35
        size_w = getDesktop(0).size().width()
        size_h = getDesktop(0).size().height()

        self.skindir = "/tmp"
        self.skin = "<screen name=\"Na Regen Komt Zonneschijn\" 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=\"file\" position=\"" + str(space + 45) + "," + str(
                    space + 10
                ) + "\" size=\"" + str(
                    size_w -
                    (space * 2)
                    - 50
                ) + ",25\" font=\"Regular;20\" halign=\"left\" foregroundColor=\"" + self.textcolor + "\" zPosition=\"2\" noWrap=\"1\" transparent=\"1\" /> \
			</screen>"

        Screen.__init__(self, session)

        InfoBarAspectSelection.__init__(self)
        self["actions"] = ActionMap(
            [
                "OkCancelActions", "MediaPlayerActions", "DirectionActions",
                "MovieSelectionActions"
            ], {
                "cancel": self.Exit,
                "playpauseService": self.PlayPause,
                "play": self.PlayPause,
                "pause": self.PlayPause,
                "left": self.prevPic,
                "right": self.nextPic,
                "seekFwd": self.nextPic,
                "seekBack": self.prevPic,
            }, -1)

        self["pic"] = Pixmap()
        self["file"] = Label(_("Please wait, photo is being loaded ..."))
        self.old_index = 0
        self.picfilelist = []
        self.lastindex = pindex - 1
        self.currPic = []
        self.shownow = True
        self.dirlistcount = 0
        #speed to play! (self.speed*100)
        self.speed = 8

        devicepath = "/tmp/HetWeer/"
        currDir = devicepath
        self.filelist = FileList(currDir,
                                 showDirectories=False,
                                 matchingPattern="^.*\.(png)",
                                 useServiceRef=False)

        for x in self.filelist.getFileList():
            if x[0][1] == False:
                try:
                    self.picfilelist.append(currDir + x[0][0])
                except:
                    break
            else:
                self.dirlistcount += 1

        self.maxentry = pindex - 1
        #len(self.picfilelist)-1
        self.pindex = pindex - 1
        if self.pindex < 0:
            self.pindex = 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)
        if startslide == True:
            self.PlayPause()
コード例 #53
0
    def __init__(self, session, entry=None):
        self.session = session
        Screen.__init__(self, session)

        if entry == None:
            self.setTitle(_("Add birthday"))
            config.plugins.birthdayreminder.name = NoSave(
                ConfigText(default="", fixed_size=False, visible_width=40))
            config.plugins.birthdayreminder.day = NoSave(
                ConfigInteger(default=1, limits=(1, 31)))
            config.plugins.birthdayreminder.month = NoSave(
                ConfigInteger(default=1, limits=(1, 12)))
            config.plugins.birthdayreminder.year = NoSave(
                ConfigInteger(default=1900, limits=(1900, 2050)))
        else:
            self.setTitle(_("Edit birthday"))
            (name, birthday) = entry
            config.plugins.birthdayreminder.name = NoSave(
                ConfigText(default=name, fixed_size=False, visible_width=40))
            config.plugins.birthdayreminder.day = NoSave(
                ConfigInteger(default=birthday.day, limits=(1, 31)))
            config.plugins.birthdayreminder.month = NoSave(
                ConfigInteger(default=birthday.month, limits=(1, 12)))
            config.plugins.birthdayreminder.year = NoSave(
                ConfigInteger(default=birthday.year, limits=(1900, 2050)))

        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Save"))
        self["error"] = Label(_("Invalid date!"))
        self["error"].hide()

        list = []
        list.append(
            getConfigListEntry(_("Name:"),
                               config.plugins.birthdayreminder.name))
        if config.plugins.birthdayreminder.dateFormat.value == "mmddyyyy":
            list.append(
                getConfigListEntry(_("Month:"),
                                   config.plugins.birthdayreminder.month))
            list.append(
                getConfigListEntry(_("Day:"),
                                   config.plugins.birthdayreminder.day))
        else:
            list.append(
                getConfigListEntry(_("Day:"),
                                   config.plugins.birthdayreminder.day))
            list.append(
                getConfigListEntry(_("Month:"),
                                   config.plugins.birthdayreminder.month))
        list.append(
            getConfigListEntry(_("Year:"),
                               config.plugins.birthdayreminder.year))

        ConfigListScreen.__init__(self, list)
        HelpableScreen.__init__(self)

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.cancel, _("Cancel")),
                'ok': (self.ok, _("VirtualKeyBoard")),
            }, -1)

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.cancel, _("Cancel")),
                "green": (self.accept, _("Accept changes")),
            }, -1)
コード例 #54
0
ファイル: Wizard.py プロジェクト: IanSav/enigma2-Beyonwiz
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent)
     self["text"] = StaticText("")
     self.onShow.append(self.setCallback)
コード例 #55
0
ファイル: infobar.py プロジェクト: natko1412/archivczsk
 def __init__(self, session, parent):
     Screen.__init__(self, session)
     self["item"] = StaticText("")
コード例 #56
0
    def __init__(self, session, *args, **kwargs):
        Screen.__init__(self, session)
        if not isinstance(self.skinName, list):
            self.skinName = [self.skinName]
        self.skinName.append("EPGSelection")
        if isinstance(self, HelpableScreen):
            HelpableScreen.__init__(self)

        self.searchargs = args
        self.currSearch = ""
        self.longbuttonpressed = False

        # XXX: we lose sort begin/end here
        self["key_yellow"] = Button(_("New Search"))
        self["key_blue"] = Button(_("Add AutoTimer"))

        # begin stripped copy of EPGSelection.__init__
        self.ChoiceBoxDialog = None
        self.bouquetChangeCB = None
        self.serviceChangeCB = None
        self.ask_time = -1  # now
        self.closeRecursive = False
        self.saved_title = None
        self.lastAsk = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        self["number"] = Label()
        self["number"].hide()
        self.type = EPG_TYPE_SINGLE
        self.currentService = None
        self.zapFunc = None
        self.currch = None
        self.sort_type = 0
        self.eventviewDialog = None
        self["key_red"] = Button(_("IMDb Search"))
        self["key_green"] = Button(_("Add Timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGSearchList(type=self.type,
                                     selChangedCB=self.onSelectionChanged,
                                     timer=session.nav.RecordTimer)

        self["dialogactions"] = HelpableActionMap(self, "WizardActions", {
            "back": (self.closeChoiceBoxDialog, _("Close dialog")),
        }, -1)
        self["dialogactions"].csel = self
        self["dialogactions"].setEnabled(False)

        self["okactions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.closeScreen, _("Exit EPG Search")),
                "OK": (self.epgsearchOK, _("Zap to channel")),
                "OKLong":
                (self.epgsearchOKLong, _("Show detailed event information"))
            }, -1)
        self["okactions"].csel = self

        self["colouractions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.redButtonPressed,
                        _("IMDB search for highlighted event")),
                "green": (self.timerAdd,
                          _("Add/remove/edit timer for highlighted event")),
                "yellow": (self.yellowButtonPressed, _("Enter new search")),
                "yellowlong": (self.showHistory, _("Show search history")),
                "blue": (self.exportAutoTimer,
                         _("Add an AutoTimer for highlighted event")),
                "bluelong":
                (self.blueButtonPressedLong, _("Show AutoTimer list"))
            }, -1)
        self["colouractions"].csel = self

        self["recordingactions"] = HelpableActionMap(
            self, "InfobarInstantRecord", {
                "ShortRecord": (self.doRecordTimer,
                                _("Add a record timer for highlighted event")),
                "LongRecord":
                (self.doZapTimer, _("Add a zap timer for highlighted event"))
            }, -1)
        self["recordingactions"].csel = self

        self["epgactions"] = HelpableActionMap(
            self, "EPGSelectActions", {
                "nextBouquet": (self.nextPage, _("Move down a page")),
                "prevBouquet": (self.prevPage, _("Move up a page")),
                "nextService": (self.prevPage, _("Move up a page")),
                "prevService": (self.nextPage, _("Move down a page")),
                "epg": (self.Info, _("Show detailed event information")),
                "info": (self.Info, _("Show detailed event information")),
                "infolong":
                (self.infoKeyPressed, _("Show detailed event information")),
                "menu": (self.menu, _("Setup menu"))
            }, -1)
        self["epgactions"].csel = self

        self["epgcursoractions"] = HelpableActionMap(
            self, "DirectionActions", {
                "left": (self.prevPage, _("Move up a page")),
                "right": (self.nextPage, _("Move down a page")),
                "up": (self.moveUp, _("Move up")),
                "down": (self.moveDown, _("Move down"))
            }, -1)
        self["epgcursoractions"].csel = self

        self.openHistory = kwargs.get("openHistory", False)

        self.onLayoutFinish.append(self.onCreate)
        # end stripped copy of EPGSelection.__init__

        # Hack to work around the design choice of not calling EPGSelection.__init__
        try:
            self.EPGSearch_init(self, session)
        except:
            pass

        # Partnerbox
        if PartnerBoxIconsEnabled:
            EPGSelection.PartnerboxInit(self, False)

        self.refreshTimer = eTimer()
        self.refreshTimer.callback.append(self.refreshlist)

        self.startTimer = eTimer()
        self.startTimer.callback.append(self.startUp)
        self.startTimer.start(10, 1)

        self.searchStartTimer = eTimer()

        # Hook up actions for yttrailer if installed
        try:
            from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
        except ImportError as ie:
            pass
        else:
            if baseEPGSelection__init__ is not None:
                self["trailerActions"] = ActionMap(
                    ["InfobarActions", "InfobarTeletextActions"], {
                        "showTv": self.showTrailer,
                        "showRadio": self.showTrailerList,
                        "startTeletext": self.showConfig
                    })
コード例 #57
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.__event_tracker = ServiceEventTracker(
         screen=self, eventmap={iPlayableService.evStart: self.__evStart})
コード例 #58
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.session = session

        skin = skin_path + 'jmx_playlist.xml'
        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('Playlists')

        self.drawList = []
        self.playlists_all = []

        # check if playlists.txt file exists in specified location
        if os.path.isfile(
                playlist_path) and os.stat(playlist_path).st_size > 0:
            self.removeBlanks()
            self.checkFile()
        else:
            open(playlist_path, 'a').close()

        self["playlists"] = List(self.drawList)
        self['lab1'] = Label(_('Loading data... Please wait...'))

        if jglob.playlist_exists is not True:
            self['key_red'] = StaticText(_('Back'))
            self['key_green'] = StaticText(_('Add Playlist'))
            self['key_yellow'] = StaticText('')
            self['key_blue'] = StaticText('')
            self['key_channelup'] = StaticText('')
            self['key_info'] = StaticText('')
            self['lastupdate'] = Label('')
            self['liveupdate'] = Label('')
            self['vodupdate'] = Label('')
            self['seriesupdate'] = Label('')
            self['description'] = Label(
                'Press Green to add your playlist details.\nOr enter your playlist url in %s'
                % cfg.location.value +
                'playlists.txt\ne.g. http://domain.xyx:8000/get.php?username=user&password=pass&type=m3u_plus&output=ts'
            )

            self['setupActions'] = ActionMap(
                ['ColorActions', 'OkCancelActions'], {
                    'red': self.quit,
                    'green': self.addPlaylist,
                    'cancel': self.quit
                }, -2)

        else:
            self['setupActions'] = ActionMap(
                [
                    'ColorActions', 'SetupActions', 'TvRadioActions',
                    'ChannelSelectEPGActions'
                ], {
                    'red': self.quit,
                    'green': self.addPlaylist,
                    'yellow': self.editPlaylist,
                    'blue': self.deletePlaylist,
                    'info': self.openUserInfo,
                    'showEPGList': self.openUserInfo,
                    'keyTV': self.createBouquet,
                    'ok': self.createBouquet,
                    'cancel': self.quit
                }, -2)

            self['key_red'] = StaticText(_('Back'))
            self['key_green'] = StaticText(_('Add Playlist'))
            self['key_yellow'] = StaticText(_('Edit Playlist'))
            self['key_blue'] = StaticText(_('Delete Playlist'))
            self['key_info'] = StaticText(_('User Info'))
            self['description'] = Label(
                _('Press OK to create bouquets. \nView your bouquets by exiting the Jedi plugin and then press the TV button. \nGo into EPG Importer plugin settings, select your playlist in sources... Save... Manually download sources.'
                  ))
            self['lastupdate'] = Label(_('Last Update:'))
            self['liveupdate'] = Label('Live: ---')
            self['vodupdate'] = Label('Vod: ---')
            self['seriesupdate'] = Label('Series: ---')

        self.onLayoutFinish.append(self.__layoutFinished)

        jglob.current_selection = 0

        self.list = []

        self.timer = eTimer()
        self.timer.start(100, 1)
        try:  # DreamOS fix
            self.timer_conn = self.timer.timeout.connect(self.loadPlaylist)
        except:
            self.timer.callback.append(self.loadPlaylist)
コード例 #59
0
ファイル: About.py プロジェクト: builder07/enigma2_python3
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("DVB information"))

		DVBInformationText = _("DVB information") + "\n"

		DVBInformationText += "\n"

		DVBInformationText += _("DVB API: ") + about.getDVBAPI() + "\n"

		if fileExists("/usr/bin/dvb-fe-tool"):
			import time
			try:
				cmd = 'dvb-fe-tool > /tmp/dvbfetool.txt'
				Console().ePopen(cmd)
				cmdv = "dvb-fe-tool | grep -o 'DVB API Version [0-9].[0-9]*' | sed 's|[^0-9]*||' > /tmp/dvbapiversion.txt"
				Console().ePopen(cmdv)
				time.sleep(0.1)
			except:
				pass

		if fileExists("/tmp/dvbapiversion.txt"):
			dvbapiversion = open("/tmp/dvbapiversion.txt", "r").read().strip()
			DVBInformationText += _("DVB API version: ") + dvbapiversion + "\n"

		DVBInformationText += "\n"

		if boxbranding.getHaveTranscoding() == "True":
			DVBInformationText += _("Transcoding: ") + _("Yes") + "\n"
		else:
			DVBInformationText += _("Transcoding: ") + _("No") + "\n"

		if boxbranding.getHaveMultiTranscoding() == "True":
			DVBInformationText += _("MultiTranscoding: ") + _("Yes") + "\n"
		else:
			DVBInformationText += _("MultiTranscoding: ") + _("No") + "\n"

		DVBInformationText += "\n"

		if fileExists("/tmp/dvbfetool.txt"):
			if fileHas("/tmp/dvbfetool.txt","DVBC") or fileHas("/tmp/dvbfetool.txt","DVB-C"):
				DVBInformationText += _("DVB-C: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("DVB-C: ") + _("No") + "\n"
			if fileHas("/tmp/dvbfetool.txt","DVBS") or fileHas("/tmp/dvbfetool.txt","DVB-S"):
				DVBInformationText += _("DVB-S: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("DVB-S: ") + _("No") + "\n"
			if fileHas("/tmp/dvbfetool.txt","DVBT") or fileHas("/tmp/dvbfetool.txt","DVB-T"):
				DVBInformationText += _("DVB-T: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("DVB-T: ") + _("No") + "\n"

			DVBInformationText += "\n"

			if fileHas("/tmp/dvbfetool.txt","MULTISTREAM"):
				DVBInformationText += _("Multistream: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("Multistream: ") + _("No") + "\n"

			DVBInformationText += "\n"

			if fileHas("/tmp/dvbfetool.txt","ANNEX_A") or fileHas("/tmp/dvbfetool.txt","ANNEX-A"):
				DVBInformationText += _("ANNEX-A: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("ANNEX-A: ") + _("No") + "\n"
			if fileHas("/tmp/dvbfetool.txt","ANNEX_B") or fileHas("/tmp/dvbfetool.txt","ANNEX-B"):
				DVBInformationText += _("ANNEX-B: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("ANNEX-B: ") + _("No") + "\n"
			if fileHas("/tmp/dvbfetool.txt","ANNEX_C") or fileHas("/tmp/dvbfetool.txt","ANNEX-C"):
				DVBInformationText += _("ANNEX-C: ") + _("Yes") + "\n"
			else:
				DVBInformationText += _("ANNEX-C: ") + _("No") + "\n"

		self["AboutScrollLabel"] = ScrollLabel(DVBInformationText)
		self["key_red"] = Button(_("Close"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
コード例 #60
0
ファイル: FTPBrowser.py プロジェクト: grantor/enigma2-plugins
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        InfoBarNotifications.__init__(self)
        self.ftpclient = None
        self.queueManagerInstance = None
        self.file = None
        self.queue = None
        self.currlist = "local"

        # # NOTE: having self.checkNotifications in onExecBegin might make our gui
        # disappear, so let's move it to onShow
        self.onExecBegin.remove(self.checkNotifications)
        self.onShow.append(self.checkNotifications)

        # Init what we need for dl progress
        self.currentLength = 0
        self.lastLength = 0
        self.lastTime = 0
        self.lastApprox = 0
        self.fileSize = 0

        self["localText"] = StaticText(_("Local"))
        self["local"] = FileList("/media/hdd/", showMountpoints=False)
        self["remoteText"] = StaticText(_("Remote (not connected)"))
        self["remote"] = FTPFileList()
        self["eta"] = StaticText("")
        self["speed"] = StaticText("")
        self["progress"] = VariableProgressSource()
        self["key_red"] = StaticText(_("Exit"))
        self["key_green"] = StaticText(_("Rename"))
        self["key_yellow"] = StaticText(_("Delete"))
        self["key_blue"] = StaticText(_("Upload"))

        self.server = None

        self["ftpbrowserBaseActions"] = HelpableActionMap(
            self, "ftpbrowserBaseActions", {
                "ok": (self.ok, _("enter directory/get file/put file")),
                "cancel": (self.cancel, _("close")),
                "menu": (self.menu, _("open menu")),
            }, -2)

        self["ftpbrowserListActions"] = HelpableActionMap(
            self, "ftpbrowserListActions", {
                "channelUp": (self.setLocal, _("Select local file list")),
                "channelDown": (self.setRemote, _("Select remote file list")),
            })

        self["actions"] = ActionMap(
            ["ftpbrowserDirectionActions", "ColorActions"], {
                "up": self.up,
                "down": self.down,
                "left": self.left,
                "right": self.right,
                "green": self.rename,
                "yellow": self.delete,
                "blue": self.transfer,
            }, -2)

        self.onExecBegin.append(self.reinitialize)