def __init__(self, callback = None):
		Pixmap.__init__(self)
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.paintIconPixmapCB)
		self.callback = callback
		self.picloaded = False
		self.showPic = False
	def __init__(self):
		print "start MediaPixmap"
		Pixmap.__init__(self)
		self.coverArtFileName = ""
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.paintCoverArtPixmapCB)
		self.coverFileNames = ["folder.png", "folder.jpg"]
示例#3
0
 def onShow(self):
     Pixmap.onShow(self)
     sc = AVSwitch().getFramebufferScale()
     # 0=Width 1=Height 2=Aspect 3=use_cache 4=resize_type 5=Background(#AARRGGBB)
     self.picload.setPara(
         (self.instance.size().width(), self.instance.size().height(), sc[0], sc[1], False, 1, "#00000000")
     )
 def __init__(self, callback=None):
     Pixmap.__init__(self)
     self.picload = ePicLoad()
     self.picload_conn = self.picload.PictureData.connect(self.paintIconPixmapCB)
     self.callback = callback
     self.picloaded = False
     self.showPic = False
 def onShow(self):
     Pixmap.onShow(self)
     if self.instance.size().width() > 0:
         self.picload.setPara(
             (self.instance.size().width(), self.instance.size().height(), 1, 1, False, 1, "#00000000")
         )
         self.showPic = True
 def __init__(self):
     Pixmap.__init__(self)
     Pixmap.hide(self)
     self.visible = False
     
     self.framesList = []
     self.currFrame = -1
示例#7
0
	def __init__(self):
		Pixmap.__init__(self)
		self.pictureFileName = "__default__"
		self.defaultPixmap = None

		self.picload = ePicLoad()
		self.picload_conn = self.picload.PictureData.connect(self.paintPixmapCB)
		self.pictureFileNames = ["cover.jpg", "folder.png", "folder.jpg"]
 def preWidgetRemove(self, instance):
     printDBG("Cover.preWidgetRemove ---------------------------")
     if None != self.picload_conn:
         printDBG("Cover.preWidgetRemove Wife bug detected :)")
         self.picload_conn = None
     try:
         if 'preWidgetRemove' in dir(Pixmap):
             Pixmap.preWidgetRemove(self, instance)
     except: printExc()
示例#9
0
	def onShow(self):
		Pixmap.onShow(self)
		coverwidth=self.instance.size().width()
		if int(config.plugins.shoutcast.coverwidth.value) > coverwidth:
			config.plugins.shoutcast.coverwidth.value = str(coverwidth)
		coverheight=self.instance.size().height()
		if int(config.plugins.shoutcast.coverheight.value) > coverheight:
			config.plugins.shoutcast.coverheight.value = str(coverheight)	
		self.picload.setPara((coverwidth, coverheight, 1, 1, False, 1, "#00000000"))
 def __init__(self):
     printDBG("Cover.__init__ ---------------------------")
     Pixmap.__init__(self)       
     self.picload = ePicLoad()
     
     self.currIcon = {}
     self.waitIcon = {}
     self.paramsSet = False
     
     self.decoding = False
     self.picload_conn = None
示例#11
0
 def onShow(self):
     Pixmap.onShow(self)
     sc = AVSwitch().getFramebufferScale()
     self._aspectRatio = eSize(sc[0], sc[1])
     self._scaleSize = self.instance.size()
     self.picload.setPara((self._scaleSize.width(),
      self._scaleSize.height(),
      sc[0],
      sc[1],
      True,
      2,
      '#ff000000'))
示例#12
0
文件: plugin.py 项目: OpenDMM/enigma2
	def __init__(self, session):
		Screen.__init__(self, session)

		self["color_hint"] = Label(_("Some Remotes may exist in other Colors"))
		self["ok"] = Label(_("Press OK to apply"))

		self._pixmap = Pixmap()
		self["rc"] = self._pixmap

		self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
			{
				"ok": self._ok,
				"cancel": self._cancel,
				"right": self._next,
				"left": self._prev,
			})

		self._pixmaps = []
		for i in (0, 1, 2):
			self._pixmaps.append(
				LoadPixmap(
					resolveFilename(SCOPE_SKIN, "skin_default/rc%s.png" % (i))
				)
			)

		self._index = -1
		self.onFirstExecBegin.append(self._firstExecBegin)
示例#13
0
	def applySkin(self, desktop, screen):
		from Tools.LoadPixmap import LoadPixmap
		noCoverFile = None
		if self.skinAttributes is not None:
			for (attrib, value) in self.skinAttributes:
				if attrib == "pixmap":
					noCoverFile = value
					break
		if noCoverFile is None:
			noCoverFile = resolveFilename(SCOPE_ACTIVE_SKIN, "no_coverArt.png")
		self.noCoverPixmap = LoadPixmap(noCoverFile)
		return Pixmap.applySkin(self, desktop, screen)
示例#14
0
	def applySkin(self, desktop, screen):
		from Tools.LoadPixmap import LoadPixmap
		defaultPixmap = None
		if self.skinAttributes is not None:
			for (attrib, value) in self.skinAttributes:
				if attrib == "pixmap":
					defaultPixmap = value
					break
		if defaultPixmap is None:
			defaultPixmap = resolveFilename(SCOPE_CURRENT_SKIN, )
		self.defaultPixmap = LoadPixmap(defaultPixmap)

		return Pixmap.applySkin(self, desktop, screen)
示例#15
0
	def __init__(self, session, services, zapFunc=None, bouquetChangeCB=None, bouquetname=""):
		Screen.__init__(self, session)
		self.bouquetChangeCB = bouquetChangeCB
		now = time() - config.epg.histminutes.getValue() * 60
		self.ask_time = now - now % int(config.misc.graph_mepg.roundTo.getValue())
		self["key_red"] = Button("")
		self["key_green"] = Button("")

		global listscreen
		if listscreen:
			self["key_yellow"] = Button(_("Normal mode"))
			self.skinName="GraphMultiEPGList"
		else:
			self["key_yellow"] = Button(_("List mode"))

		self["key_blue"] = Button(_("Goto"))

		self.key_green_choice = self.EMPTY
		self.key_red_choice = self.EMPTY
		self["timeline_text"] = TimelineText()
		self["Service"] = ServiceEvent()
		self["Event"] = Event()
		self.time_lines = [ ]
		for x in range(0, MAX_TIMELINES):
			pm = Pixmap()
			self.time_lines.append(pm)
			self["timeline%d"%(x)] = pm
		self["timeline_now"] = Pixmap()
		self.services = services
		self.zapFunc = zapFunc
		if bouquetname != "":
			Screen.setTitle(self, bouquetname)

		self["list"] = EPGList( selChangedCB = self.onSelectionChanged,
					timer = self.session.nav.RecordTimer,
					time_epoch = config.misc.graph_mepg.prev_time_period.value,
					overjump_empty = config.misc.graph_mepg.overjump.value)

		HelpableScreen.__init__(self)
		self["okactions"] = HelpableActionMap(self, "OkCancelActions",
			{
				"cancel": (self.closeScreen,   _("Exit EPG")),
				"ok":	  (self.eventSelected, _("Zap to selected channel, or show detailed event info (depends on configuration)"))
			}, -1)
		self["okactions"].csel = self
		self["epgactions"] = HelpableActionMap(self, "EPGSelectActions",
			{
				"timerAdd":    (self.timerAdd,       _("Add/remove timer for current event")),
				"info":        (self.infoKeyPressed, _("Show detailed event info")),
				"red":         (self.zapTo,          _("Zap to selected channel")),
				"yellow":      (self.swapMode,       _("Switch between normal mode and list mode")),	
				"blue":        (self.enterDateTime,  _("Goto specific data/time")),
				"menu":        (self.showSetup,      _("Setup menu")),
				"nextBouquet": (self.nextBouquet,    _("Show bouquet selection menu")),
				"prevBouquet": (self.prevBouquet,    _("Show bouquet selection menu")),
				"nextService": (self.nextPressed,    _("Goto next page of events")),
				"prevService": (self.prevPressed,    _("Goto previous page of events")),
				"preview":     (self.preview,        _("Preview selected channel")),
				"nextDay":     (self.nextDay,        _("Goto next day of events")),
				"prevDay":     (self.prevDay,        _("Goto previous day of events"))
			}, -1)
		self["epgactions"].csel = self

		self["inputactions"] = HelpableActionMap(self, "InputActions",
			{
				"left":  (self.leftPressed,  _("Go to previous event")),
				"right": (self.rightPressed, _("Go to next event")),
				"1":     (self.key1,         _("Set time window to 1 hour")),
				"2":     (self.key2,         _("Set time window to 2 hours")),
				"3":     (self.key3,         _("Set time window to 3 hours")),
				"4":     (self.key4,         _("Set time window to 4 hours")),
				"5":     (self.key5,         _("Set time window to 5 hours")),
				"6":     (self.key6,         _("Set time window to 6 hours")),
				"7":     (self.prevPage,     _("Go to previous page of service")),
				"9":     (self.nextPage,     _("Go to next page of service")),
				"8":     (self.toTop,        _("Go to first service")),
				"0":     (self.toEnd,        _("Go to last service"))
			}, -1)
		self["inputactions"].csel = self

		self.updateTimelineTimer = eTimer()
		self.updateTimelineTimer.callback.append(self.moveTimeLines)
		self.updateTimelineTimer.start(60 * 1000)
		self.onLayoutFinish.append(self.onCreate)
		self.previousref = self.session.nav.getCurrentlyPlayingServiceOrGroup()
示例#16
0
	def __init__(self, session, args=None):
		Screen.__init__(self, session)
		self.session = session
		self.Scale = AVSwitch().getFramebufferScale()
		self.PicLoad = ePicLoad()

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

		self["helperimage"] = Pixmap()
		self["helpertext"] = Label()

		self["titleText"] = StaticText("")
		self["titleText"].setText(_("Backup & Restore my settings"))

		self["cancelBtn"] = StaticText("")
		self["cancelBtn"].setText(_("Cancel"))

		self["saveBtn"] = StaticText("")
		self["saveBtn"].setText(_("Backup"))

		self["loadBtn"] = StaticText("")
		self["loadBtn"].setText(_("Restore"))

		self["deleteBtn"] = StaticText("")
		self["deleteBtn"].setText(_("Delete"))

		self.myset = ConfigSelectionNumber(1, 99, 1, default=1, wraparound=True)
		self.myname = ConfigText(default=_("My Backup No. %d") % self.myset.value, visible_width=50, fixed_size=False)
		self.mydate = ""
		self.mylastBackup = ""
		self.mylastRestore = ""
		self.file = []

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

		self["actions"] = ActionMap(
		[
			"OkCancelActions",
			"DirectionActions",
			"InputActions",
			"ColorActions"
		],
		{
			"left": self.keyLeft,
			"down": self.keyDown,
			"up": self.keyUp,
			"right": self.keyRight,
			"red": self.exit,
			"green": self.restoreQ,
			"yellow": self.backupQ,
			"blue": self.deleteQ,
			"cancel": self.exit,
			"ok": self.renameName
		}, -1)

		self.changedEntry(True)
		self.onLayoutFinish.append(self.UpdatePicture)
示例#17
0
	def __init__(self, default = None):
		Pixmap.__init__(self)
		self.picload = ePicLoad()
		self.picload_conn = eConnectCallback(self.picload.PictureData, self.setPixmapCB)
		self.cachedir = "/tmp/"
		self.default = default
示例#18
0
文件: plugin.py 项目: OpenDMM/enigma2
class RemoteControlSelection(Screen):
	SKIN_DEFAULT = "skin_default"

	skin = """
		<screen name="RemoteControlSelection" position="center,80" size="420,610" title="RemoteControlSelection" >
			<widget name="rc" pixmap="skin_default/rc0.png" position="20,10" size="380,500" alphatest="on"/>
			<widget name="color_hint" position="10,520" size="400,50" font="Regular;18" halign="center" valign="center" backgroundColor="background" transparent="0" />
			<widget name="ok" position="10,580" size="400,24" font="Regular;22" halign="center" valign="center" backgroundColor="background" transparent="0" />
		</screen>
	"""

	def __init__(self, session):
		Screen.__init__(self, session)

		self["color_hint"] = Label(_("Some Remotes may exist in other Colors"))
		self["ok"] = Label(_("Press OK to apply"))

		self._pixmap = Pixmap()
		self["rc"] = self._pixmap

		self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
			{
				"ok": self._ok,
				"cancel": self._cancel,
				"right": self._next,
				"left": self._prev,
			})

		self._pixmaps = []
		for i in (0, 1, 2):
			self._pixmaps.append(
				LoadPixmap(
					resolveFilename(SCOPE_SKIN, "skin_default/rc%s.png" % (i))
				)
			)

		self._index = -1
		self.onFirstExecBegin.append(self._firstExecBegin)

	def _firstExecBegin(self):
		self.setTitle(_("Select your Remote"))
		self.setCurrentPixmap(config.misc.rcused.value)

	def _ok(self):
		config.misc.rcused.value = self._index
		config.misc.rcused.save()
		Log.i("RC is now set to Model %s" %(config.misc.rcused.value))
		self.close()

	def _cancel(self):
		self.close()

	def setCurrentPixmap(self, index):
		if index > 2:
			index = 0
		if index < 0:
			index = 2
		self._index = index
		self._pixmap.setPixmap(self._pixmaps[index])

	def _next(self):
		self._pixmap.setShowHideAnimation("slide_right_to_left")
		self.setCurrentPixmap(self._index + 1)

	def _prev(self):
		self._pixmap.setShowHideAnimation("slide_left_to_right")
		self.setCurrentPixmap(self._index - 1)
示例#19
0
 def __init__(self):
     Pixmap.__init__(self)
     self.IconFileName = ''
     self.picload = ePicLoad()
     self.picload.PictureData.get().append(self.paintIconPixmapCB)
示例#20
0
 def __init__(self,
              session,
              text,
              type=TYPE_YESNO,
              timeout=-1,
              close_on_any_key=False,
              default=True,
              enable_input=True,
              msgBoxID=None,
              picon=True,
              simple=False,
              wizard=False,
              list=None,
              skin_name=None,
              timeout_default=None,
              windowTitle=None,
              title='Message'):
     if not windowTitle:
         windowTitle = title
     if not list:
         list = []
     if not skin_name:
         skin_name = []
     self.type = type
     Screen.__init__(self, session)
     self.skinName = ['MessageBox']
     if self.type == self.TYPE_YESNO:
         self.setTitle(_('Question'))
     elif self.type == self.TYPE_INFO:
         self.setTitle(_('Information'))
     elif self.type == self.TYPE_WARNING:
         self.setTitle(_('Warning'))
     elif self.type == self.TYPE_ERROR:
         self.setTitle(_('Error'))
     else:
         self.setTitle(_(windowTitle))
     if wizard:
         from Components.config import config
         from Components.Pixmap import MultiPixmap
         self['rc'] = MultiPixmap()
         self['rc'].setPixmapNum(config.misc.rcused.value)
         self.skinName = ['MessageBoxWizard']
     if simple:
         self.skinName = ['MessageBoxSimple']
     if isinstance(skin_name, str):
         self.skinName = [skin_name] + self.skinName
     self.msgBoxID = msgBoxID
     self['text'] = Label(_(text))
     self['Text'] = StaticText(_(text))
     self['selectedChoice'] = StaticText()
     self.text = _(text)
     self.close_on_any_key = close_on_any_key
     self.timeout_default = timeout_default
     self['ErrorPixmap'] = Pixmap()
     self['ErrorPixmap'].hide()
     self['QuestionPixmap'] = Pixmap()
     self['QuestionPixmap'].hide()
     self['InfoPixmap'] = Pixmap()
     self['InfoPixmap'].hide()
     self['WarningPixmap'] = Pixmap()
     self['WarningPixmap'].hide()
     self.timerRunning = False
     self.initTimeout(timeout)
     if picon:
         picon = type
         if picon == self.TYPE_ERROR:
             self['ErrorPixmap'].show()
         elif picon == self.TYPE_YESNO:
             self['QuestionPixmap'].show()
         elif picon == self.TYPE_INFO or picon == self.TYPE_WARNING:
             self['InfoPixmap'].show()
         if picon != self.TYPE_WARNING:
             self['WarningPixmap'].hide()
     self.setTitle(
         self.type < self.TYPE_MESSAGE
         and [_('Question'),
              _('Information'),
              _('Warning'),
              _('Error')][self.type] or 'Message')
     if type == self.TYPE_YESNO:
         if list:
             self.list = list
         elif default:
             self.list = [(_('yes'), True), (_('no'), False)]
         else:
             self.list = [(_('no'), False), (_('yes'), True)]
     else:
         self.list = []
     self['list'] = MenuList(self.list)
     if self.list:
         self['selectedChoice'].setText(self.list[0][0])
     else:
         self['list'].hide()
     if enable_input:
         self['actions'] = ActionMap(
             ['MsgBoxActions', 'DirectionActions'], {
                 'cancel': self.cancel,
                 'ok': self.ok,
                 'alwaysOK': self.alwaysOK,
                 'up': self.up,
                 'down': self.down,
                 'left': self.left,
                 'right': self.right,
                 'upRepeated': self.up,
                 'downRepeated': self.down,
                 'leftRepeated': self.left,
                 'rightRepeated': self.right
             }, -1)
示例#21
0
 def __init__(self):
     Pixmap.__init__(self)
     self.picload = ePicLoad()
     self.picload.PictureData.get().append(self.paintIconPixmapCB)
     self.paramsSet = False
示例#22
0
	def __init__(self, list, session=None, on_change=None, fullUI=False):
		self.entryChanged = on_change if on_change is not None else lambda: None
		if fullUI:
			if "key_red" not in self:
				self["key_red"] = StaticText(_("Cancel"))
			if "key_green" not in self:
				self["key_green"] = StaticText(_("Save"))
			self["fullUIActions"] = HelpableActionMap(self, ["ConfigListActions"], {
				"cancel": (self.keyCancel, _("Cancel any changed settings and exit")),
				"close": (self.closeRecursive, _("Cancel any changed settings and exit all menus")),
				"save": (self.keySave, _("Save all changed settings and exit"))
			}, prio=1, description=_("Common Setup Actions"))
		if "key_menu" not in self:
			self["key_menu"] = StaticText(_("MENU"))
		if "HelpWindow" not in self:
			self["HelpWindow"] = Pixmap()
			self["HelpWindow"].hide()
		if "VKeyIcon" not in self:
			self["VKeyIcon"] = Boolean(False)
		self["configActions"] = HelpableActionMap(self, ["ConfigListActions"], {
			"select": (self.keySelect, _("Select, toggle, process or edit the current entry"))
		}, prio=1, description=_("Common Setup Actions"))
		self["navigationActions"] = HelpableActionMap(self, ["NavigationActions"], {
			"top": (self.keyTop, _("Move to first line / screen")),
			"pageUp": (self.keyPageUp, _("Move up a screen")),
			"up": (self.keyUp, _("Move up a line")),
			"first": (self.keyFirst, _("Jump to first item in list or the start of text")),
			"left": (self.keyLeft, _("Select the previous item in list or move cursor left")),
			"right": (self.keyRight, _("Select the next item in list or move cursor right")),
			"last": (self.keyLast, _("Jump to last item in list or the end of text")),
			"down": (self.keyDown, _("Move down a line")),
			"pageDown": (self.keyPageDown, _("Move down a screen")),
			"bottom": (self.keyBottom, _("Move to last line / screen"))
		}, prio=1, description=_("Common Setup Actions"))
		self["menuConfigActions"] = HelpableActionMap(self, "ConfigListActions", {
			"menu": (self.keyMenu, _("Display selection list as a selection menu")),
		}, prio=1, description=_("Common Setup Actions"))
		self["menuConfigActions"].setEnabled(False if fullUI else True)
		self["editConfigActions"] = HelpableNumberActionMap(self, ["NumberActions", "TextEditActions"], {
			"backspace": (self.keyBackspace, _("Delete character to left of cursor or select AM times")),
			"delete": (self.keyDelete, _("Delete character under cursor or select PM times")),
			"erase": (self.keyErase, _("Delete all the text")),
			"toggleOverwrite": (self.keyToggle, _("Toggle new text inserts before or overwrites existing text")),
			"1": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"2": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"3": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"4": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"5": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"6": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"7": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"8": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"9": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"0": (self.keyNumberGlobal, _("Number or SMS style data entry")),
			"gotAsciiCode": (self.keyGotAscii, _("Keyboard data entry"))
		}, prio=1, description=_("Common Setup Actions"))
		self["editConfigActions"].setEnabled(False if fullUI else True)
		self["VirtualKB"] = HelpableActionMap(self, "VirtualKeyboardActions", {
			"showVirtualKeyboard": (self.keyText, _("Display the virtual keyboard for data entry"))
		}, prio=1, description=_("Common Setup Actions"))
		self["VirtualKB"].setEnabled(False)
		self["config"] = ConfigList(list, session=session)
		self.setCancelMessage(None)
		self.setRestartMessage(None)
		self.onChangedEntry = []
		if self.noNativeKeys not in self.onLayoutFinish:
			self.onLayoutFinish.append(self.noNativeKeys)
		if self.handleInputHelpers not in self["config"].onSelectionChanged:
			self["config"].onSelectionChanged.append(self.handleInputHelpers)
		if self.showHelpWindow not in self.onExecBegin:
			self.onExecBegin.append(self.showHelpWindow)
		if self.hideHelpWindow not in self.onExecEnd:
			self.onExecEnd.append(self.hideHelpWindow)
示例#23
0
    def __init__(self, session, *args):
        Screen.__init__(self, session)
        Screen.setTitle(self, _("Software Panel"))
        skin = """
		<screen name="SoftwarePanel" position="center,center" size="650,605" title="Software Panel">
			<widget name="a_off" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/icons/aoff.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="a_red" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/icons/ared.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="a_yellow" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/icons/ayellow.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="a_green" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/Infopanel/icons/agreen.png" position="10,10" zPosition="1" size="36,97" alphatest="on" />
			<widget name="feedstatusRED" position="60,14" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" />
			<widget name="feedstatusYELLOW" position="60,46" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" />
			<widget name="feedstatusGREEN" position="60,78" size="200,30" zPosition="1" font="Regular;25" halign="left" transparent="1" />
			<widget name="packagetext" position="180,50" size="350,30" zPosition="1" font="Regular;25" halign="right" transparent="1" />
			<widget name="packagenr" position="511,50" size="50,30" zPosition="1" font="Regular;25" halign="right" transparent="1" />
			<widget source="list" render="Listbox" position="10,120" size="630,365" scrollbarMode="showOnDemand">
				<convert type="TemplatedMultiContent">
					{"template": [
							MultiContentEntryText(pos = (5, 1), size = (540, 28), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
							MultiContentEntryText(pos = (5, 26), size = (540, 20), font=1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is the description
							MultiContentEntryPixmapAlphaBlend(pos = (545, 2), size = (48, 48), png = 4), # index 4 is the status pixmap
							MultiContentEntryPixmapAlphaBlend(pos = (5, 50), size = (610, 2), png = 5), # index 4 is the div pixmap
						],
					"fonts": [gFont("Regular", 22),gFont("Regular", 14)],
					"itemHeight": 52
					}
				</convert>
			</widget>
			<ePixmap pixmap="skin_default/buttons/red.png" position=" 30,570" size="35,27" alphatest="blend" />
			<widget name="key_green_pic" pixmap="skin_default/buttons/green.png" position="290,570" size="35,27" alphatest="blend" />
			<widget name="key_red" position=" 80,573" size="200,26" zPosition="1" font="Regular;22" halign="left" transparent="1" />
			<widget name="key_green" position="340,573" size="200,26" zPosition="1" font="Regular;22" halign="left" transparent="1" />
		</screen> """
        self.skin = skin
        self.list = []
        self.statuslist = []
        self["list"] = List(self.list)
        self['a_off'] = Pixmap()
        self['a_red'] = Pixmap()
        self['a_yellow'] = Pixmap()
        self['a_green'] = Pixmap()
        self['key_green_pic'] = Pixmap()
        self['key_red_pic'] = Pixmap()
        self['key_red'] = Label(_("Cancel"))
        self['key_green'] = Label(_("Update"))
        self['packagetext'] = Label(_("Updates Available:"))
        self['packagenr'] = Label("0")
        self['feedstatusRED'] = Label("<  " + _("feed status"))
        self['feedstatusYELLOW'] = Label("<  " + _("feed status"))
        self['feedstatusGREEN'] = Label("<  " + _("feed status"))
        self['key_green'].hide()
        self['key_green_pic'].hide()
        self.update = False
        self.packages = 0
        self.ipkg = IpkgComponent()
        self.ipkg.addCallback(self.ipkgCallback)
        self["actions"] = ActionMap([
            "OkCancelActions", "DirectionActions", "ColorActions",
            "SetupActions"
        ], {
            "cancel": self.Exit,
            "green": self.Green,
            "red": self.Exit,
        }, -2)

        self.onLayoutFinish.append(self.layoutFinished)
示例#24
0
	def __init__(self, session, tlist, menuTitle):
		Screen.__init__(self, session)
		self.skinName = 'Iconmain'
		self.tlist = tlist
		ipage = 1
		list = []
		nopic = len(self.tlist)
		self.pos = []
		self.ipage = 1
		self.index = 0
		title = menuTitle
		self['title'] = Button(title)
		self.icons = []
		self.indx = []
		n1 = len(tlist)
		self.picnum = n1
		list = []
		tlist = []
		self['label1'] = StaticText()
		self['label2'] = StaticText()
		self['label3'] = StaticText()
		self['label4'] = StaticText()
		self['label5'] = StaticText()
		self['label6'] = StaticText()
		self['label1s'] = StaticText()
		self['label2s'] = StaticText()
		self['label3s'] = StaticText()
		self['label4s'] = StaticText()
		self['label5s'] = StaticText()
		self['label6s'] = StaticText()
		self['pointer'] = Pixmap()
		self['pixmap1'] = Pixmap()
		self['pixmap2'] = Pixmap()
		self['pixmap3'] = Pixmap()
		self['pixmap4'] = Pixmap()
		self['pixmap5'] = Pixmap()
		self['pixmap6'] = Pixmap()
		self['red'] = Button(_('Exit'))
		self['green'] = Button(_('Select'))
		self['yellow'] = Button(_('Config'))
		self['actions'] = NumberActionMap(['OkCancelActions',
		 'MenuActions',
		 'DirectionActions',
		 'NumberActions',
		 'ColorActions'], {'ok': self.okbuttonClick,
		 'cancel': self.closeNonRecursive,
		 'left': self.key_left,
		 'right': self.key_right,
		 'up': self.key_up,
		 'down': self.key_down,
		 'red': self.cancel,
		 'green': self.okbuttonClick,
		 'yellow': self.key_menu,
		 'menu': self.closeRecursive,
		 '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})
		self.index = 0
		i = 0
		self.maxentry = 29
		self.istart = 0
		i = 0
		self.onShown.append(self.openTest)
示例#25
0
	def __init__(self, session, parent):
		self.parentmenu = parent
		Screen.__init__(self, session)
		self["key_blue"] = StaticText("")
		self["menu"] = List([])
		self["menu"].enableWrapAround = True
		self.showNumericHelp = False
		self.createMenuList()

		# for the skin: first try a menu_<menuID>, then Menu
		self.skinName = [ ]
		if self.menuID is not None:
			if config.usage.menutype.value == 'horzanim' and findSkinScreen("Animmain"):
				self.skinName.append('Animmain')
			elif config.usage.menutype.value == 'horzicon' and findSkinScreen("Iconmain"):
				self.skinName.append('Iconmain')
			else:
				self.skinName.append('menu_' + self.menuID)
		self.skinName.append("Menu")
		ProtectedScreen.__init__(self)
		self["actions"] = NumberActionMap(["OkCancelActions", "MenuActions", "NumberActions", "HelpActions", "ColorActions"],
			{
				"ok": self.okbuttonClick,
				"cancel": self.closeNonRecursive,
				"menu": self.closeRecursive,
				"0": self.keyNumberGlobal,
				"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,
				"displayHelp": self.showHelp,
				"blue": self.keyBlue,
			})
		title = parent.get("title", "").encode("UTF-8") or None
		title = title and _(title) or _(parent.get("text", "").encode("UTF-8"))
		title = self.__class__.__name__ == "MenuSort" and _("Menusort (%s)") % title or title
		if title is None:
			title = _(parent.get('text', '').encode('UTF-8'))
		else:
			t_history.reset()
		self["title"] = StaticText(title)
		self.setTitle(title)
		self.menu_title = title
		self['thistory'] = StaticText(t_history.thistory)
		history_len = len(t_history.thistory)
		self['title0'] = StaticText('')
		self['title1'] = StaticText('')
		self['title2'] = StaticText('')
		if history_len < 13:
			self['title0'] = StaticText(title)
		elif history_len < 21:
			self['title0'] = StaticText('')
			self['title1'] = StaticText(title)
		else:
			self['title0'] = StaticText('')
			self['title1'] = StaticText('')
			self['title2'] = StaticText(title)
		if t_history.thistory == '':
			t_history.thistory = str(title) + ' > '
		else:
			t_history.thistory = t_history.thistory + str(title) + ' > '
		if config.usage.menutype.value == 'horzanim' and findSkinScreen("Animmain"):
			self['label1'] = StaticText()
			self['label2'] = StaticText()
			self['label3'] = StaticText()
			self['label4'] = StaticText()
			self['label5'] = StaticText()
			self.onShown.append(self.openTestA)
		elif config.usage.menutype.value == 'horzicon' and findSkinScreen("Iconmain"):
			self['label1'] = StaticText()
			self['label2'] = StaticText()
			self['label3'] = StaticText()
			self['label4'] = StaticText()
			self['label5'] = StaticText()
			self['label6'] = StaticText()
			self['label1s'] = StaticText()
			self['label2s'] = StaticText()
			self['label3s'] = StaticText()
			self['label4s'] = StaticText()
			self['label5s'] = StaticText()
			self['label6s'] = StaticText()
			self['pointer'] = Pixmap()
			self['pixmap1'] = Pixmap()
			self['pixmap2'] = Pixmap()
			self['pixmap3'] = Pixmap()
			self['pixmap4'] = Pixmap()
			self['pixmap5'] = Pixmap()
			self['pixmap6'] = Pixmap()
			self.onShown.append(self.openTestB)

		self.number = 0
		self.nextNumberTimer = eTimer()
		self.nextNumberTimer.callback.append(self.okbuttonClick)
		if len(self.list) == 1:
			self.onExecBegin.append(self.__onExecBegin)
示例#26
0
    def __init__(self, session, key, args=None):
        Screen.__init__(self, session)
        self.session = session
        self.key = key
        getHotkeyFunctions()
        self.setTitle(_("Hotkey Setup") + " " + key[0][0])
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("Save"))
        self["key_yellow"] = StaticText("")
        self["h_prev"] = Pixmap()
        self["h_next"] = Pixmap()
        self["description"] = Label()

        self.mode = "list"
        self.config = getattr(config.misc.hotkey, key[0][1])
        self.expanded = []
        self.selected = []
        for x in self.config.value.split(','):
            if x.startswith("ZapPanic"):
                self.selected.append(
                    ChoiceEntryComponent(
                        '', ((_("Panic to") + " " + ServiceReference(
                            eServiceReference(x.split(
                                "/", 1)[1]).toString()).getServiceName()), x)))
            elif x.startswith("Zap"):
                self.selected.append(
                    ChoiceEntryComponent(
                        '', ((_("Zap to") + " " + ServiceReference(
                            eServiceReference(x.split(
                                "/", 1)[1]).toString()).getServiceName()), x)))
            else:
                function = next(
                    (function
                     for function in hotkey.functions if function[1] == x),
                    None)
                if function:
                    self.selected.append(
                        ChoiceEntryComponent('', ((function[0]), function[1])))
        text = _(
            "Press 'OK' for attach next function or 'CH+/-' for edit attached."
        ) if len(self.selected) else _("Press 'OK' for attach function.")
        self.prevselected = self.selected[:]
        if self.prevselected:
            self["key_yellow"].setText(_("Edit selection"))
        self["choosen"] = ChoiceList(list=self.selected, selection=0)
        self["list"] = ChoiceList(list=self.getFunctionList(), selection=0)
        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "KeyboardInputActions", "MenuActions"
            ], {
                "ok": self.keyOk,
                "cancel": self.cancel,
                "red": self.cancel,
                "green": self.save,
                "yellow": self.toggleMode,
                "up": self.keyUp,
                "down": self.keyDown,
                "left": self.keyLeft,
                "right": self.keyRight,
                "upRepeated": self.keyUp,
                "downRepeated": self.keyDown,
                "leftRepeated": self.keyLeft,
                "rightRepeated": self.keyRight,
                "pageUp": self.toggleMode,
                "pageDown": self.toggleMode,
                "moveUp": self.moveUp,
                "moveDown": self.moveDown,
                "menu": boundFunction(self.close, True),
            }, -1)
        self.description(text)
        self.showPrevNext()
        self.onLayoutFinish.append(self.__layoutFinished)
示例#27
0
	def onShow(self):
		Pixmap.onShow(self)
		sc = getAspect()
		resize = 1
		background = '#ff000000'
		self.picload.setPara((self.instance.size().width(), self.instance.size().height(), sc[0], sc[1], False, resize, background))
示例#28
0
文件: IPTV.py 项目: OpenSPA/AZIPTV
    def __init__(self, isAutostart, session, args=0):
        Screen.__init__(self, session)
        self.session = session
        self.Console = Console()
        self.current_service = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        selectable_nims = []
        for nim in nimmanager.nim_slots:
            if nim.config_mode == 'nothing':
                continue
            if nim.config_mode == 'advanced' and len(
                    nimmanager.getSatListForNim(nim.slot)) < 1:
                continue
            if nim.config_mode in ('loopthrough', 'satposdepends'):
                root_id = nimmanager.sec.getRoot(
                    nim.slot_id, int(nim.config.connectedTo.value))
                if nim.type == nimmanager.nim_slots[root_id].type:
                    continue
            if nim.isCompatible('DVB-S'):
                selectable_nims.append(
                    (str(nim.slot), nim.friendly_full_description))

        self.select_nim = ConfigSelection(choices=selectable_nims)
        self.feid = 0
        if self.select_nim.value != '':
            self.feid = int(self.select_nim.value)
        self.frontend = self.OpenFrontend()
        if self.frontend is None:
            self.oldref = self.session.nav.getCurrentlyPlayingServiceReference(
            )
            self.session.nav.stopService()
            if not self.frontend:
                if session.pipshown:
                    session.pipshown = False
                    del session.pip
                    if not self.openFrontend():
                        self.frontend = None
        self.session.nav.playService(None)
        self.switchmode = 0
        self.showhide = 0
        self['menu'] = List([])
        self['actions'] = NumberActionMap(
            ['MediaPlayerActions', 'SetupActions', 'DirectionActions'], {
                'menu': self.Konfig,
                'ok': self.ok,
                'cancel': self.sakri,
                'up': self.keyUp,
                'down': self.keyDown,
                'left': self.keyLeft,
                'right': self.keyRight,
                'nextBouquet': self.ZapUp,
                'prevBouquet': self.ZapDown,
                '1': self.keyNumberGlobal,
                '2': self.keyNumberGlobal,
                '3': self.keyNumberGlobal,
                '4': self.keyNumberGlobal,
                '5': self.keyNumberGlobal,
                '6': self.keyNumberGlobal,
                '7': self.keyNumberGlobal,
                '8': self.keyNumberGlobal,
                '9': self.keyNumberGlobal,
                '0': self.keyNumberGlobal
            }, -2)
        self['text2'] = Label(_('Loading...Please Wait'))
        self['start_progress'] = ProgressBar()
        self['infoM0'] = Label()
        self['infoM1'] = Label()
        self['infoM2'] = Label()
        self['l001'] = Pixmap()
        self['l002'] = Pixmap()
        self['l003'] = Pixmap()
        self['l004'] = Pixmap()
        self['l005'] = Pixmap()
        self['l006'] = Pixmap()
        self['l007'] = Pixmap()
        self['l008'] = Pixmap()
        self['picon'] = Pixmap()
        self.TestCounter = 0
        self.playstarted = False
        self.DVBCATimer = eTimer()
        self.DVBCATimer.callback.append(self.Prepare)
        buffersize = 512
        try:
            myfile = file(
                '/usr/lib/enigma2/python/Plugins/Extensions/AzIPTV/config')
            for line in myfile.readlines():
                if line[0:1] != '#':
                    ipos = ipos1 = 0
                    ipos = line.find('<buffersize>')
                    ipos1 = line.find('</buffersize>')
                    if ipos != '' and ipos1 != '' and ipos1 > ipos:
                        buffersize = int(line[ipos + 12:ipos1])

        except:
            print 'Error reading cfg file.'

        if buffersize < 128:
            buffersize = 128
        hw_type = HardwareInfo().get_device_name()
        if hw_type == 'minime' or hw_type == 'me':
            self.cmd0 = 'rmfp_player -dram 0 -ve 0 -vd 0 -ae 0 -no_disp -prebuf '
        if hw_type == 'elite' or hw_type == 'premium' or hw_type == 'premium+' or hw_type == 'ultra':
            self.cmd0 = 'rmfp_player -dram 1 -ve 1 -vd 0 -ae 0 -no_disp -prebuf '
        self.cmd0 = self.cmd0 + str(
            buffersize
        ) + ' -detect_limit 100 -resetvcxo -no_close -oscaler spu -nosubs '
        self.showhide = 0
        self['menu1'] = MenuList([])
        self['menu'] = List([])
        self.onLayoutFinish.append(self.startup)
示例#29
0
 def __init__(self):
     Pixmap.__init__(self)       
     self.currIconPath = ''
     self.waitIconPath = ''
示例#30
0
    def __init__(self, session, *args):
        Screen.__init__(self, session)
        ProtectedScreen.__init__(self)
        screentitle = _("Software update")
        self.menu_path = args[0]
        if config.usage.show_menupath.value == 'large':
            self.menu_path += screentitle
            self.title = self.menu_path
            self.menu_path_compressed = ""
            self.menu_path += ' / '
        elif config.usage.show_menupath.value == 'small':
            self.title = screentitle
            condtext = ""
            if self.menu_path and not self.menu_path.endswith(' / '):
                condtext = self.menu_path + " >"
            elif self.menu_path:
                condtext = self.menu_path[:-3] + " >"
            self.menu_path_compressed = condtext
            self.menu_path += screentitle + ' / '
        else:
            self.title = screentitle
            self.menu_path_compressed = ""
        self["menu_path_compressed"] = StaticText(self.menu_path_compressed)
        Screen.setTitle(self, self.title)

        self["actions"] = ActionMap(["WizardActions"], {
            "ok": self.exit,
            "back": self.exit
        }, -1)
        self['actions'].csel = self
        self["actions"].setEnabled(False)

        self.sliderPackages = {
            "dreambox-dvb-modules": 1,
            "enigma2": 2,
            "tuxbox-image-info": 3
        }
        self.slider = Slider(0, 4)
        self["slider"] = self.slider
        self.activityslider = Slider(0, 100)
        self["activityslider"] = self.activityslider
        self.status = StaticText(_("Please wait..."))
        self["status"] = self.status
        self.package = StaticText(_("Package list update"))
        self["package"] = self.package
        self.oktext = _("Press OK on your remote control to continue.")

        self['tl_off'] = Pixmap()
        self['tl_red'] = Pixmap()
        self['tl_yellow'] = Pixmap()
        self['tl_green'] = Pixmap()
        self['feedStatusMSG'] = Label()

        self.channellist_only = 0
        self.channellist_name = ''
        self.SettingsBackupDone = False
        self.ImageBackupDone = False
        self.autobackuprunning = False
        self.updating = False

        self.packages = 0
        self.error = 0
        self.processed_packages = []
        self.total_packages = None
        self.onFirstExecBegin.append(self.checkNetworkState)
示例#31
0
	def onShow(self):
		Pixmap.onShow(self)
		sc = AVSwitch().getFramebufferScale()
		self._aspectRatio = eSize(sc[0], sc[1])
		self._scaleSize = self.instance.size()
		self.picload.setPara((self._scaleSize.width(), self._scaleSize.height(), sc[0], sc[1], True, 2, '#ff000000'))
    def __init__(self, session, playlist, playall=None, lastservice=None):

        # The CutList must be initialized very first
        CutList.__init__(self)
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        InfoBarSupport.__init__(self)

        # Skin
        self.skinName = "EMCMediaCenter"
        skin = None
        CoolWide = getDesktop(0).size().width()
        if CoolWide == 720:
            skin = "/usr/lib/enigma2/python/Plugins/Extensions/EnhancedMovieCenter/CoolSkin/EMCMediaCenter_720.xml"
        elif CoolWide == 1024:
            skin = "/usr/lib/enigma2/python/Plugins/Extensions/EnhancedMovieCenter/CoolSkin/EMCMediaCenter_1024.xml"
        elif CoolWide == 1280:
            skin = "/usr/lib/enigma2/python/Plugins/Extensions/EnhancedMovieCenter/CoolSkin/EMCMediaCenter_1280.xml"
        if skin:
            Cool = open(skin)
            self.skin = Cool.read()
            Cool.close()

        self.serviceHandler = ServiceCenter.getInstance()

        # EMC Source
        self["Service"] = EMCCurrentService(session.nav, self)

        # Events
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                # Disabled for tests
                # If we enable them, the sound will be delayed for about 2 seconds ?
                iPlayableService.evStart:
                self.__serviceStarted,
                iPlayableService.evStopped:
                self.__serviceStopped,
                #iPlayableService.evEnd: self.__evEnd,
                #iPlayableService.evEOF: self.__evEOF,
                #iPlayableService.evUser: self.__timeUpdated,
                #iPlayableService.evUser+1: self.__statePlay,
                #iPlayableService.evUser+2: self.__statePause,
                iPlayableService.evUser + 3:
                self.__osdFFwdInfoAvail,
                iPlayableService.evUser + 4:
                self.__osdFBwdInfoAvail,
                #iPlayableService.evUser+5: self.__osdStringAvail,
                iPlayableService.evUser + 6:
                self.__osdAudioInfoAvail,
                iPlayableService.evUser + 7:
                self.__osdSubtitleInfoAvail,
                iPlayableService.evUser + 8:
                self.__chapterUpdated,
                iPlayableService.evUser + 9:
                self.__titleUpdated,
                iPlayableService.evUser + 11:
                self.__menuOpened,
                iPlayableService.evUser + 12:
                self.__menuClosed,
                iPlayableService.evUser + 13:
                self.__osdAngleInfoAvail
            })

        # Keymap
        #		self["SeekActions"] = HelpableActionMap(self, "InfobarSeekActions", 							-1 higher priority
        #		self["MovieListActions"] = HelpableActionMap(self, "InfobarMovieListActions", 		0
        #		self["ShowHideActions"] = ActionMap( ["InfobarShowHideActions"] ,  								0
        #		self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions",									0
        #		self["CueSheetActions"] = HelpableActionMap(self, actionmap,											1 lower priority
        #		self["InstantExtensionsActions"] = HelpableActionMap(self, "InfobarExtensions", 	1 lower priority
        #		self["NumberActions"] = NumberActionMap( [ "NumberActions"],											0 Set by EMC to 2 very lower priority
        #		self["TeletextActions"] = HelpableActionMap(self, "InfobarTeletextActions",				0 Set by EMC to 2 very lower priority
        #		self["MenuActions"] = HelpableActionMap(self, "InfobarMenuActions",  							0 Set by EMC to 2 very lower priority
        if config.EMC.movie_exit.value:
            self["actions"] = HelpableActionMap(self, "CoolPlayerActions", {
                "leavePlayer": (self.leavePlayer, _("Stop playback")),
            })  # default priority
        else:
            self["actions"] = HelpableActionMap(self, "CoolPlayerActions2", {
                "leavePlayer": (self.leavePlayer, _("Stop playback")),
            })  # default priority

        self["DVDPlayerPlaybackActions"] = HelpableActionMap(
            self,
            "EMCDVDPlayerActions",
            {
                "dvdMenu": (self.enterDVDMenu, _("show DVD main menu")),
                #"showInfo": (self.showInfo, _("toggle time, chapter, audio, subtitle info")),
                "nextChapter":
                (self.nextChapter, _("forward to the next chapter")),
                "prevChapter":
                (self.prevChapter, _("rewind to the previous chapter")),
                "nextTitle":
                (self.nextTitle, _("jump forward to the next title")),
                "prevTitle":
                (self.prevTitle, _("jump back to the previous title")),
                "dvdAudioMenu":
                (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")),
                "nextAudioTrack":
                (self.nextAudioTrack, _("switch to the next audio track")),
                "nextSubtitleTrack":
                (self.nextSubtitleTrack,
                 _("switch to the next subtitle language")),
                "nextAngle": (self.nextAngle, _("switch to the next angle")),
            },
            1)  # lower priority
        # Only enabled if playing a dvd
        self["DVDPlayerPlaybackActions"].setEnabled(False)

        self["DVDMenuActions"] = ActionMap(
            ["WizardActions"], {
                "left": self.keyLeft,
                "right": self.keyRight,
                "up": self.keyUp,
                "down": self.keyDown,
                "ok": self.keyOk,
                "back": self.keyBack,
            }, 2)  # lower priority
        # Only enabled during DVD Menu
        self["DVDMenuActions"].setEnabled(False)

        self["GeneralPlayerPlaybackActions"] = HelpableActionMap(
            self, "EMCGeneralPlayerActions", {
                "showExtensions":
                (self.openExtensions, _("view extensions...")),
                "EMCGreen": (self.CoolAVSwitch, _("Format AVSwitch")),
                "seekFwd": (self.seekFwd, _("Seek forward")),
                "seekBack": (self.seekBack, _("Seek backward")),
                "movieInfo": (self.infoMovie, _("Movie information")),
            })  # default priority

        self["MenuActions"].prio = 2
        if "TeletextActions" in self:
            self["TeletextActions"].prio = 2
        self["NumberActions"].prio = 2

        # Cover Anzeige
        self["Cover"] = Pixmap()

        # DVD Player
        self["audioLabel"] = Label("")
        self["subtitleLabel"] = Label("")
        self["angleLabel"] = Label("")
        self["chapterLabel"] = Label("")
        self["anglePix"] = Pixmap()
        self["anglePix"].hide()
        self.last_audioTuple = None
        self.last_subtitleTuple = None
        self.last_angleTuple = None
        self.totalChapters = 0
        self.currentChapter = 0
        self.totalTitles = 0
        self.currentTitle = 0
        self.in_menu = None
        self.dvdScreen = None

        # Further initialization
        self.firstStart = True
        self.stopped = False
        self.closedByDelete = False
        self.closeAll = False

        self.lastservice = lastservice or self.session.nav.getCurrentlyPlayingServiceReference(
        )
        if not self.lastservice:
            self.lastservice = InfoBar.instance.servicelist.servicelist.getCurrent(
            )
        self.playlist = playlist
        self.playall = playall
        self.playcount = -1
        self.service = None
        self.allowPiP = True
        self.allowPiPSwap = False  # this is needed for vti-image
        self.realSeekLength = None
        self.servicelist = InfoBar.instance.servicelist

        self.picload = ePicLoad()
        try:
            self.picload_conn = self.picload.PictureData.connect(
                self.showCoverCallback)
        except:
            self.picload.PictureData.get().append(self.showCoverCallback)

        # Record events
        try:
            NavigationInstance.instance.RecordTimer.on_state_change.append(
                self.recEvent)
        except Exception, e:
            emcDebugOut("[EMCMediaCenter] Record observer add exception:\n" +
                        str(e))
示例#33
0
 def __init__(self, session, searchTitle, service=None):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     InfoLoadChoice.__init__(self, self.callback_green_pressed)
     self.skinName = SkinTools.appendResolution('TMDbMain')
     self.service = service
     self.movies = []
     if not os_path.exists(IMAGE_TEMPFILE):
         os_mkdir(IMAGE_TEMPFILE)
     self['ColorActions'] = HelpableActionMap(
         self, 'ColorActions', {
             'red': (self.ok_pressed, _('Toggle detail and list view')),
             'green': (self.green_pressed, _('Save info/cover')),
             'yellow': (self.yellow_pressed, _('Manual search')),
             'blue': (self.blue_pressed, _('Trailer search'))
         }, -1)
     self['WizardActions'] = HelpableActionMap(
         self, 'WizardActions', {
             'ok': (self.ok_pressed, _('Toggle detail and list view')),
             'back': (self.cancel, _('Close')),
             'up': (self.moveUp, _('Move up')),
             'down': (self.moveDown, _('Move down'))
         }, -1)
     self['WizardActions2'] = HelpableActionMap(
         self, 'WizardActions', {
             'left': (self.left, _('Show previous cover')),
             'right': (self.right, _('Show next cover'))
         }, -1)
     self['ChannelSelectBaseActions'] = HelpableActionMap(
         self, 'ChannelSelectBaseActions', {
             'nextMarker': (self.right, _('Show next cover')),
             'prevMarker': (self.left, _('Show previous cover'))
         }, -1)
     self['list'] = TMDbList()
     self['tmdblogo'] = Pixmap()
     self['cover'] = Pixmap()
     self.picload = ePicLoad()
     self.picload.PictureData.get().append(self.paintCoverPixmapCB)
     self['description'] = ScrollLabel()
     self['extended'] = Label()
     self['status'] = Label()
     self['stars'] = ProgressBar()
     self['no_stars'] = Pixmap()
     self['vote'] = Label()
     self['result_txt'] = Label()
     self['seperator'] = Pixmap()
     self['button_red'] = Pixmap()
     self['button_green'] = Pixmap()
     self['button_yellow'] = Pixmap()
     self['button_blue'] = Pixmap()
     self['key_red'] = StaticText('')
     self['key_green'] = StaticText('')
     self['key_yellow'] = StaticText('')
     self['key_blue'] = StaticText('')
     self.ratingstars = -1
     self.searchTitle = searchTitle
     self.downloadItems = {}
     self.useTMDbInfoAsEventInfo = True
     self.timer = eTimer()
     self.timer.callback.append(self.searchForMovies)
     self.blue_button_timer = eTimer()
     self.blue_button_timer.callback.append(self.callback_blue_pressed)
     self.onClose.append(self.deleteTempDir)
     self.onLayoutFinish.append(self.layoutFinished)
     self.view_mode = self.SHOW_SEARCH
     self.tmdb3 = tmdb.init_tmdb3()
     self.updateView()
     self.startSearch()
示例#34
0
	def __init__(self, session, libraryName, loadLibrary, playEntry, viewName, select=None, sort=None, filter=None):
		'''
		'''
		printl("", self , "S")
		self.session = session
		
		DP_View.__init__(self, session, libraryName, loadLibrary, playEntry, viewName, select, sort, filter)
		
		# get needed config parameters
		self.mediaPath = config.plugins.dreamplex.mediafolderpath.value
		self.playTheme = config.plugins.dreamplex.playTheme.value
		self.fastScroll = config.plugins.dreamplex.fastScroll.value
		
		# get data from plex library
		self.image_prefix = Singleton().getPlexInstance().getServerName().lower()
		
		# init skin elements
		self["functionsContainer"]  = Label()
		
		self["btn_red"]  = Pixmap()
		self["btn_blue"] = Pixmap()
		self["btn_yellow"] = Pixmap()
		self["btn_zero"] = Pixmap()
		self["btn_nine"] = Pixmap()
		self["btn_pvr"] = Pixmap()
		self["btn_menu"] = Pixmap()
		
		self["txt_red"]     = Label()
		self["txt_filter"]  = Label()
		self["txt_blue"]    = Label()
		self["txt_blue"].setText(_("toogle View ") + _("(current 'Default')"))
		self["txt_yellow"]    = Label()
		
		if self.fastScroll == True:
			self["txt_yellow"].setText("fastScroll = On")
		else:
			self["txt_yellow"].setText("fastScroll = Off")
		
		self["txt_pvr"]    = Label()
		self["txt_pvr"].setText("load additional data")
		self["txt_menu"]    = Label()
		self["txt_menu"].setText("show media functions")
		
		self["poster"] 				= Pixmap()
		self["mybackdrop"] 			= Pixmap()

		self["audio"] 				= MultiPixmap()
		self["resolution"] 			= MultiPixmap()
		self["aspect"] 				= MultiPixmap()
		self["codec"] 				= MultiPixmap()
		self["rated"] 				= MultiPixmap()
	
		self["title"] 				= Label()
		self["tag"] 				= Label()
		self["shortDescription"] 	= ScrollLabel()
		self["genre"] 				= Label()
		self["year"] 				= Label()
		self["runtime"] 			= Label()
		self["total"] 				= Label()
		self["current"] 			= Label()
		self["backdroptext"]		= Label()
		self["postertext"]			= Label()
		
		self["rating_stars"] = ProgressBar()
		
		self.skinName = self.viewName[2]

		self.EXscale = (AVSwitch().getFramebufferScale())
		self.EXpicloadPoster 		= ePicLoad()
		self.EXpicloadBackdrop 		= ePicLoad()
		self.onLayoutFinish.append(self.setPara)
	
		printl("", self, "C")
示例#35
0
	def __init__(self, session, iface, plugin_path):
		self.skin = setupNfs.skin		
		self.session = session
		Screen.__init__(self, session)

		self.container = eConsoleAppContainer()
		self.container.appClosed.append(self.runFinished)
		self.container.dataAvail.append(self.dataAvail)

		if isRunning('portmap') and isRunning('nfsd'):
			isEnabled = True
		else:
			isEnabled = False

		self.activeConfigEntry = NoSave(ConfigEnableDisable(default = isEnabled))

		self["nfsdLabel"] = Label()
		self["portmapLabel"] = Label()
		self["ButtonGreen"] = Pixmap()
		self["ButtonGreentext"] = Button(_("save and start/restart NFS-Server"))
		self["ButtonRed"] = Pixmap()
		self["ButtonRedtext"] = Label(_("Close"))
		self["ButtonYellow"] = Pixmap()
		self["ButtonYellowtext"] = Label(_("New Entry"))
		self["ButtonBlue"] = Pixmap()
		self["ButtonBluetext"] = Label(_("Remove Entry"))

		self.startingUp = False
		self.goingDown = False
		self.cmdlist = []
		self.run = 0

		self.exportlist = []
		data = self.readExports()
		if data is not None:
			for line in data:
				exportDir = line[0]
				client = line[1]
				options = line[2]
				options = options.replace('(', '')
				options = options.replace(')', '')
				self.exportlist.append((exportDir, client, options))
		else:
			self.exportlist.append(('/media/hdd', '*', 'rw,no_root_squash,sync'))

		self["exportlist"] = List(self.exportlist)
		self.hideList = self["exportlist"].list

		self.createSetup()
		ConfigListScreen.__init__(self, self.list, session = session)
		self.activeConfigEntry.addNotifier(self.toggleServer)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"cancel" : self.cancel,
			"ok"     : self.editExportEntry,
			"green"  : self.green,
			"red"	 : self.cancel,
			"yellow" : self.newExportEntry,
			"blue"   : self.deleteExportEntry
		}, -2)
示例#36
0
    def __init__(self, session, selectedEntry, addEntry=False):
        self.skin = fstabEditorScreen.skin
        self.session = session
        self.selectedEntry = selectedEntry
        self.addEntry = addEntry
        self.skin_path = resolveFilename(SCOPE_PLUGINS,
                                         "Extensions/fstabEditor")
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        self["ButtonRed"] = Pixmap()
        self["ButtonRedText"] = Label(_("Remove entry"))

        if self.addEntry:
            self["ButtonRed"].hide()
            self["ButtonRedText"].hide()

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "green": (self.checkEntry, _("Return with saving")),
                "red": (self.removeEntry, _("Remove entry")),
            }, -1)

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.cancelEntry, _("Return without saving")),
                "ok": (self.ok, _("Open selector")),
            }, -1)

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

        if self.addEntry:
            self.devicename = NoSave(ConfigText(default=""))
            self.mountpoint = NoSave(ConfigText(default=""))
            self.fstype = NoSave(
                ConfigSelection([("auto", "auto"), ("ext2", "ext2"),
                                 ("ext3", "ext3"), ("ext4", "ext4"),
                                 ("swap", "swap"), ("tmpfs", "tmpfs"),
                                 ("proc", "proc"), ("cifs", "cifs"),
                                 ("nfs", "nfs"), ("jffs2", "jffs2"),
                                 ("usbfs", "usbfs"), ("devpts", "devpts"),
                                 ("vfat", "vfat"), ("fat", "fat"),
                                 ("ntfs", "ntfs"), ("noauto", "no auto"),
                                 ("xfs", "xfs")],
                                default="auto"))
            self.options = NoSave(ConfigText(default="defaults"))
            self.dumpfreq = NoSave(ConfigNumber(default=0))
            self.passnum = NoSave(
                ConfigSelection([("0", "0"), ("1", "1"), ("2", "2")],
                                default="0"))
        else:
            self.devicename = NoSave(
                ConfigText(default=entryList[self.selectedEntry][0]))
            self.mountpoint = NoSave(
                ConfigText(default=entryList[self.selectedEntry][1]))
            self.fstype = NoSave(
                ConfigSelection([("auto", "auto"), ("ext2", "ext2"),
                                 ("ext3", "ext3"), ("ext4", "ext4"),
                                 ("swap", "swap"), ("tmpfs", "tmpfs"),
                                 ("proc", "proc"), ("cifs", "cifs"),
                                 ("nfs", "nfs"), ("jffs2", "jffs2"),
                                 ("usbfs", "usbfs"), ("devpts", "devpts"),
                                 ("vfat", "vfat"), ("fat", "fat"),
                                 ("ntfs", "ntfs"), ("noauto", "no auto"),
                                 ("xfs", "xfs")],
                                default=entryList[self.selectedEntry][2]))
            self.options = NoSave(
                ConfigText(default=entryList[self.selectedEntry][3]))
            self.dumpfreq = NoSave(
                ConfigNumber(default=int(entryList[self.selectedEntry][4])))
            self.passnum = NoSave(
                ConfigSelection([("0", "0"), ("1", "1"), ("2", "2")],
                                default=entryList[self.selectedEntry][5]))

        self.list.append(
            getConfigListEntry(_("device name: "), self.devicename))
        self.list.append(
            getConfigListEntry(_("mount point: "), self.mountpoint))
        self.list.append(
            getConfigListEntry(_("file system type: "), self.fstype))
        self.list.append(getConfigListEntry(_("options: "), self.options))
        self.list.append(
            getConfigListEntry(_("dump frequency (in days): "), self.dumpfreq))
        self.list.append(getConfigListEntry(_("pass num: "), self.passnum))

        self["config"].setList(self.list)
示例#37
0
	def destroy(self):
		del self.picload_conn
		del self.picload
		Pixmap.destroy(self)
示例#38
0
 def __init__(self, default=None):
     Pixmap.__init__(self)
     self.picload = ePicLoad()
     self.picload_conn = self.picload.PictureData.connect(self.setPixmapCB)
     self.cachedir = "/tmp/"
     self.default = default
示例#39
0
	def execBegin(self):
		Pixmap.execBegin(self)
		sc = AVSwitch().getFramebufferScale()
		#0=Width 1=Height 2=Aspect 3=use_cache 4=resize_type 5=Background(#AARRGGBB)
		size = self.instance.size()
		self.picload.setPara((size.width(), size.height(), sc[0], sc[1], True, 1, "#00000000"))
示例#40
0
    def __init__(self, session, archivCZSK):
        provider = ArchivCZSKContentProvider(
            archivCZSK, os.path.join(settings.PLUGIN_PATH, 'categories'))
        provider.start()
        contentHandler = ArchivCZSKContentHandler(session, self, provider)
        defaultCategory = config.plugins.archivCZSK.defaultCategory.value
        categoryItem = categoryAddons = None
        if defaultCategory != 'categories':
            categoryItem = provider.get_content({'category': defaultCategory})
            categoryAddons = provider.get_content(
                {'category_addons': defaultCategory})
            # dont add PExit() if default category is user created cat.
            gotParrent = True
            try:
                gotParrent = self.getParent() is not None
            except:
                pass
            if gotParrent and (defaultCategory == 'all_addons'
                               or defaultCategory == 'tv_addons'
                               or defaultCategory == 'video_addons'):
                categoryAddons is not None and categoryAddons.insert(
                    0, PExit())
        categoryItems = provider.get_content()
        BaseContentScreen.__init__(self, session, contentHandler,
                                   categoryItems)
        if categoryItem is not None and categoryAddons is not None:
            self.save()
            self.load({
                'lst_items': categoryAddons,
                'parent_it': categoryItem,
                'refresh': False
            })
        self.ctx_items.append((_("Add Category"), None, self.addCategory))
        self.provider = provider
        self.updateGUITimer = eTimer()
        self.updateGUITimer_conn = eConnectCallback(
            self.updateGUITimer.timeout, self.updateAddonGUI)

        # include DownloadList
        DownloadList.__init__(self)

        # include TipList
        TipBar.__init__(self, [self.CONTEXT_TIP], startOnShown=True)
        self.onUpdateGUI.append(self.changeAddon)
        self.onClose.append(self.__onClose)

        from Plugins.Extensions.archivCZSK.version import version
        self.setTitle("ArchivCZSK (" + toString(version) + ")")
        self["image"] = Pixmap()
        self["title"] = Label("")
        self["author"] = Label("")
        self["version"] = Label("")
        self["about"] = Label("")

        self["key_red"] = Label(_("Manager"))
        self["key_green"] = Label(_("Support us"))
        self["key_yellow"] = Label("")
        self["key_blue"] = Label(_("Settings"))

        self["actions"] = ActionMap(
            ["archivCZSKActions"], {
                "ok": self.ok,
                "cancel": self.cancel,
                "up": self.up,
                "down": self.down,
                "blue": self.openSettings,
                "green": self.showIconD,
                "red": self.openAddonManagement,
                "menu": self.menu
            }, -2)
        # after layout show update item "GUI" - edit: shamann
        self.onLayoutFinish.append(self.updateAddonGUI)
示例#41
0
	def onShow(self):
		Pixmap.onShow(self)
		sc = AVSwitch().getFramebufferScale()
		self.picload.setPara((self.instance.size().width(), self.instance.size().height(), sc[0], sc[1], 0, 0, '#00000000'))
示例#42
0
    def __init__(self, session, dvd_device=None, dvd_filelist=[], args=None):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self)
        InfoBarNotifications.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)
        self.save_infobar_seek_config()
        self.change_infobar_seek_config()
        InfoBarSeek.__init__(self)
        InfoBarPVRState.__init__(self)

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

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

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

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

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

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

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

        self["NumberActions"] = NumberActionMap(
            ["NumberActions"], {
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal,
            })

        self.onClose.append(self.__onClose)

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

        self.autoplay = dvd_device or dvd_filelist

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

        self.dvd_filelist = dvd_filelist
        self.onFirstExecBegin.append(self.opened)
        self.service = None
        self.in_menu = False
示例#43
0
	def __init__(self, default = None):
		Pixmap.__init__(self)
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.setPixmapCB)
		self.cachedir = "/tmp/googlemaps/"
		self.default = default
示例#44
0
    def __init__(self,
                 session,
                 text="",
                 filename="",
                 currDir=None,
                 bookmarks=None,
                 userMode=False,
                 windowTitle=None,
                 minFree=None,
                 autoAdd=False,
                 editDir=False,
                 inhibitDirs=[],
                 inhibitMounts=[]):
        # Init parents
        Screen.__init__(self, session)
        NumericalTextInput.__init__(self, handleTimeout=False)
        HelpableScreen.__init__(self)

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

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

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

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

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

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

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

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

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

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

        if self.userMode:
            self.usermodeOn()

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

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

                return HelpableActionMap.action(self, contexts, action)

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

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

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

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

        # Actions used by quickselect
        self["NumberActions"] = NumberActionMap(
            ["NumberActions"], {
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            })

        # Run some functions when shown
        if windowTitle is None:
            windowTitle = _("Select location")
        self.onShown.extend((
            boundFunction(self.setTitle, windowTitle),
            self.updateTarget,
            self.showHideRename,
        ))

        self.onLayoutFinish.append(self.switchToFileListOnStart)

        # Make sure we remove our callback
        self.onClose.append(self.disableTimer)
示例#45
0
 def __init__(self):
     Pixmap.__init__(self)
示例#46
0
    def __init__(self, session, streamplayer, args=0):
        self.skin = LastFMScreenMain.skin
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        LastFM.__init__(self)
        self.session = session
        self.streamplayer = streamplayer  #StreamPlayer(session)
        self.streamplayer.onStateChanged.append(
            self.onStreamplayerStateChanged)
        self.imageconverter = ImageConverter(116, 116, self.setCoverArt)
        Screen.__init__(self, session)

        self.tabs = [(_("Personal Stations"), self.loadPersonalStations),
                     (_("Global Tags"), self.loadGlobalTags),
                     (_("Top Tracks"), self.loadTopTracks),
                     (_("Recent Tracks"), self.loadRecentTracks),
                     (_("Loved Tracks"), self.loadLovedTracks),
                     (_("Banned Tracks"), self.loadBannedTracks),
                     (_("Friends"), self.loadFriends),
                     (_("Neighbours"), self.loadNeighbours)]
        tablist = []
        for tab in self.tabs:
            tablist.append((tab[0], tab))
        self.tablist = MenuList(tablist)
        self.tablist.onSelectionChanged.append(self.action_TabChanged)

        self["artist"] = Label(_("Artist") + ":")
        self["duration"] = Label("-00:00")
        self["album"] = Label(_("Album") + ":")
        self["track"] = Label(_("Track") + ":")

        self["info_artist"] = Label("N/A")
        self["info_album"] = Label("N/A")
        self["info_track"] = Label("N/A")
        self["info_cover"] = Pixmap()

        self["tablist"] = self.tablist
        self["streamlist"] = MenuList([])

        self["button_red"] = Label(_("Play"))
        self["button_green"] = Label(_("Skip"))
        self["button_yellow"] = Label(_("Love"))
        self["button_blue"] = Label(_("Ban"))
        self["infolabel"] = Label("")

        self["actions"] = ActionMap(
            [
                "InfobarChannelSelection", "WizardActions", "DirectionActions",
                "MenuActions", "ShortcutActions", "GlobalActions",
                "HelpActions", "NumberActions"
            ], {
                "ok": self.action_ok,
                "back": self.action_exit,
                "red": self.action_startstop,
                "green": self.skipTrack,
                "yellow": self.love,
                "blue": self.banTrack,
                "historyNext": self.action_nextTab,
                "historyBack": self.action_prevTab,
                "menu": self.action_menu,
            }, -1)

        self.helpList.append((self["actions"], "WizardActions",
                              [("ok", _("Switch to selected Station"))]))
        self.helpList.append((self["actions"], "InfobarChannelSelection",
                              [("historyNext", _("Select next Tab"))]))
        self.helpList.append((self["actions"], "InfobarChannelSelection",
                              [("historyBack", _("Select prev Tab"))]))
        self.helpList.append((self["actions"], "InfobarChannelSelection",
                              [("switchChannelDown", _("Next Selection"))]))
        self.helpList.append((self["actions"], "InfobarChannelSelection",
                              [("switchChannelUp", _("Previous Selection"))]))
        self.helpList.append((self["actions"], "InfobarChannelSelection",
                              [("zapDown", _("Page forward Selections"))]))
        self.helpList.append((self["actions"], "InfobarChannelSelection",
                              [("zapUp", _("Page backward Selections"))]))
        self.helpList.append((self["actions"], "ShortcutActions",
                              [("red", _("Start/stop streaming"))]))
        self.helpList.append(
            (self["actions"], "ShortcutActions", [("green",
                                                   _("Skip current Track"))]))
        self.helpList.append(
            (self["actions"], "ShortcutActions", [("yellow",
                                                   _("Mark Track as loved"))]))
        self.helpList.append((self["actions"], "ShortcutActions",
                              [("blue", _("Ban Track, never play"))]))
        self.helpList.append((self["actions"], "MenuActions",
                              [("menu", _("Open") + " " + _("Setup"))]))
        self.helpList.append((self["actions"], "WizardActions", [
            ("back", _("Quit") + " " + config.plugins.LastFM.name.value)
        ]))

        self.onLayoutFinish.append(self.initLastFM)
        self.onLayoutFinish.append(self.tabchangedtimerFired)
        self.onLayoutFinish.append(self.setCoverArt)

        self.guiupdatetimer = eTimer()
        self.guiupdatetimer.timeout.get().append(self.guiupdatetimerFired)
        self.guiupdatetimer.start(
            config.plugins.LastFM.metadatarefreshinterval.value * 1000)

        self.tabchangetimer = eTimer()
        self.tabchangetimer.timeout.get().append(self.tabchangedtimerFired)

        self.infolabelcleartimer = eTimer()
        self.infolabelcleartimer.timeout.get().append(self.clearInfoLabel)

        self.screensavertimer = eTimer()
        self.screensavertimer.timeout.get().append(self.startScreensaver)
        self.onShown.append(self.startScreensaverTimer)
示例#47
0
 def onShow(self):      
     Pixmap.onShow(self)
示例#48
0
    def __init__(self, session, pcallback=None, noosd=False):
        self.session = session
        if (getDesktop(0).size().width() < 800):
            skin = "%s/skins/downloader_sd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 0
        else:
            skin = "%s/skins/downloader_hd.xml" % os.path.dirname(
                sys.modules[__name__].__file__)
            self.isHD = 1
        f = open(skin, "r")
        self.skin = f.read()
        f.close()
        Screen.__init__(self, session)
        self.skinName = "downloader"
        Screen.setTitle(self, _("CrossEPG"))

        self["background"] = Pixmap()
        self["action"] = Label(_("Loading data"))
        self["summary_action"] = StaticText(_("Loading data"))
        self["status"] = Label("")
        self["progress"] = ProgressBar()
        self["progress"].hide()
        self["progress_text"] = Progress()

        self.retValue = True
        self.config = CrossEPG_Config()
        self.config.load()
        self.db_root = self.config.db_root
        if not pathExists(self.db_root):
            if not createDir(self.db_root):
                self.db_root = "/hdd/crossepg"

        self.pcallback = pcallback
        self.wrapper = None

        self.pcallbacktimer = eTimer()
        self.pcallbacktimer.callback.append(self.doCallback)

        if pathExists("/usr/crossepg"):
            self.home_directory = "/usr/crossepg"
        elif pathExists("/var/crossepg"):
            self.home_directory = "/var/crossepg"
        else:
            print("[CrossEPG_Config] ERROR!! CrossEPG binaries non found")

        # check for common patches
        try:
            self.xepgpatch = new.instancemethod(
                _enigma.eEPGCache_crossepgImportEPGv21, None, eEPGCache)
            print("[CrossEPG_Loader] patch crossepg v2.1 found")
        except Exception as e:
            self.xepgpatch = None

        try:
            self.epgpatch = new.instancemethod(_enigma.eEPGCache_load, None,
                                               eEPGCache)
            print("[CrossEPG_Loader] patch epgcache.load() found")
        except Exception as e:
            self.epgpatch = None

        try:
            self.edgpatch = new.instancemethod(_enigma.eEPGCache_reloadEpg,
                                               None, eEPGCache)
            print("[CrossEPG_Loader] patch EDG NEMESIS found")
        except Exception as e:
            self.edgpatch = None

        try:
            self.oudeispatch = new.instancemethod(
                _enigma.eEPGCache_importEvent, None, eEPGCache)
            print("[CrossEPG_Loader] patch Oudeis found")
        except Exception as e:
            self.oudeispatch = None

        if self.xepgpatch:
            self.timer = eTimer()
            self.timer.callback.append(self.loadEPG2)
            self.timer.start(200, 1)

        elif self.epgpatch:
            self.timer = eTimer()
            self.timer.callback.append(self.loadEPG)
            self.timer.start(200, 1)

        elif self.edgpatch:
            self.timer = eTimer()
            self.timer.callback.append(self.loadEDG)
            self.timer.start(200, 1)

        elif self.oudeispatch:
            self["actions"] = NumberActionMap(
                ["WizardActions", "InputActions"], {"back": self.quit}, -1)

            self.wrapper = CrossEPG_Wrapper()
            self.wrapper.addCallback(self.wrapperCallback)

            self.timeout = eTimer()
            self.timeout.callback.append(self.quit)

            self.hideprogress = eTimer()
            self.hideprogress.callback.append(self["progress"].hide)

            self.epg_channel = None
            self.epg_tuple = ()
            self.epg_starttime = 0
            self.epg_length = 0
            self.epg_name = ""

            self.wrapper.init(CrossEPG_Wrapper.CMD_CONVERTER, self.db_root)
        else:
            print("No patch found... please reboot enigma2 manually")
            self.closeAndCallback(True)

        if not noosd:
            self.onFirstExecBegin.append(self.firstExec)
示例#49
0
	def __init__(self):
		Pixmap.__init__(self)
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.paintIconPixmapCB)
		self.decoding = None
		self.decodeNext = None
示例#50
0
文件: plugin.py 项目: OpenDMM/enigma2
	def __init__(self):
		Pixmap.__init__(self)
		self.coverArtFileName = ""
		self.picload = ePicLoad()
		self.picload_conn = self.picload.PictureData.connect(self.paintCoverArtPixmapCB)
		self.coverFileNames = ["cover.jpg", "folder.png", "folder.jpg"]
示例#51
0
	def __init__(self):
		Pixmap.__init__(self)
		self.IconFileName = ""
		self.picload = ePicLoad()
		self.picload_conn = self.picload.PictureData.connect(self.paintIconPixmapCB)
示例#52
0
	def __init__(self):
		Pixmap.__init__(self)
		self.IconFileName = ""
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.paintIconPixmapCB)
示例#53
0
    def __init__(self, session, service, cbServiceCommand, chName, chURL,
                 chIcon):
        Screen.__init__(self, session)
        InfoBarNotifications.__init__(self)

        isEmpty = lambda x: x is None or len(x) == 0 or x == 'None'
        if isEmpty(chName):
            chName = 'Unknown'
        if isEmpty(chURL):
            chURL = 'Unknown'
        if isEmpty(chIcon):
            chIcon = 'default.png'
        chIcon = '%s/icons/%s' % (PLUGIN_PATH, chIcon)
        self.session = session
        self.service = service
        self.cbServiceCommand = cbServiceCommand
        self["actions"] = ActionMap(
            [
                "OkCancelActions", "InfobarSeekActions", "MediaPlayerActions",
                "MovieSelectionActions"
            ], {
                "ok": self.doInfoAction,
                "cancel": self.doExit,
                "stop": self.doExit,
                "playpauseService": self.playpauseService,
            }, -2)

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

        self.hidetimer = eTimer()
        self.hidetimer.timeout.get().append(self.doInfoAction)

        self.state = self.PLAYER_PLAYING
        self.lastseekstate = self.PLAYER_PLAYING
        self.__seekableStatusChanged()

        self.onClose.append(self.__onClose)
        self.doPlay()

        self['channel_icon'] = Pixmap()
        self['channel_name'] = Label(chName)
        self['channel_uri'] = Label(chURL)

        self.picload = ePicLoad()
        self.scale = AVSwitch().getFramebufferScale()
        self.picload.PictureData.get().append(self.cbDrawChannelIcon)
        print(self.scale[0])
        print(self.scale[1])
        self.picload.setPara(
            (35, 35, self.scale[0], self.scale[1], False, 0, "#00000000"))
        self.picload.startDecode(chIcon)

        self.bypassExit = False
        self.cbServiceCommand(('docommand', self.doCommand))
示例#54
0
	def __init__(self, session, exportDir, client, options):
		self.skin = editExportEntry.skin		
		self.session = session
		Screen.__init__(self, session)

		nfsoptions = [\
		"ro,sync",
		"rw,sync",
		"ro,async",
		"rw,async",
		"ro,no_root_squash",
		"rw,no_root_squash",
		"ro,no_subtree_check",
		"rw,no_subtree_check",
		"ro,insecure",
		"rw,insecure",
		"ro,insecure,no_subtree_check",
		"rw,insecure,no_subtree_check",
		"ro,sync,no_subtree_check",
		"rw,sync,no_subtree_check",
		"ro,async,no_subtree_check",
		"rw,async,no_subtree_check",
		"ro,no_root_squash,no_subtree_check",
		"rw,no_root_squash,no_subtree_check",
		"ro,no_root_squash,sync",
		"rw,no_root_squash,sync",
		"ro,no_root_squash,sync,no_subtree_check",
		"rw,no_root_squash,sync,no_subtree_check",
		"ro,no_root_squash,async",
		"rw,no_root_squash,async",
		"ro,no_root_squash,async,no_subtree_check",
		"rw,no_root_squash,async,no_subtree_check"]

		optionsEntrys = {}
		for x in nfsoptions:
			optionsEntrys[x] = x

		clientIP = [192, 168, 0, 0]
		self.netmask = ''

		tmp = client.split('/')
		if len(tmp) > 1:
			client = tmp[0]
			self.netmask = tmp[1]

		if client == '*':
			everyIP = True
		else:
			everyIP = False
			theIP = client.split('.')
			clientIP = []
			for x in theIP:
				clientIP.append(int(x))

		self.exportDirConfigEntry = NoSave(ConfigDirectory(exportDir))
		self.everyIPConfigEntry = NoSave(ConfigEnableDisable(default = everyIP))
		self.clientConfigEntry = NoSave(ConfigIP(clientIP))
		self.optionsConfigEntry = NoSave(ConfigSelection(optionsEntrys, options))

		ConfigListScreen.__init__(self, [])
		self.createSetup()
		self.everyIPConfigEntry.addNotifier(self.toggleEveryIP)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"cancel": self.cancel,
			"red"   : self.cancel,
			"green" : self.green,
			"ok"    : self.ok
		}, -2)

		self["ButtonGreen"] = Pixmap()
		self["ButtonGreentext"] = Label(_("Save and Close"))
		self["ButtonRed"] = Pixmap()
		self["ButtonRedtext"] = Label(_("Close"))
示例#55
0
 def __init__(self, default=None):
     Pixmap.__init__(self)
     self.picload = ePicLoad()
     self.picload.PictureData.get().append(self.setPixmapCB)
     self.cachedir = "/tmp/"
     self.default = default
	def onShow(self):
		print "start onShow"
		Pixmap.onShow(self)
		sc = AVSwitch().getFramebufferScale()
		self.picload.setPara((self.instance.size().width(), self.instance.size().height(), sc[0], sc[1], False, 1, "#00000000"))
示例#57
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self["image"] = Pixmap()
     self.picload = ePicLoad()
     self.picload.PictureData.get().append(self.__showPic)
示例#58
0
    def __init__(self, session, args=0):
        skin = """<screen position="93,70" size="550,450" title="Webcams provided by webcams.travel">

			<widget source="list" render="Listbox" position="0,0" size="550,350" zPosition="1" scrollbarMode="showOnDemand" transparent="1"  >
				<convert type="TemplatedMultiContent">
				{"templates":
					{"default": (77,[
							MultiContentEntryPixmapAlphaTest(pos = (0, 0), size = (100, 75), png = 4), # index 4 is the thumbnail
							MultiContentEntryText(pos = (100, 1), size = (500, 22), font=0, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 1), # index 1 is the Title
							MultiContentEntryText(pos = (100, 24), size = (300, 18), font=1, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 5), # index 5 is the Published Date
							MultiContentEntryText(pos = (100, 43), size = (300, 18), font=1, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 6), # index 6 is the Views Count
							MultiContentEntryText(pos = (400, 24), size = (200, 18), font=1, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 7), # index 7 is the duration
							MultiContentEntryText(pos = (400, 43), size = (200, 18), font=1, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 8), # index 8 is the ratingcount
						]),
					"status": (77,[
							MultiContentEntryText(pos = (10, 1), size = (500, 28), font=2, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 0), # index 0 is the name
							MultiContentEntryText(pos = (10, 22), size = (500, 46), font=3, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP| RT_WRAP, text = 1), # index 2 is the description
						])
					},
					"fonts": [gFont("Regular", 22),gFont("Regular", 18),gFont("Regular", 26),gFont("Regular", 20)],
					"itemHeight": 77
				}
				</convert>
			</widget>
			<widget name="thumbnail" position="0,0" size="100,75" alphatest="on"/> # fake entry for dynamic thumbnail resizing, currently there is no other way doing this.

			<widget name="count" position="5,360" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget name="page" position="150,360" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget name="currentnumbers" position="295,360" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />

			<ePixmap position="5,410" zPosition="0" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
			<ePixmap position="150,410" zPosition="1" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
			<ePixmap position="295,410" zPosition="2" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
			<!-- #not used now# ePixmap position="445,410" zPosition="3" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" //-->
			<widget name="key_red" position="5,410" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget name="key_green" position="150,410" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget name="key_yellow" position="295,410" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
			<widget name="key_blue" position="445,410" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />

		</screen>"""
        self.skin = skin
        Screen.__init__(self, session)
        self.picloads = {}
        self.thumbnails = {}

        self["list"] = List([])
        self["thumbnail"] = Pixmap()
        self["thumbnail"].hide()

        self["count"] = Label(_("Cams: "))
        self["page"] = Label(_("Page: "))
        self["currentnumbers"] = Label(_("current: "))

        self["key_red"] = Button(_("prev"))
        self["key_red"].hide()
        self["key_green"] = Button(_("next"))
        self["key_green"].hide()
        self["key_yellow"] = Button(_("search"))
        self["key_blue"] = Button(_("hdkfjhg"))

        self["key_blue"].hide()  #not used at the moment

        self["actions"] = ActionMap(
            [
                "WizardActions", "MenuActions", "DirectionActions",
                "ShortcutActions"
            ], {
                "ok": self.onOK,
                "red": self.onRed,
                "green": self.onGreen,
                "yellow": self.onYellow,
                "back": self.close
            }, -1)
        self.finish_loading = True
        self.timer_default = eTimer()
        self.timer_default.timeout.callback.append(self.buildCamList)

        self.timer_status = eTimer()
        self.timer_status.timeout.callback.append(self.buildStatusList)

        self.timer_labels = eTimer()
        self.timer_labels.timeout.callback.append(self.refreshLabels)

        self.onLayoutFinish.append(self.loadData)
示例#59
0
    def __init__(self, session):
        self.folder = '/usr/lib/enigma2/python/Plugins/Extensions/PurePrestige/panelbuttons/'
        self.fillplgfolders()
        piclist = self.fullpath
        path = self.folder
        lastindex = 0
        self.session = session
        self.textcolor = config.PPrestige.textcolor.value
        self.color = config.PPrestige.bgcolor.value
        dwidth = getDesktop(0).size().width()
        size_w = getDesktop(0).size().width()
        size_h = getDesktop(0).size().height()
        if dwidth == 1280:
            size_w = 650
            size_h = 600
            textsize = 20
            self.spaceX = 35
            self.picX = 180
            self.spaceY = 20
            self.picY = 170
        else:
            textsize = 20
            self.spaceX = 30
            self.picX = 185
            self.spaceY = 20
            self.picY = 156
        self.thumbsX = 3
        self.thumbsY = 3
        self.thumbsC = self.thumbsX * self.thumbsY
        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 - 25) + ',' + str(
                absY + self.picY - textsize + 5
            ) + '" size="' + str(self.picX + 15) + ',' + str(
                textsize
            ) + '" font="Regular;20" zPosition="2" transparent="1" noWrap="1" halign="' + 'center' + '"  valign="' + 'center' + '"  foregroundColor="' + self.textcolor + '" />'
            skincontent += '<widget name="thumb' + str(
                x) + '" position="' + str(absX + 5) + ',' + str(
                    absY + 5) + '" size="' + str(self.picX - 30) + ',' + str(
                        self.picY - 20
                    ) + '" zPosition="2" transparent="1" alphatest="on" />'

        if dwidth == 1280:
            self.skin = '<screen position="center,77" title="Pure Prestige ' + str(
                currversion
            ) + '"  size="' + str(size_w) + ',' + str(
                size_h
            ) + '" > \t\t\t<eLabel position="0,0" zPosition="0" size="' + str(
                size_w
            ) + ',' + str(
                size_h
            ) + '" backgroundColor="' + self.color + '" /><widget name="frame" position="20,20" size="145,145" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/PurePrestige/pic_frame.png" zPosition="1" alphatest="on" />' + skincontent + '</screen>'
        else:
            self.skin = '<screen position="20,center" flags="wfNoBorder" title="Pure Prestige ' + str(
                currversion
            ) + '"  size="' + str(size_w) + ',' + str(
                size_h
            ) + '" > \t\t\t<eLabel position="0,0" zPosition="0" size="' + str(
                size_w
            ) + ',' + str(
                size_h
            ) + '" backgroundColor="' + self.color + '" /><widget name="frame" position="20,20" size="145,145" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/PurePrestige/pic_frame.png" 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
            }, -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:
                self.filelist.append((index, framePos, Page, x, path + x))
                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.onLayoutFinish.append(self.setPicloadConf)
        self.showPic
示例#60
0
    def __init__(self,
                 session,
                 service,
                 zapFunc=None,
                 eventid=None,
                 bouquetChangeCB=None,
                 serviceChangeCB=None,
                 parent=None):
        Screen.__init__(self, session)
        self.bouquetChangeCB = bouquetChangeCB
        self.serviceChangeCB = serviceChangeCB
        self.ask_time = -1  #now
        self["key_red"] = StaticText("")
        self.closeRecursive = False
        self.saved_title = None
        self["Service"] = ServiceEvent()
        self["Event"] = Event()
        if isinstance(service, str) and eventid is not None:
            self.type = EPG_TYPE_SIMILAR
            self.setTitle(_("Similar EPG"))
            self["key_yellow"] = StaticText()
            self["key_blue"] = StaticText()
            self["key_red"] = StaticText()
            self.currentService = service
            self.eventid = eventid
            self.zapFunc = None
        elif isinstance(service, eServiceReference) or isinstance(
                service, str):
            self.setTitle(_("Single EPG"))
            self.type = EPG_TYPE_SINGLE
            self["key_yellow"] = StaticText()
            self["key_blue"] = StaticText(_("Select Channel"))
            self.currentService = ServiceReference(service)
            self.zapFunc = zapFunc
            self.sort_type = 0
            self.setSortDescription()
        else:
            self.setTitle(_("Multi EPG"))
            self.skinName = "EPGSelectionMulti"
            self.type = EPG_TYPE_MULTI
            self["key_yellow"] = StaticText(
                pgettext("button label, 'previous screen'", "Prev"))
            self["key_blue"] = StaticText(
                pgettext("button label, 'next screen'", "Next"))
            self["now_button"] = Pixmap()
            self["next_button"] = Pixmap()
            self["more_button"] = Pixmap()
            self["now_button_sel"] = Pixmap()
            self["next_button_sel"] = Pixmap()
            self["more_button_sel"] = Pixmap()
            self["now_text"] = Label()
            self["next_text"] = Label()
            self["more_text"] = Label()
            self["date"] = Label()
            self.services = service
            self.zapFunc = zapFunc
        self.parent = parent
        self["key_green"] = StaticText(_("Add timer"))
        self.key_green_choice = self.ADD_TIMER
        self.key_red_choice = self.EMPTY
        self["list"] = EPGList(type=self.type,
                               selChangedCB=self.onSelectionChanged,
                               timer=session.nav.RecordTimer)

        self["actions"] = ActionMap(
            ["EPGSelectActions", "OkCancelActions"],
            {
                "cancel": self.closeScreen,
                "ok": self.eventSelected,
                "timerAdd": self.timerAdd,
                "yellow": self.yellowButtonPressed,
                "blue": self.blueButtonPressed,
                "info": self.infoKeyPressed,
                "red": self.zapTo,
                "menu": self.furtherOptions,
                "nextBouquet": self.nextBouquet,  # just used in multi epg yet
                "prevBouquet": self.prevBouquet,  # just used in multi epg yet
                "nextService": self.nextService,  # just used in single epg yet
                "prevService": self.prevService,  # just used in single epg yet
                "preview": self.eventPreview,
            })
        self["actions"].csel = self
        if parent and hasattr(parent, "fallbackTimer"):
            self.fallbackTimer = parent.fallbackTimer
            self.onLayoutFinish.append(self.onCreate)
        else:
            self.fallbackTimer = FallbackTimerList(self, self.onCreate)