Ejemplo n.º 1
0
def AutoTimerGraphMultiEPG__init__(self, session, services, zapFunc=None, bouquetChangeCB=None, bouquetname=""):
    try:
        baseGraphMultiEPG__init__(self, session, services, zapFunc, bouquetChangeCB, bouquetname)
    except:
        baseGraphMultiEPG__init__(self, session, services, zapFunc, bouquetChangeCB)
    if config.plugins.autotimer.add_to_graph.value:

        def showAutoTimer():
            open_list = [
                (_("Open standard setup menu"), "setup"),
                (_("Add new AutoTimer"), "add"),
                (_("Preview for your AutoTimers"), "preview"),
                (_("Search new events matching for your AutoTimers"), "search"),
                (_("Timers list"), "timerlist"),
            ]
            dlg = self.session.openWithCallback(
                self.CallbackToGraphMultiEPG, ChoiceBox, title=_("Select action for AutoTimer:"), list=open_list
            )
            dlg.setTitle(_("Choice list AutoTimer"))

        HelpableScreen.__init__(self)
        self["AutoTimeractions"] = HelpableActionMap(
            self, "ChannelSelectEditActions", {"contextMenu": (showAutoTimer, _("Choice list AutoTimer"))}, -1
        )
        self["AutoTimeractions"].csel = self
 def action(self, contexts, action):
     numbers = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9")
     if (action in numbers and self.actions.has_key(action)):
         res = self.actions[action](int(action))
         if res is not None:
             return res
         return 1
     else:
         return HelpableActionMap.action(self, contexts, action)
Ejemplo n.º 3
0
    def setHelpModeActions(self, _mode=0):
        self.helpList = []
        if _mode == self.MODE_GLOBAL:
            self["OkCancelActions"] = HelpableActionMap(
                self, "OkCancelActions", {
                    "cancel": (self.keyPass, _("Exit the Browser.")),
                })
            self["MenuActions"] = HelpableActionMap(self, "MenuActions", {
                "menu": (self.keyPass, _("Show the Menu window.")),
            })
            self["ColorActions"] = HelpableActionMap(
                self, "ColorActions", {
                    "green": (self.keyPass, _("Enter Key")),
                    "yellow":
                    (self.keyPass, _("Show the Virtual keyboard window.")),
                    "blue": (self.keyPass, _("Backspace Key")),
                })
            self["EPGSelectActions"] = HelpableActionMap(
                self, "EPGSelectActions", {
                    "info":
                    (self.keyPass, _("Switch to keyboard/mouse mode.")),
                })

        elif _mode == self.MODE_MOUSE:
            self["DirectionActions"] = HelpableActionMap(
                self, "DirectionActions", {
                    "up":
                    (self.keyPass, _("It will move the mouse pointer up.")),
                    "down":
                    (self.keyPass, _("It will move the mouse pointer down.")),
                    "left":
                    (self.keyPass, _("It will move the mouse pointer left.")),
                    "right":
                    (self.keyPass, _("It will move the mouse pointer right.")),
                })
            self["OkCancelActions"] = HelpableActionMap(
                self, "OkCancelActions", {
                    "ok": (self.keyPass, _("Left Mouse Button")),
                })
            self["EPGSelectActions"] = HelpableActionMap(
                self, "EPGSelectActions", {
                    "nextBouquet": (self.keyPass, _("Right Mouse Button")),
                    "nextService": (self.keyPass, _("Left Key")),
                    "prevService": (self.keyPass, _("Right Key")),
                })
        elif _mode == self.MODE_KEYBOARD:
            self["DirectionActions"] = HelpableActionMap(
                self, "DirectionActions", {
                    "up": (self.keyPass, _("Up Key")),
                    "down": (self.keyPass, _("Down Key")),
                    "left": (self.keyPass, _("Left Key")),
                    "right": (self.keyPass, _("Right Key")),
                })
            self["OkCancelActions"] = HelpableActionMap(
                self, "OkCancelActions", {
                    "ok": (self.keyPass, _("Enter Key")),
                })
            self["EPGSelectActions"] = HelpableActionMap(
                self, "EPGSelectActions", {
                    "nextBouquet": (self.keyPass, _("PageUp Key")),
                    "prevBouquet": (self.keyPass, _("PageDown Key")),
                    "nextService": (self.keyPass, _("Go to previous page.")),
                    "prevService": (self.keyPass, _("Go to next page.")),
                })

        if _mode > 0:
            self.showHelp()
Ejemplo n.º 4
0
	def __init__(self, session, *args, **kwargs):
		Screen.__init__(self, session)
		self.skinName = [self.skinName, "EPGSelection"]
		if isinstance(self, HelpableScreen):
			HelpableScreen.__init__(self)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		self.searchStartTimer = eTimer()

		# Hook up actions for yttrailer if installed
		try:
			from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
		except ImportError as ie:
			pass
		else:
			if baseEPGSelection__init__ is not None:
				self["trailerActions"] = ActionMap(["InfobarActions", "InfobarTeletextActions"], {
					"showTv": self.showTrailer,
					"showRadio": self.showTrailerList,
					"startTeletext": self.showConfig
				})
Ejemplo n.º 5
0
			def action(self, contexts, action):
				# Reset Quickselect
				self.box.timeout(force = True)

				return HelpableActionMap.action(self, contexts, action)
Ejemplo n.º 6
0
    def __init__(self, session, api=None):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        InfoBarNotifications.__init__(self)

        if api is None:
            if config.plugins.ecasa.last_backend.value == 'picasa':
                self.api = PicasaApi(cache=config.plugins.ecasa.cache.value)
            else:
                self.api = FlickrApi(config.plugins.ecasa.flickr_api_key.value,
                                     cache=config.plugins.ecasa.cache.value)
            try:
                self.api.setCredentials(
                    config.plugins.ecasa.google_username.value,
                    config.plugins.ecasa.google_password.value)
            except Exception as e:
                AddPopup(
                    _("Unable to authenticate with Google: %s.") % (e.message),
                    MessageBox.TYPE_ERROR,
                    5,
                    id=AUTHENTICATION_ERROR_ID,
                )
        else:
            self.api = api

        self["key_red"] = StaticText(_("Close"))
        self["key_green"] = StaticText(_("Albums"))
        self["key_yellow"] = StaticText()
        self["key_blue"] = StaticText(_("Search"))
        for i in xrange(self.PICS_PER_PAGE):
            self['image%d' % i] = Pixmap()
            self['title%d' % i] = StaticText()
        self["highlight"] = MovingPixmap()
        self["waitingtext"] = Label(_("Please wait... Loading list..."))

        self["overviewActions"] = HelpableActionMap(
            self, "EcasaOverviewActions", {
                "up": self.up,
                "down": self.down,
                "left": self.left,
                "right": self.right,
                "nextPage": (self.nextPage, _("show next page")),
                "prevPage": (self.prevPage, _("show previous page")),
                "select": self.select,
                "exit": self.close,
                "albums": (self.albums, _("show your albums (if logged in)")),
                "search": (self.search, _("start a new search")),
                "contextMenu": (self.contextMenu, _("open context menu")),
            }, -1)

        self.offset = 0
        self.__highlighted = 0
        self.pictures = ()

        # thumbnail loader
        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.gotPicture)
        self.currentphoto = None
        self.queue = deque()

        self.onLayoutFinish.append(self.layoutFinished)
Ejemplo n.º 7
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 "key_text" not in self:
         self["key_text"] = StaticText(_("TEXT"))
     if "VKeyIcon" not in self:
         self["VKeyIcon"] = Boolean(False)
     if "HelpWindow" not in self:
         self["HelpWindow"] = Pixmap()
         self["HelpWindow"].hide()
     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["charConfigActions"] = HelpableNumberActionMap(
         self, ["NumberActions", "InputAsciiActions"], {
             "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["charConfigActions"].setEnabled(False if fullUI else True)
     self["editConfigActions"] = HelpableActionMap(
         self, ["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"
                )),
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["editConfigActions"].setEnabled(False if fullUI else True)
     self["virtualKeyBoardActions"] = HelpableActionMap(
         self,
         "VirtualKeyboardActions", {
             "showVirtualKeyboard":
             (self.keyText,
              _("Display the virtual keyboard for data entry"))
         },
         prio=1,
         description=_("Common Setup Actions"))
     self["virtualKeyBoardActions"].setEnabled(False)
     # Temporary support for legacy code and plugins that hasn't yet been updated (next 4 lines).
     # All code should be updated to allow a better UI experience for users.  This patch code
     # forces course control over the edit buttons instead of individual button control that is
     # now available.
     self["config_actions"] = DummyActions()
     self["config_actions"].setEnabled = self.dummyConfigActions
     self["VirtualKB"] = DummyActions()
     self["VirtualKB"].setEnabled = self.dummyVKBActions
     self["config"] = ConfigList(list, session=session)
     self.setCancelMessage(None)
     self.setRestartMessage(None)
     self.onChangedEntry = []
     self.onSave = []
     self.onExecBegin.append(self.showHelpWindow)
     self.onExecEnd.append(self.hideHelpWindow)
     self.onLayoutFinish.append(
         self.noNativeKeys)  # self.layoutFinished is already in use!
     self["config"].onSelectionChanged.append(self.handleInputHelpers)
Ejemplo n.º 8
0
	def __init__(self, session, text, type=TYPE_YESNO, timeout=0, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, picon=True, simple=False, wizard=False, list=None, skin_name=None, timeout_default=None, title=None):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		if text:
			self.text = _(text)
		else:
			self.text = text
		if type in range(self.TYPE_MESSAGE + 1):
			self.type = type
		else:
			self.type = self.TYPE_MESSAGE
		self.timeout = int(timeout)
		self.close_on_any_key = close_on_any_key
		if enable_input:
			self["actions"] = HelpableActionMap(self, ["MsgBoxActions", "DirectionActions"], {
				"cancel": (self.cancel, _("Cancel the selection")),
				"ok": (self.ok, _("Accept the current selection")),
				"alwaysOK": (self.alwaysOK, _("Always select OK")),
				"up": (self.up, _("Move up a line")),
				"down": (self.down, _("Move down a line")),
				"left": (self.left, _("Move up a page")),
				"right": (self.right, _("Move down a page"))
				# These actions are *ONLY* defined on OpenPLi!
				# I don't believe thay add any functionality even for OpenPLi.
				# "upRepeated": (self.up, _("Move up a line repeatedly")),
				# "downRepeated": (self.down, _("Move down a line repeatedly")),
				# "leftRepeated": (self.left, _("Move up a page repeatedly")),
				# "rightRepeated": (self.right, _("Move down a page repeatedly"))
			}, prio=-1, description=_("MessageBox Functions"))
		self.msgBoxID = msgBoxID
		# These six lines can go with new skins that only use self["icon"]...
		self["QuestionPixmap"] = Pixmap()
		self["QuestionPixmap"].hide()
		self["InfoPixmap"] = Pixmap()
		self["InfoPixmap"].hide()
		self["ErrorPixmap"] = Pixmap()
		self["ErrorPixmap"].hide()
		self["icon"] = MultiPixmap()
		self["icon"].hide()
		self.picon = picon
		if picon:
			# These five lines can go with new skins that only use self["icon"]...
			if self.type == self.TYPE_YESNO:
				self["QuestionPixmap"].show()
			elif self.type == self.TYPE_INFO:
				self["InfoPixmap"].show()
			elif self.type == self.TYPE_ERROR:
				self["ErrorPixmap"].show()
			self["icon"].show()
		self.skinName = ["MessageBox"]
		if simple:
			self.skinName = ["MessageBoxSimple"] + self.skinName
		if wizard:
			self["rc"] = MultiPixmap()
			self["rc"].setPixmapNum(config.misc.rcused.value)
			self.skinName = ["MessageBoxWizard"]
		if isinstance(skin_name, str):
			self.skinName = [skin_name] + self.skinName
		if not list:
			list = []
		if type == self.TYPE_YESNO:
			if list:
				self.list = list
			elif default:
				self.list = [(_("Yes"), True), (_("No"), False)]
			else:
				self.list = [(_("No"), False), (_("Yes"), True)]
		else:
			self.list = []
		self.timeout_default = timeout_default
		self.baseTitle = title
		self.activeTitle = None
		self.timerRunning = False
		if timeout > 0:
			self.timerRunning = True
		self["text"] = Label(self.text)
		self["Text"] = StaticText(self.text)  # What is self["Text"] for?
		self["selectedChoice"] = StaticText()
		self["list"] = MenuList(self.list)
		if self.list:
			self["selectedChoice"].setText(self.list[0][0])
		else:
			self["list"].hide()
		self["key_help"] = StaticText(_("HELP"))
		self.timer = eTimer()
		self.timer.callback.append(self.processTimer)
		if self.layoutFinished not in self.onLayoutFinish:
			self.onLayoutFinish.append(self.layoutFinished)
Ejemplo n.º 9
0
	def __init__(self, session):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.list = []
		# Summary
		self.setup_title = _("EPGRefresh Configuration")
		self.onChangedEntry = []
		
		self.session = session
		
		# Although EPGRefresh keeps services in a Set we prefer a list
		self.services = (
			[x for x in epgrefresh.services[0]],
			[x for x in epgrefresh.services[1]]
		)

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

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

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

		self["help"] = StaticText()

		# Define Actions
		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
				"yellow": (self.showFunctionMenu, _("Show more Functions")),
				"blue": (self.editServices, _("Edit Services")),
			}
		)
		self["actions"] = HelpableActionMap(self, "ChannelSelectEPGActions",
			{
				"showEPGList": (self.keyInfo, _("Show last EPGRefresh - Time")),
			}
		)
		self["ChannelSelectBaseActions"] = HelpableActionMap(self, "ChannelSelectBaseActions",
			{
				"nextBouquet": (self.pageup, _("Move page up")),
				"prevBouquet": (self.pagedown, _("Move page down")),
			}
		)
		self["actionstmp"] = ActionMap(["HelpActions"],
			{
				"displayHelp": self.showHelp,
			}
		)
		self["SetupActions"] = HelpableActionMap(self, "SetupActions",
			{
				"cancel": (self.keyCancel, _("Close and forget changes")),
				"save": (self.keySave, _("Close and save changes")),
			}
		)
		
		# Trigger change
		self.changed()
		self.needsEnigmaRestart = False
		self.ServicesChanged = False
		
		self.onLayoutFinish.append(self.setCustomTitle)
		self.onFirstExecBegin.append(self.firstExec)
		self["config"].isChanged = self._ConfigisChanged
Ejemplo n.º 10
0
			def action(self, contexts, action):
				# Reset Quickselect
				self.box.timeout(force = True)

				return HelpableActionMap.action(self, contexts, action)
Ejemplo n.º 11
0
 def __init__(self,
              session,
              text,
              type=TYPE_YESNO,
              timeout=-1,
              list=None,
              default=True,
              closeOnAnyKey=False,
              enableInput=True,
              msgBoxID=None,
              typeIcon=None,
              timeoutDefault=None,
              windowTitle=None,
              skinName=None,
              close_on_any_key=False,
              enable_input=True,
              timeout_default=None,
              title=None,
              picon=None,
              skin_name=None,
              simple=None):
     Screen.__init__(self, session)
     HelpableScreen.__init__(self)
     self.text = text
     self["text"] = Label(text)
     self.type = type
     if type == self.TYPE_YESNO:
         self.list = [(_("Yes"), True),
                      (_("No"), False)] if list is None else list
         self["list"] = MenuList(self.list)
         if isinstance(default, bool):
             self.startIndex = 0 if default else 1
         elif isinstance(default, int):
             self.startIndex = default
         else:
             print(
                 "[MessageBox] Error: The context of the default (%s) can't be determined!"
                 % default)
     else:
         self.list = None
     self.timeout = timeout
     if close_on_any_key == True:  # Process legacy close_on_any_key argument.
         closeOnAnyKey = True
     self.closeOnAnyKey = closeOnAnyKey
     if enable_input == False:  # Process legacy enable_input argument.
         enableInput = False
     if enableInput:
         if self.list:
             self["actions"] = HelpableActionMap(
                 self,
                 ["MsgBoxActions", "NavigationActions"],
                 {
                     "cancel":
                     (self.cancel, _("Select the No / False response")),
                     "select": (self.select,
                                _("Return the current selection response")),
                     "selectOk":
                     (self.selectOk, _("Select the Yes / True response")),
                     "top": (self.top, _("Move to first line")),
                     "pageUp": (self.pageUp, _("Move up a page")),
                     "up": (self.up, _("Move up a line")),
                     # "first": (self.top, _("Move to first line")),
                     # "left": (self.pageUp, _("Move up a page")),
                     # "right": (self.pageDown, _("Move down a page")),
                     # "last": (self.bottom, _("Move to last line")),
                     "down": (self.down, _("Move down a line")),
                     "pageDown": (self.pageDown, _("Move down a page")),
                     "bottom": (self.bottom, _("Move to last line"))
                 },
                 prio=0,
                 description=_("Message Box Actions"))
         else:
             self["actions"] = HelpableActionMap(
                 self, ["OkCancelActions"], {
                     "cancel": (self.cancel, _("Close the window")),
                     "ok": (self.select, _("Close the window"))
                 },
                 prio=0,
                 description=_("Message Box Actions"))
     self.msgBoxID = msgBoxID
     if picon is not None:  # Process legacy picon argument.
         typeIcon = picon
     if typeIcon is None:
         typeIcon = type
     self.typeIcon = typeIcon
     if typeIcon:
         self["icon"] = MultiPixmap()
     if timeout_default is not None:  # Process legacy timeout_default argument.
         timeoutDefault = timeout_default
     self.timeoutDefault = timeoutDefault
     if title is not None:  # Process legacy title argument.
         windowTitle = title
     self.windowTitle = windowTitle or self.TYPE_PREFIX.get(
         type, _("Message"))
     self.baseTitle = self.windowTitle
     self.activeTitle = self.windowTitle
     if skin_name is not None:  # Process legacy skin_name argument.
         skinName = skin_name
     self.skinName = ["MessageBox"]
     if simple:  # Process legacy simple argument, use skinName instead.
         self.skinName.insert(0, "MessageBoxSimple")
     if skinName:
         if isinstance(skinName, str):
             self.skinName.insert(0, skinName)
         else:
             self.skinName = skinName + self.skinName
     self.timer = eTimer()
     self.timer.callback.append(self.processTimer)
     self.onLayoutFinish.append(self.layoutFinished)
Ejemplo n.º 12
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)
Ejemplo n.º 13
0
	def __init__(self, session):
		Screen.__init__(self, session)
		if config.usage.show_infobar_lite.value and (config.skin.primary_skin.value == "DMConcinnity-HD/skin.xml" or config.skin.primary_skin.value.startswith('MetrixHD/')):
			self.skinName = "InfoBarLite"

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

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

		self.allowPiP = True
		self.radioTV = 0

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

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

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

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

		if config.misc.initialchannelselection.value:
			self.onShown.append(self.showMenu)

		self.zoomrate = 0
		self.zoomin = 1

		self.onShow.append(self.doButtonsCheck)
Ejemplo n.º 14
0
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        InfoBarNotifications.__init__(self)
        self.ftpclient = None
        self.queueManagerInstance = None
        self.file = None
        self.queue = None
        self.currlist = "local"

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

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

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

        self.server = None

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

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

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

        self.onExecBegin.append(self.reinitialize)
Ejemplo n.º 15
0
    def __init__(self, session, filelist, index, path):

        HelpableScreen.__init__(self)

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

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

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

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

        Screen.__init__(self, session)

        self["actions"] = HelpableActionMap(
            self, [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "MovieSelectionActions"
            ], {
                "cancel":
                (self.Exit, _("Return to picture index (list or thumbnails)")),
                "green": (self.PlayPause, _("Pause/run slideshow")),
                "yellow": (self.PlayPause, _("Pause/run slideshow")),
                "blue": (self.nextPic, _("Move to next picture")),
                "red": (self.prevPic, _("Move to previous picture")),
                "left": (self.prevPic, _("Move to previous picture")),
                "right": (self.nextPic, _("Move to next picture")),
                "showEventInfo":
                (self.StartExif, _("Show extended image information")),
            }, -1)

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

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

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

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

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

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

        if self.maxentry >= 0:
            self.onLayoutFinish.append(self.setPicloadConf)
Ejemplo n.º 16
0
			def __init__(self, parent, context, actions=None, prio=0):
				if not actions: actions = {}
				HelpableActionMap.__init__(self, parent, context, actions, prio)
				self.box = parent
Ejemplo n.º 17
0
	def __init__(self, session, leftactive, selectedid):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		
		self.selectedFiles = []
		self.selectedid = selectedid

		path_left = config.plugins.filebrowservti.path_left_tmp.value
		path_right = config.plugins.filebrowservti.path_right_tmp.value

		# set filter
		if config.plugins.filebrowservti.extension.value == "myfilter":
			filter = "^.*\.%s" % config.plugins.filebrowservti.my_extension.value
		else:
			filter = config.plugins.filebrowservti.extension.value
		
		# set actuall folder
		self["list_left_head"] = Label(path_left)
		self["list_right_head"] = Label(path_right)
		self["list_left_head_name"] = Label()
		self["list_left_head_state"] = Label()
		self["list_right_head_name"] = Label()
		self["list_right_head_state"] = Label()

		if leftactive:
			self["list_left"] = MultiFileSelectList(self.selectedFiles, path_left, matchingPattern = filter)
			self["list_right"] = FileList(path_right, matchingPattern = filter)
			self.SOURCELIST = self["list_left"]
			self.TARGETLIST = self["list_right"]
			self.listLeft()
		else:
			self["list_left"] = FileList(path_left, matchingPattern = filter)
			self["list_right"] = MultiFileSelectList(self.selectedFiles, path_right, matchingPattern = filter)
			self.SOURCELIST = self["list_right"]
			self.TARGETLIST = self["list_left"]
			self.listRight()

		self["key_red"] = Label(_("Delete"))
		self["key_green"] = Label(_("Move"))
		self["key_yellow"] = Label(_("Copy"))
		self["key_blue"] = Label(_("Skip selection"))

		self["ChannelSelectBaseActions"] = HelpableActionMap(self,"ChannelSelectBaseActions",
			{
				"prevBouquet": (self.listLeft, _("Select left window")),
				"nextBouquet": (self.listRight, _("Select right window")),
				"prevMarker": self.listLeft,
				"nextMarker": self.listRight,
			}, -1)

		self["WizardActions"] = HelpableActionMap(self, "WizardActions", 
			{
				"ok": (self.ok, _("Select / Unselect")),
				"back": (self.exit,_("Exit")),
				"up": (self.goUp, _("Selection up")),
				"down": (self.goDown, _("Selection down")),
				"left": (self.goLeft, _("Page up")),
				"right": (self.goRight, _("Page down")),
			}, -1)

		self["NumberActions"] = HelpableActionMap(self, "NumberActions", 
			{
				"0": (self.doRefresh, _("Refresh screen")),
				"8": (self.sortMode, _("Toggle sort direction up, down")),
			}, -1)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions", 
			{
				"red": (self.goRed, _("Delete")),
				"green": (self.goGreen, _("Move")),
				"yellow": (self.goYellow, _("Copy")),
				"blue": (self.goBlue, _("Skip selection")),
			}, -1)

		self["TimerEditActions"] = HelpableActionMap(self, "TimerEditActions", 
			{
				"eventview": (self.openTasklist, _("Show tasklist. Check copy/move progress in extensions menu")),
			}, -1)

		self["InfobarActions"] = HelpableActionMap(self, "InfobarActions", 
			{
				"showMovies": (self.changeSelectionState,  _("Select/Unselect")),
			}, -1)
		self.onLayoutFinish.append(self.onLayout)
Ejemplo n.º 18
0
	def __init__(self, session, service, zapFunc = None, eventid = None, bouquetChangeCB = None, serviceChangeCB = None, EPGtype = None, StartBouquet = None, StartRef = None, bouquetname = ''):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.longbuttonpressed = False
		self.zapFunc = zapFunc
		self.bouquetChangeCB = bouquetChangeCB
		self.serviceChangeCB = serviceChangeCB
		graphic = False
		if EPGtype == 'single':
			self.type = EPG_TYPE_SINGLE
		elif EPGtype == 'infobar':
			self.type = EPG_TYPE_INFOBAR
		elif EPGtype == 'enhanced':
			self.type = EPG_TYPE_ENHANCED
		elif EPGtype == 'graph':
			self.type = EPG_TYPE_GRAPH
			if config.epgselection.graph_type_mode.getValue() == "graphics":
				graphic = True
		elif EPGtype == 'infobargraph':
			self.type = EPG_TYPE_INFOBARGRAPH
			if config.epgselection.infobar_type_mode.getValue() == "graphics":
				graphic = True
		elif EPGtype == 'multi':
			self.type = EPG_TYPE_MULTI
		else:
			self.type = EPG_TYPE_SIMILAR
		if not self.type == EPG_TYPE_SINGLE:
			self.StartBouquet = StartBouquet
			self.StartRef = StartRef
			self.bouquetname = bouquetname
			self.servicelist = None
		self.ask_time = -1
		self.closeRecursive = False
		self.eventviewDialog = None
		self.eventviewWasShown = False
		self.currch = None
		self.session.pipshown = False
		if plugin_PiPServiceRelation_installed:
			self.pipServiceRelation = getRelationDict()
		else:
			self.pipServiceRelation = {}
		self['Service'] = ServiceEvent()
		self['Event'] = Event()
		self.key_green_choice = self.EMPTY
		self['key_red'] = Button(_('IMDb Search'))
		self['key_green'] = Button(_('Add Timer'))
		self['key_yellow'] = Button(_('EPG Search'))
		self['key_blue'] = Button(_('Add AutoTimer'))
		self['okactions'] = HelpableActionMap(self, 'OkCancelActions',
			{
				'cancel': (self.closeScreen, _('Exit EPG')),
				'OK': (self.OK, _('Zap to channel (setup in menu)')),
				'OKLong': (self.OKLong, _('Zap to channel and close (setup in menu)'))
			}, -1)
		self['okactions'].csel = self
		self['colouractions'] = HelpableActionMap(self, 'ColorActions', 
			{
				'red': (self.redButtonPressed, _('IMDB search for current event')),
				'redlong': (self.redlongButtonPressed, _('Sort EPG List')),
				'green': (self.greenButtonPressed, _('Add/Remove timer for current event')),
				'yellow': (self.yellowButtonPressed, _('Search for similar events')),
				'greenlong': (self.showTimerList, _('Show Timer List')),
				'blue': (self.blueButtonPressed, _('Add a auto timer for current event')),
				'bluelong': (self.bluelongButtonPressed, _('Show AutoTimer List'))
			}, -1)
		self['colouractions'].csel = self
		self['recordingactions'] = HelpableActionMap(self, 'InfobarInstantRecord', 
			{
				'ShortRecord': (self.doRecordTimer, _('Add a record timer for current event')),
				'LongRecord': (self.doZapTimer, _('Add a zap timer for current event'))
			}, -1)
		self['recordingactions'].csel = self
		if self.type == EPG_TYPE_SIMILAR:
			self.currentService = service
			self.eventid = eventid
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'info': (self.Info, _('Show detailed event info')),
					'infolong': (self.InfoLong, _('Show single epg for current channel')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
		elif self.type == EPG_TYPE_SINGLE:
			self.currentService = ServiceReference(service)
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'info': (self.Info, _('Show detailed event info')),
					'epg': (self.Info, _('Show detailed event info')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
			self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
				{
					'left': (self.prevPage, _('Move up a page')),
					'right': (self.nextPage, _('Move down a page')),
					'up': (self.moveUp, _('Goto previous channel')),
					'down': (self.moveDown, _('Goto next channel'))
				}, -1)
			self['cursoractions'].csel = self
		elif self.type == EPG_TYPE_INFOBAR or self.type == EPG_TYPE_ENHANCED:
			if self.type == EPG_TYPE_INFOBAR:
				self.skinName = 'QuickEPG'
				self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
					{
						'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
						'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
						'nextService': (self.nextPage, _('Move down a page')),
						'prevService': (self.prevPage, _('Move up a page')),
						'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
						'info': (self.Info, _('Show detailed event info')),
						'infolong': (self.InfoLong, _('Show single epg for current channel')),
						'menu': (self.createSetup, _('Setup menu'))
					}, -1)
				self['epgactions'].csel = self
				self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
					{
						'left': (self.prevService, _('Goto previous channel')),
						'right': (self.nextService, _('Goto next channel')),
						'up': (self.moveUp, _('Goto previous channel')),
						'down': (self.moveDown, _('Goto next channel'))
					}, -1)
				self['cursoractions'].csel = self
			elif self.type == EPG_TYPE_ENHANCED:
				self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
					{
						'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
						'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
						'nextService': (self.nextService, _('Goto next channel')),
						'prevService': (self.prevService, _('Goto previous channel')),
						'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
						'info': (self.Info, _('Show detailed event info')),
						'infolong': (self.InfoLong, _('Show single epg for current channel')),
						'menu': (self.createSetup, _('Setup menu'))
					}, -1)
				self['epgactions'].csel = self
				self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
					{
						'left': (self.prevPage, _('Move up a page')),
						'right': (self.nextPage, _('Move down a page')),
						'up': (self.moveUp, _('Goto previous channel')),
						'down': (self.moveDown, _('Goto next channel'))
					}, -1)
				self['cursoractions'].csel = self
			self['inputactions'] = HelpableNumberActionMap(self, 'NumberActions', 
				{
					'1': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'2': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'3': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'4': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'5': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'6': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'7': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'8': (self.keyNumberGlobal, _('enter number to jump to channel.')),
					'9': (self.keyNumberGlobal, _('enter number to jump to channel.'))
				}, -1)
			self['inputactions'].csel = self
			self.list = []
			self.servicelist = service
			self.currentService = self.session.nav.getCurrentlyPlayingServiceOrGroup()
		elif self.type == EPG_TYPE_GRAPH or self.type == EPG_TYPE_INFOBARGRAPH:
			if self.type == EPG_TYPE_GRAPH:
				if not config.epgselection.graph_pig.getValue():
					self.skinName = 'GraphicalEPG'
				else:
					self.skinName = 'GraphicalEPGPIG'
			elif self.type == EPG_TYPE_INFOBARGRAPH:
				self.skinName = 'GraphicalInfoBarEPG'
			now = time() - int(config.epg.histminutes.getValue()) * 60
			if self.type == EPG_TYPE_GRAPH:
				self.ask_time = self.ask_time = now - now % (int(config.epgselection.graph_roundto.getValue()) * 60)
			elif self.type == EPG_TYPE_INFOBARGRAPH:
				self.ask_time = self.ask_time = now - now % (int(config.epgselection.infobar_roundto.getValue()) * 60)
			self.closeRecursive = False
			self['lab1'] = Label(_('Wait please while gathering data...'))
			self['timeline_text'] = TimelineText(type=self.type,graphic=graphic)
			self['Event'] = Event()
			self['primetime'] = Label(_('PRIMETIME'))
			self['change_bouquet'] = Label(_('CHANGE BOUQUET'))
			self['jump'] = Label(_('JUMP 24 HOURS'))
			self['page'] = Label(_('PAGE UP/DOWN'))
			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 = service
			self.curBouquet = bouquetChangeCB
			self.updateTimelineTimer = eTimer()
			self.updateTimelineTimer.callback.append(self.moveTimeLines)
			self.updateTimelineTimer.start(60000)
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'nextService': (self.nextService, _('Jump forward 24 hours')),
					'prevService': (self.prevService, _('Jump back 24 hours')),
					'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
					'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
					'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
					'info': (self.Info, _('Show detailed event info')),
					'infolong': (self.InfoLong, _('Show single epg for current channel')),
					'tv': (self.togglePIG, _('Toggle Picture In Graphics')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
			self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
				{
					'left': (self.leftPressed, _('Goto previous event')),
					'right': (self.rightPressed, _('Goto next event')),
					'up': (self.moveUp, _('Goto previous channel')),
					'down': (self.moveDown, _('Goto next channel'))
				}, -1)
			self['cursoractions'].csel = self
			self['input_actions'] = HelpableNumberActionMap(self, 'NumberActions', 
				{
					'1': (self.keyNumberGlobal, _('Reduce time scale')),
					'2': (self.keyNumberGlobal, _('Page up')),
					'3': (self.keyNumberGlobal, _('Increase time scale')),
					'4': (self.keyNumberGlobal, _('page left')),
					'5': (self.keyNumberGlobal, _('Jump to current time')),
					'6': (self.keyNumberGlobal, _('Page right')),
					'7': (self.keyNumberGlobal, _('No of items switch (increase or reduced)')),
					'8': (self.keyNumberGlobal, _('Page down')),
					'9': (self.keyNumberGlobal, _('Jump to prime time')),
					'0': (self.keyNumberGlobal, _('Move to home of list'))
				}, -1)
			self['input_actions'].csel = self
		elif self.type == EPG_TYPE_MULTI:
			self.skinName = 'EPGSelectionMulti'
			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.curBouquet = bouquetChangeCB
			self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
				{
					'nextService': (self.nextPage, _('Move down a page')),
					'prevService': (self.prevPage, _('Move up a page')),
					'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
					'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
					'input_date_time': (self.enterDateTime, _('Goto specific data/time')),
					'info': (self.Info, _('Show detailed event info')),
					'infolong': (self.InfoLong, _('Show single epg for current channel')),
					'menu': (self.createSetup, _('Setup menu'))
				}, -1)
			self['epgactions'].csel = self
			self['cursoractions'] = HelpableActionMap(self, 'DirectionActions', 
				{
					'left': (self.leftPressed, _('Move up a page')),
					'right': (self.rightPressed, _('Move down a page')),
					'up': (self.moveUp, _('Goto previous channel')),
					'down': (self.moveDown, _('Goto next channel'))
				}, -1)
			self['cursoractions'].csel = self
		if self.type == EPG_TYPE_GRAPH:
			time_epoch=config.epgselection.graph_prevtimeperiod.getValue()
		elif self.type == EPG_TYPE_INFOBARGRAPH:
			time_epoch=config.epgselection.infobar_prevtimeperiod.getValue()
		else:
			time_epoch=None
		self['list'] = EPGList(type=self.type, selChangedCB=self.onSelectionChanged, timer=session.nav.RecordTimer, time_epoch=time_epoch, overjump_empty=config.epgselection.overjump.getValue(), graphic=graphic)
		self.refreshTimer = eTimer()
		self.refreshTimer.timeout.get().append(self.refreshData)
		self.listTimer = eTimer()
		self.listTimer.timeout.get().append(self.hidewaitingtext)
		self.onLayoutFinish.append(self.onCreate)
Ejemplo n.º 19
0
    def __init__(self, session, dvd_device=None, dvd_filelist=[], args=None):
        Screen.__init__(self, session)
        InfoBarBase.__init__(self)
        InfoBarNotifications.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarShowHide.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)
        self.save_infobar_seek_config()
        self.change_infobar_seek_config()
        InfoBarSeek.__init__(self)
        InfoBarPVRState.__init__(self)

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

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

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

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

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

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

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

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

        self.onClose.append(self.__onClose)

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

        self.autoplay = dvd_device or dvd_filelist

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

        self.dvd_filelist = dvd_filelist
        self.onFirstExecBegin.append(self.opened)
        self.service = None
        self.in_menu = False
        if fileExists("/proc/stb/fb/dst_left"):
            print("[DVD] Read /proc/stb/fb/dst_left")
            self.left = open("/proc/stb/fb/dst_left", "r").read()
            print("[DVD] Read /proc/stb/fb/dst_width")
            self.width = open("/proc/stb/fb/dst_width", "r").read()
            print("[DVD] Read /proc/stb/fb/dst_top")
            self.top = open("/proc/stb/fb/dst_top", "r").read()
            print("[DVD] Read /proc/stb/fb/dst_height")
            self.height = open("/proc/stb/fb/dst_height", "r").read()
            if self.left != "00000000" or self.top != "00000000" or self.width != "000002d0" or self.height != "0000000240":
                print("[DVD] Write to /proc/stb/fb/dst_left")
                open("/proc/stb/fb/dst_left", "w").write("00000000")
                print("[DVD] Write to /proc/stb/fb/dst_width")
                open("/proc/stb/fb/dst_width", "w").write("000002d0")
                print("[DVD] Write to /proc/stb/fb/dst_top")
                open("/proc/stb/fb/dst_top", "w").write("00000000")
                print("[DVD] Write to /proc/stb/fb/dst_height")
                open("/proc/stb/fb/dst_height", "w").write("0000000240")
                self.onClose.append(self.__restoreOSDSize)
Ejemplo n.º 20
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self["actions"] = HelpableActionMap(
            self,
            "InfobarActions",
            {
                "showMovies": (self.showMovies, _("Play recorded movies...")),
                "showRadio": (self.showRadio, _("Show the radio player...")),
                "showTv": (self.showTv, _("Show the tv player...")),
                #+++>
                "toogleTvRadio":
                (self.toogleTvRadio, _("toggels betwenn tv and radio...")),
                "volumeUp": (self._volUp, _("...")),
                "volumeDown": (self._volDown, _("...")),
                #+++<
            },
            prio=2)

        #--->
        #-		for x in HelpableScreen, \
        #-				InfoBarBase, InfoBarShowHide, \
        #-				InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, \
        #-				InfoBarInstantRecord, InfoBarAudioSelection, \
        #-				InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
        #-				InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
        #-				InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, \
        #-				InfoBarSleepTimer, InfoBarPlugins, InfoBarServiceErrorPopupSupport:
        #---<
        #+++>
        for x in HelpableScreen, \
          InfoBarBase, InfoBarShowHide, \
          InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, \
          InfoBarInstantRecord, InfoBarAudioSelection, InfoBarExtendedAudioSelection, \
          InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarAspectSelection, InfoBarResolutionSelection, InfoBarSubserviceSelection, \
          InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
          InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, \
          InfoBarSleepTimer, InfoBarPlugins, InfoBarServiceErrorPopupSupport:
            #+++<

            x.__init__(self)

        self.helpList.append(
            (self["actions"], "InfobarActions", [("showMovies",
                                                  _("view recordings..."))]))
        self.helpList.append(
            (self["actions"], "InfobarActions", [("showRadio",
                                                  _("hear radio..."))]))

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

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

        #+++>
        # I know that this is not nice but i dont know how to directly access VolumneControl
        from Screens.Volume import Volume
        self.volumeDialog = session.instantiateDialog(Volume)
        from enigma import eTimer
        self.hideVolTimer = eTimer()
        self.hideVolTimer.callback.append(self.volHide)
Ejemplo n.º 21
0
    def __init__(self,
                 session,
                 title="",
                 text="",
                 captcha=None,
                 is_dialog=False,
                 auto_text_init=False,
                 suggest_func=None):
        global last_text
        self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
        path = "%s/%s/MP_VirtualKeyBoard.xml" % (self.skin_path,
                                                 mp_globals.currentskin)
        if not fileExists(path):
            path = self.skin_path + mp_globals.skinFallback + "/MP_VirtualKeyBoard.xml"
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)
        NumericalTextInput.__init__(self,
                                    nextFunc=self.nextFunc,
                                    handleTimeout=True)
        HelpableScreen.__init__(self)
        self.sms_txt = None
        self.keys_list = []
        self.shiftkeys_list = []
        self.lang = language.getLanguage()
        self.nextLang = None
        self.shiftMode = False
        self.cursor = "XcursorX"
        self.gui_cursor = "|"
        text = last_text if auto_text_init and not text else text
        self.text = text + self.cursor
        self.auto_text_init = auto_text_init

        self.suggest_func = suggest_func if config.mediaportal.ena_suggestions.value else None
        if mp_globals.currentskin == "original":
            self.DEFAULT_LM = 10  # default Left-Margin "original"
        else:
            self.DEFAULT_LM = 0  # default Left-Margin
        self.ml2 = MenuList([],
                            enableWrapAround=False,
                            content=eListboxPythonMultiContent)
        self["suggestionlist"] = self.ml2
        self.suggestionsListEnabled = False
        self.suggestionsList = None

        self.selectedKey = 0
        self.cursor_show = True
        self.cursor_time = 1000
        self.cursorTimer = eTimer()
        if mp_globals.isDreamOS:
            self.cursorTimer_conn = self.cursorTimer.timeout.connect(
                self.toggleCursor)
        else:
            self.cursorTimer.callback.append(self.toggleCursor)
        self.cursorTimer.start(self.cursor_time, True)
        self.captcha = captcha
        self.picload = ePicLoad()

        self['captcha'] = Pixmap()
        self["country"] = StaticText("")
        self["header"] = Label(title)
        self["text"] = Label()
        self['title'] = Label()
        self.ml = MenuList([],
                           enableWrapAround=False,
                           content=eListboxPythonMultiContent)
        self["list"] = self.ml

        self["actions"] = ActionMap(
            ["KeyboardInputActions", "InputAsciiActions"], {
                "gotAsciiCode": self.keyGotAscii,
                "deleteBackward": self.backClicked
            }, -2)
        self["InputBoxActions"] = HelpableActionMap(
            self, "InputBoxActions", {
                "deleteBackward": (self.cursorLeft, _("Move cursor left")),
                "deleteForward": (self.cursorRight, _("Move cursor right"))
            }, -2)
        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "ok": (self.okClicked, _("Select key")),
                "cancel": (self.exit, _("Cancel"))
            }, -2)
        self["ShortcutActions"] = HelpableActionMap(
            self, "ShortcutActions", {
                "red": (self.backClicked, _("Delete (left of the cursor)")),
                "blue": (self.backSpace, _("Delete (right of the cursor)")),
                "green": (self.ok, _("Save")),
                "yellow": (self.switchLang, _("Switch keyboard layout"))
            }, -2)
        self["WizardActions"] = HelpableActionMap(
            self, "WizardActions", {
                "left": (self.left, _("Left")),
                "right": (self.right, _("Right")),
                "up": (self.up, _("Up")),
                "down": (self.down, _("Down"))
            }, -2)
        self["SeekActions"] = HelpableActionMap(
            self, "SeekActions", {
                "seekBack": (self.move_to_begin, _("Move to begin")),
                "seekFwd": (self.move_to_end, _("Move to end"))
            }, -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
            })
        if self.suggest_func != None:
            self["EPGSelectActions"] = HelpableActionMap(
                self, "EPGSelectActions", {
                    "nextBouquet":
                    (self.selectVKB, _("Select virtual keyboard")),
                    "prevBouquet":
                    (self.selectSuggestionsList, _("Select suggestions list"))
                }, -2)

        self.setLang()
        self.buildVirtualKeyBoard()
        self.onExecBegin.append(self.setKeyboardModeAscii)
        self.onLayoutFinish.append(self.__onLayoutFinish)
        self.onLayoutFinish.append(self.set_GUI_Text)
        self.onClose.append(self.__onClose)
    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
        if config.EMC.use_orig_skin.value:
            self.skinName = "EMCMediaCenterOwn"
        else:
            self.skinName = "EMCMediaCenter"
        skin = getSkin()
        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")),
                "nextTitle":
                (self.nextTitle, _("jump forward to the next title")),
                "prevTitle":
                (self.prevTitle, _("jump back to the previous title")),
                "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))
Ejemplo n.º 23
0
    def __init__(self, session, piclist, lastindex, path):
        self["key_red"] = Button("")
        self["key_green"] = Button("Slide Show")
        self["key_yellow"] = Button("File View")
        self["key_blue"] = Button(_("Settings"))
        self.textcolor = config.plugins.mc_pp.textcolor.value
        self.color = config.plugins.mc_pp.bgcolor.value
        textsize = 20
        self.spaceX = 20
        self.spaceY = 28
        self.picX = config.plugins.mc_pp.ThumbWidth.value
        self.picY = config.plugins.mc_pp.ThumbHeight.value
        size_w = getDesktop(0).size().width()
        size_h = getDesktop(0).size().height()

        if size_w == 1280:
            self.spaceTop = 130
            self.spaceLeft = 50
            self.ButtonPosY = 95
        else:
            self.spaceTop = 120
            self.spaceLeft = 25
            self.ButtonPosY = 72

        self.thumbsX = size_w / (self.spaceX + self.picX)  # thumbnails in X
        self.thumbsY = size_h / (self.spaceY + self.picY)  # thumbnails in Y
        self.thumbsC = self.thumbsX * self.thumbsY  # all thumbnails
        self.positionlist = []
        skincontent = ""

        posX = -1
        for x in range(self.thumbsC):
            posY = x / self.thumbsX
            posX += 1
            if posX >= self.thumbsX:
                posX = 0
            absX = self.spaceLeft + self.spaceX + (posX *
                                                   (self.spaceX + self.picX))
            absY = self.spaceTop + self.spaceY + (posY *
                                                  (self.spaceY + self.picY))
            self.positionlist.append((absX, absY))
            skincontent += "<widget name=\"label" + str(
                x
            ) + "\" position=\"" + str(absX + 5) + "," + str(
                absY + self.picY - textsize
            ) + "\" size=\"" + str(self.picX - 10) + "," + str(
                textsize
            ) + "\" font=\"Regular;14\" zPosition=\"2\" transparent=\"1\" noWrap=\"1\" foregroundColor=\"" + self.textcolor + "\" />"
            skincontent += "<widget name=\"thumb" + str(
                x) + "\" position=\"" + str(absX + 5) + "," + str(
                    absY + 5
                ) + "\" size=\"" + str(self.picX - 10) + "," + str(
                    self.picY - (textsize * 2)
                ) + "\" zPosition=\"2\" transparent=\"1\" alphatest=\"on\" />"
        # Screen, buttons, backgroundlabel and MovingPixmap
        self.skin = "<screen position=\"0,0\" size=\"" + str(
            size_w
        ) + "," + str(size_h) + "\" flags=\"wfNoBorder\" > \
			<ePixmap name=\"mb_bg\" position=\"0,0\" zPosition=\"1\" size=\"" + str(
            size_w
        ) + "," + str(
            size_h
        ) + "\" pixmap=\"" + mcpath + "skins/defaultHD/images/frame_base-fs8.png\" /> \
			<ePixmap pixmap=\"" + mcpath + "icons/key-red.png\" position=\"60," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \
			<ePixmap pixmap=\"" + mcpath + "icons/key-green.png\" position=\"210," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \
			<ePixmap pixmap=\"" + mcpath + "icons/key-yellow.png\" position=\"360," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \
			<ePixmap pixmap=\"" + mcpath + "icons/key-blue.png\" position=\"510," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"2\" size=\"140,40\" transparent=\"1\" alphatest=\"on\" /> \
			<widget name=\"key_red\" position=\"60," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#9f1313\" transparent=\"1\" /> \
			<widget name=\"key_green\" position=\"210," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#1f771f\" transparent=\"1\" /> \
			<widget name=\"key_yellow\" position=\"360," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#a08500\" transparent=\"1\" /> \
			<widget name=\"key_blue\" position=\"510," + str(
            self.ButtonPosY
        ) + "\" zPosition=\"3\" size=\"140,40\" font=\"Regular;20\" valign=\"center\" halign=\"center\" backgroundColor=\"#18188b\" transparent=\"1\" /> \
			<eLabel position=\"0,0\" zPosition=\"0\" size=\"" + str(size_w) + "," + str(
            size_h
        ) + "\" backgroundColor=\"" + self.color + "\" /> \
			<widget name=\"frame\" position=\"35,30\" size=\"" + str(
            self.picX + 1
        ) + "," + str(
            self.picY +
            10
        ) + "\" pixmap=\"pic_frame.png\" zPosition=\"3\" alphatest=\"on\" />" + skincontent + "</screen>"
        Screen.__init__(self, session)

        self["actions"] = HelpableActionMap(
            self, "MC_PictureViewerActions", {
                "ok": (self.KeyOk, "Show Picture"),
                "cancel": (self.Exit, "Exit Picture Viewer"),
                "left": (self.key_left, "List Top"),
                "right": (self.key_right, "List Bottom"),
                "up": (self.key_up, "List up"),
                "down": (self.key_down, "List down"),
                "info": (self.StartExif, "Show File Info"),
                "green": (self.startslideshow, "Start Slideshow"),
                "yellow": (self.close, "File View"),
                "blue": (self.Settings, "Settings"),
            }, -2)
        self["frame"] = MovingPixmap()
        for x in range(self.thumbsC):
            self["label" + str(x)] = Label()
            self["thumb" + str(x)] = Pixmap()
        self.Thumbnaillist = []
        self.filelist = []
        self.currPage = -1
        self.dirlistcount = 0
        self.path = path
        index = 0
        framePos = 0
        Page = 0
        for x in piclist:
            if x[0][1] == False:
                self.filelist.append(
                    (index, framePos, Page, x[0][0], path + x[0][0]))
                index += 1
                framePos += 1
                if framePos > (self.thumbsC - 1):
                    framePos = 0
                    Page += 1
            else:
                self.dirlistcount += 1

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

        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.showPic)
        self.onLayoutFinish.append(self.setPicloadConf)
        self.ThumbTimer = eTimer()
        self.ThumbTimer.callback.append(self.showPic)
Ejemplo n.º 24
0
class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection,
                  InfoBarCueSheetSupport, InfoBarNotifications,
                  InfoBarSubtitleSupport, HelpableScreen):
    ALLOW_SUSPEND = True
    ENABLE_RESUME_SUPPORT = True

    def __init__(self, session, args=None):
        Screen.__init__(self, session)
        InfoBarAudioSelection.__init__(self)
        InfoBarCueSheetSupport.__init__(self,
                                        actionmap="MediaPlayerCueSheetActions")
        InfoBarNotifications.__init__(self)
        InfoBarBase.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        HelpableScreen.__init__(self)
        self.summary = None
        self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.session.nav.stopService()

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

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

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

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

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

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

        self.seek_target = None

        try:
            from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
            hotplugNotifier.append(self.hotplugCB)
        except Exception, ex:
            print "[MediaPlayer] No hotplug support", ex

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

            def action(self, contexts, action):
                self.player.show()
                return NumberActionMap.action(self, contexts, action)

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "ok": (self.ok, _("add file to playlist")),
                "cancel": (self.exit, _("exit mediaplayer")),
            }, -2)

        self["MediaPlayerActions"] = HelpableActionMap(
            self, "MediaPlayerActions", {
                "play": (self.xplayEntry, _("play entry")),
                "pause": (self.pauseEntry, _("pause")),
                "stop": (self.stopEntry, _("stop entry")),
                "previous": (self.previousMarkOrEntry,
                             _("play from previous mark or playlist entry")),
                "next": (self.nextMarkOrEntry,
                         _("play from next mark or playlist entry")),
                "menu": (self.showMenu, _("menu")),
                "skipListbegin": (self.skip_listbegin, _("jump to listbegin")),
                "skipListend": (self.skip_listend, _("jump to listend")),
                "prevBouquet":
                (self.switchToPlayList, _("switch to playlist")),
                "nextBouquet":
                (self.switchToFileList, _("switch to filelist")),
                "delete":
                self.deletePlaylistEntry,
                "shift_stop": (self.clear_playlist, _("clear playlist")),
                "shift_record":
                self.playlist.PlayListShuffle,
                "subtitles":
                self.subtitleSelection,
            }, -2)

        self["InfobarEPGActions"] = HelpableActionMap(
            self, "InfobarEPGActions", {
                "showEventInfo": self.showEventInformation,
            })

        self["actions"] = MoviePlayerActionMap(
            self, ["DirectionActions"], {
                "right": self.rightDown,
                "rightRepeated": self.doNothing,
                "rightUp": self.rightUp,
                "left": self.leftDown,
                "leftRepeated": self.doNothing,
                "leftUp": self.leftUp,
                "up": self.up,
                "upRepeated": self.up,
                "upUp": self.doNothing,
                "down": self.down,
                "downRepeated": self.down,
                "downUp": self.doNothing,
            }, -2)

        InfoBarSeek.__init__(self, actionmap="MediaPlayerSeekActions")

        self.onClose.append(self.delMPTimer)
        self.onClose.append(self.__onClose)

        self.righttimer = False
        self.rightKeyTimer = eTimer()
        self.rightKeyTimer.callback.append(self.rightTimerFire)

        self.lefttimer = False
        self.leftKeyTimer = eTimer()
        self.leftKeyTimer.callback.append(self.leftTimerFire)

        self.currList = "filelist"
        self.isAudioCD = False
        self.AudioCD_albuminfo = {}
        self.cdAudioTrackFiles = []
        self.onShown.append(self.applySettings)

        self.playlistIOInternal = PlaylistIOInternal()
        list = self.playlistIOInternal.open(
            resolveFilename(SCOPE_CONFIG, "playlist.e2pls"))
        if list:
            for x in list:
                self.playlist.addFile(x.ref)
            self.playlist.updateList()

        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
                iPlayableService.evUser + 10: self.__evAudioDecodeError,
                iPlayableService.evUser + 11: self.__evVideoDecodeError,
                iPlayableService.evUser + 12: self.__evPluginError,
                iPlayableService.evUser + 13: self["coverArt"].embeddedCoverArt
            })
Ejemplo n.º 25
0
 def action(self, contexts, action):
     self.box.timeout(force=True)
     return HelpableActionMap.action(self, contexts, action)
Ejemplo n.º 26
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self["actions"] = HelpableActionMap(
            self,
            "InfobarActions", {
                "showMovies": (self.showMovies, _("Play recorded movies...")),
                "showRadio": (self.showRadio, _("Show the radio player...")),
                "showTv": (self.TvRadioToggle, _("Show the tv player...")),
                "showMediaPlayer":
                (self.showMediaPlayer, _("Show the media player...")),
                "openBouquetList":
                (self.openBouquetList, _("open bouquetlist")),
                "openSleepTimer":
                (self.openPowerTimerList, _("Show the Sleep Timer...")),
                "showEMC": (self.showEMC, _("Show the media center...")),
                "showETPORTAL": (self.showETPORTAL, _("Open EtPortal...")),
                "showMEDIAPORTAL":
                (self.showMEDIAPORTAL, _("Open MediaPortal...")),
                "showWWW": (self.showWWW, _("Open WWW Plugin...")),
                "showPluginBrowser":
                (self.showPluginBrowser, _("Show the plugins...")),
                "showBoxPortal": (self.showBoxPortal, _("Show Box Portal...")),
            },
            prio=2)

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

        self.allowPiP = True
        self.radioTV = 0

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

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

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

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

        if config.misc.initialchannelselection.value:
            self.onShown.append(self.showMenu)

        self.onShow.append(self.doButtonsCheck)
Ejemplo n.º 27
0
	def __init__(self, session, eventName, callbackNeeded=False, save=False, savepath=None, localpath=None):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)

		for tag in config.plugins.imdb.ignore_tags.getValue().split(','):
			eventName = eventName.replace(tag,'')

		eventName = ' '.join(eventName.split()).strip()

		self.eventName = eventName

		self.callbackNeeded = callbackNeeded
		self.callbackData = ""
		self.callbackGenre = ""

		self.saving = save
		self.savingpath = savepath
		self.localpath = localpath
		self.fetchurl = None

		self.dictionary_init()

		self["poster"] = Pixmap()
		self.picload = ePicLoad()
		self.picload.PictureData.get().append(self.paintPosterPixmapCB)

		self["stars"] = ProgressBar()
		self["starsbg"] = Pixmap()
		self["stars"].hide()
		self["starsbg"].hide()
		self.ratingstars = -1

		self["title"] = StaticText(_("The Internet Movie Database"))
		# map new source -> old component
		def setText(txt):
			StaticText.setText(self["title"], txt)
			self["titellabel"].setText(txt)
		self["title"].setText = setText
		self["titellabel"] = Label()
		self["detailslabel"] = ScrollLabel("")
		self["castlabel"] = ScrollLabel("")
		self["extralabel"] = ScrollLabel("")
		self["statusbar"] = Label("")
		self["ratinglabel"] = Label("")
		self.resultlist = []
		self["menu"] = MenuList(self.resultlist)
		self["menu"].hide()

		self["key_red"] = Button(_("Exit"))
		self["key_green"] = Button("")
		self["key_yellow"] = Button("")
		self["key_blue"] = Button("")

		# 0 = multiple query selection menu page
		# 1 = movie info page
		# 2 = extra infos page
		self.Page = 0

		self["actionsOk"] = HelpableActionMap(self, "OkCancelActions",
		{
			"ok": (self.showDetails, _("Show movie and series basic details")),
			"cancel": (self.exit, _("Exit IMDb search")),
		}, -1)
		self["actionsColor"] = HelpableActionMap(self, "ColorActions",
		{
			"red": (self.exit, _("Exit IMDb search")),
			"green": (self.showMenu, _("Show list of matched movies an series")),
			"yellow": (self.showDetails, _("Show movie and series basic details")),
			"blue": (self.showExtras, _("Show movie and series extra details")),
		}, -1)
		self["actionsMovieSel"] = HelpableActionMap(self, "MovieSelectionActions",
		{
			"contextMenu": (self.contextMenuPressed, _("Menu")),
			"showEventInfo": (self.showDetails, _("Show movie and series basic details")),
		}, -1)
		self["actionsDir"] = HelpableActionMap(self, "DirectionActions",
		{
			"down": (self.pageDown, _("Page down")),
			"up": (self.pageUp, _("Page up")),
		}, -1)

		self.getIMDB()

		if self.localpath is not None:                                # otherwise the stars are not correctly shown if we call details directly
			self.onLayoutFinish.append(self._layoutFinished)
Ejemplo n.º 28
0
			def __init__(self, parent, context, actions=None, prio=0):
				if not actions: actions = {}
				HelpableActionMap.__init__(self, parent, context, actions, prio)
				self.box = parent
Ejemplo n.º 29
0
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        ChannelsBase.__init__(self)

        self.session = session

        self.skinName = ["SeriesPluginChannelEditor"]

        from plugin import NAME, VERSION
        self.setup_title = NAME + " " + _("Channel Editor") + " " + VERSION

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

        # Define Actions
        self["actions_1"] = HelpableActionMap(
            self, "SetupActions", {
                "ok": (self.keyAdd, _("Show popup to add Stb Channel")),
                "cancel": (self.keyCancel, _("Cancel and close")),
                "deleteForward":
                (self.keyResetChannelMapping, _("Reset channels")),
            }, -1)
        self["actions_2"] = HelpableActionMap(
            self, "DirectionActions", {
                "left": (self.keyLeft, _("Previeous page")),
                "right": (self.keyRight, _("Next page")),
                "up": (self.keyUp, _("One row up")),
                "down": (self.keyDown, _("One row down")),
            }, -1)
        self["actions_3"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.keyCancel, _("Cancel and close")),
                "green": (self.keySave, _("Save and close")),
                "blue": (self.keyRemove, _("Remove channel")),
                "yellow": (self.tryToMatchChannels, _("Auto match")),
            }, -2)  # higher priority

        self.helpList[0][2].sort()

        self["helpActions"] = ActionMap([
            "HelpActions",
        ], {"displayHelp": self.showHelp}, 0)

        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        global TemplatedListFonts
        if TemplatedListFonts is not None:
            tlf = TemplatedListFonts()
            self.chooseMenuList.l.setFont(
                0, gFont(tlf.face(tlf.MEDIUM), tlf.size(tlf.MEDIUM)))
            self.chooseMenuList.l.setItemHeight(30)
        else:
            self.chooseMenuList.l.setFont(0, gFont('Regular', 20))
            self.chooseMenuList.l.setItemHeight(25)
        self['list'] = self.chooseMenuList
        self['list'].show()

        self.stbChlist = []
        self.webChlist = []
        self.stbToWebChlist = []

        self.onLayoutFinish.append(self.readChannels)
Ejemplo n.º 30
0
	def __init__(self, session):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.skinName = ["ConfigScreen", "ConfigListScreen"]

		from .plugin import NAME, VERSION, gPushService
		self.setup_title = NAME + " " + _("Configuration") + " " + VERSION

		PushServiceBase.__init__(self)
		if gPushService:
			gPushService.stop()

		# Load local moduls to work on
		self.load()

		# Buttons
		self["key_red"] = StaticText("")
		self["key_green"] = StaticText("")
		self["key_blue"] = StaticText("")
		self["key_yellow"] = StaticText("")

		self.help_window = None

		# Define Actions
		#E2 Bug self["custom_actions"] = HelpableActionMap(self, ["SetupActions", "ColorActions", "PushServiceConfigActions"],
		self["custom_actions"] = HelpableActionMap(self, "PushServiceConfigActions",
		{
			"pageUp": (self.pageUp, _("Page up")),
			"pageDown": (self.pageDown, _("Page down")),
		}, -2) # higher priority

		self["main_actions"] = HelpableActionMap(self, "PushServiceConfigActions",
		{
			"red": (self.keyCancel, _("Exit without saving")),
			"green": (self.keySave, _("Save and exit")),
		}, -2) # higher priority
		self["main_actions"].setEnabled(False)

		self["main_actions_enabled"] = HelpableActionMap(self, "PushServiceConfigActions",
		{
			"yellow": (self.showServices, _("Show Services")),
			"blue": (self.showControllers, _("Show Controllers")),
		}, -2) # higher priority
		self["main_actions_enabled"].setEnabled(False)

		self["service_actions"] = HelpableActionMap(self, "PushServiceConfigActions",
		{
			"red": (self.showMain, _("Back to main screen")),
			"green": (self.testService, _("Test selected Service")),
			"yellow": (self.addServices, _("Add Service")),
			"blue": (self.removeServices, _("Remove Service")),
		}, -2) # higher priority
		self["service_actions"].setEnabled(False)

		self["controller_actions"] = HelpableActionMap(self, "PushServiceConfigActions",
		{
			"red": (self.showMain, _("Back to main screen")),
			"green": (self.testController, _("Test selected Controller")),
			"yellow": (self.addControllers, _("Add Controller")),
			"blue": (self.removeControllers, _("Remove Controller")),
		}, -2) # higher priority
		self["controller_actions"].setEnabled(False)

		# Initialize Configuration part
		self.list = []
		self.state = MAIN
		self.build()
		ConfigListScreen.__init__(self, self.list, session=session, on_change=self.change)

		# Override selectionChanged because our config tuples are bigger
		self.onChangedEntry = []

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

		self.setTitle(self.setup_title)
Ejemplo n.º 31
0
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        ChannelsBase.__init__(self)
        WebChannels.__init__(self)

        self.session = session

        self.skinName = ["SeriesPluginChannelEditor"]

        log.debug("ChannelEditor")

        from plugin import NAME, VERSION
        self.setup_title = NAME + " " + _("Channel Editor") + " " + VERSION

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

        # Define Actions
        self["actions_1"] = HelpableActionMap(
            self, "SetupActions", {
                "ok": (self.keyAdd, _("Show popup to add Stb Channel")),
                "cancel": (self.keyCancel, _("Cancel and close")),
                "deleteForward":
                (self.keyResetChannelMapping, _("Reset channels")),
            }, -1)
        self["actions_2"] = HelpableActionMap(
            self, "DirectionActions", {
                "left": (self.keyLeft, _("Previeous page")),
                "right": (self.keyRight, _("Next page")),
                "up": (self.keyUp, _("One row up")),
                "down": (self.keyDown, _("One row down")),
            }, -1)
        self["actions_3"] = HelpableActionMap(
            self, "ChannelSelectBaseActions", {
                "nextBouquet": (self.nextBouquet, _("Next bouquet")),
                "prevBouquet": (self.prevBouquet, _("Previous bouquet")),
            }, -1)
        self["actions_4"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.keyCancel, _("Cancel and close")),
                "green": (self.keySave, _("Save and close")),
                "blue": (self.keyRemove, _("Remove channel")),
                "yellow": (self.tryToMatchChannels, _("Auto match")),
            }, -2)  # higher priority

        self.helpList[0][2].sort()

        self["helpActions"] = ActionMap([
            "HelpActions",
        ], {"displayHelp": self.showHelp}, 0)

        self['list'] = MatchList()
        self['list'].show()

        self.stbChlist = []
        self.webChlist = []
        self.stbToWebChlist = []

        self.bouquet = None

        self.onLayoutFinish.append(self.readChannels)
        self.onShown.append(self.showMessage)
Ejemplo n.º 32
0
 def action(self, contexts, action):
     self.box.timeout(force=True)
     return HelpableActionMap.action(self, contexts, action)
Ejemplo n.º 33
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"))
            }, -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")),
                "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)
Ejemplo n.º 34
0
    def __init__(self, session, entry=None):
        self.session = session
        Screen.__init__(self, session)

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

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

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

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

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

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.cancel, _("Cancel")),
                "green": (self.accept, _("Accept changes")),
            }, -1)
Ejemplo n.º 35
0
			def __init__(self, parent, context, actions = { }, prio=0):
				HelpableActionMap.__init__(self, parent, context, actions, prio)
				self.box = parent
Ejemplo n.º 36
0
	def __init__(self, session, *args):
		Screen.__init__(self, session)
		self.skinName = ["EPGSearch", "EPGSelection"]

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

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

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

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

		self['okactions'] = HelpableActionMap(self, 'OkCancelActions',
			{
				'cancel': (self.closeScreen, _('Exit EPG')),
				'OK': (self.epgsearchOK, _('Zap to channel (setup in menu)')),
				'OKLong': (self.epgsearchOKLong, _('Zap to channel and close (setup in menu)'))
			}, -1)
		self['okactions'].csel = self

		self['colouractions'] = HelpableActionMap(self, 'ColorActions', 
			{
				'red': (self.redButtonPressed, _('IMDB search for current event')),
				'green': (self.timerAdd, _('Add/Remove timer for current event')),
				'yellow': (self.yellowButtonPressed, _('Search for similar events')),
				'blue': (self.exportAutoTimer, _('Add a auto timer for current event')),
				'bluelong': (self.blueButtonPressed, _('Show AutoTimer List'))
			}, -1)
		self['colouractions'].csel = self

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

		self['epgactions'] = HelpableActionMap(self, 'EPGSelectActions', 
			{
				'nextBouquet': (self.nextBouquet, _('Goto next bouquet')),
				'prevBouquet': (self.prevBouquet, _('Goto previous bouquet')),
				'nextService': (self.nextService, _('Move down a page')),
				'prevService': (self.prevService, _('Move up a page')),
				'epg': (self.Info, _('Show detailed event info')),
				'info': (self.Info, _('Show detailed event info')),
				'infolong': (self.infoKeyPressed, _('Show single epg for current channel')),
				'menu': (self.menu, _('Setup menu'))
			}, -1)
		self['epgactions'].csel = self

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

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

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

		self.refreshTimer = eTimer()
		self.refreshTimer.timeout.get().append(self.refreshlist)

		# Hook up actions for yttrailer if installed
		try:
			from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
		except ImportError as ie:
			pass
		else:
			if baseEPGSelection__init__ is not None:
				self["trailerActions"] = ActionMap(["InfobarActions", "InfobarTeletextActions"],
				{
					"showTv": self.showTrailer,
					"showRadio": self.showTrailerList,
					"startTeletext": self.showConfig
				})
Ejemplo n.º 37
0
	def __init__(self, session, *args, **kwargs):
		Screen.__init__(self, session)
		self.skinName = [self.skinName, "EPGSelection"]
		if isinstance(self, HelpableScreen):
			HelpableScreen.__init__(self)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		self.searchStartTimer = eTimer()

		# Hook up actions for yttrailer if installed
		try:
			from Plugins.Extensions.YTTrailer.plugin import baseEPGSelection__init__
		except ImportError as ie:
			pass
		else:
			if baseEPGSelection__init__ is not None:
				self["trailerActions"] = ActionMap(["InfobarActions", "InfobarTeletextActions"], {
					"showTv": self.showTrailer,
					"showRadio": self.showTrailerList,
					"startTeletext": self.showConfig
				})
Ejemplo n.º 38
0
			def __init__(self, parent, context, actions = { }, prio=0):
				HelpableActionMap.__init__(self, parent, context, actions, prio)
				self.box = parent
Ejemplo n.º 39
0
	def __init__(self, session,path_left=None):
		if path_left is None:
			if os_path_isdir(config.plugins.filebrowservti.path_left.value) and config.plugins.filebrowservti.savedir_left:
				path_left = config.plugins.filebrowservti.path_left.value
			else:
				path_left = config.plugins.filebrowservti.path_default.value
			
		if os_path_isdir(config.plugins.filebrowservti.path_right.value) and config.plugins.filebrowservti.savedir_right:
			path_right = config.plugins.filebrowservti.path_right.value
		else:
			path_right = config.plugins.filebrowservti.path_default.value

		self.session = session
		Screen.__init__(self, session)
		
		# set filter
		if config.plugins.filebrowservti.extension.value == "myfilter":
			filter = "^.*\.%s" % config.plugins.filebrowservti.my_extension.value
		else:
			filter = config.plugins.filebrowservti.extension.value
			
		# set actual folder
		HelpableScreen.__init__(self)
		self["list_left_head"] = Label(path_left)
		self["list_left_head_name"] = Label()
		self["list_left_head_state"] = Label()
		self["list_right_head"] = Label(path_right)
		self["list_right_head_name"] = Label()
		self["list_right_head_state"] = Label()
		self["list_left"] = FileList(path_left, matchingPattern = filter)
		self["list_right"] = FileList(path_right, matchingPattern = filter)

		self["help"] = Label(_("Help:\nKey [0] Refresh screen.\nKey [1] New folder.\nKey [2] New symlink wit name.\nKey [3] New symlink with foldername.\nKey [4] User rights 644/755.\nKey [5] Change to default folder. \nKey [8] Toggle sort direction up, down. \nKey [9] Toggle Quick-Help. \nKey [R] Select multiple files. \nKey [OK] Play movie and music, show pictures, view/edit files, install/extract files, run scripts. \nKey [EPG] Shows tasklist. Check copy/move progress in extensions menu. \nKey [TXT] View/Edit selected file. \nKey [Help] Shows Help."))
		self["helpBack"] = Label()
		self["helpShadow"] = Label()
		self['help'].hide()
		self['helpBack'].hide()
		self['helpShadow'].hide()
		helpOn = 0
		self.helpOn = helpOn
		
		self["key_red"] = Label(_("Delete"))
		self["key_green"] = Label(_("Move"))
		self["key_yellow"] = Label(_("Copy"))
		self["key_blue"] = Label(_("Rename"))

		self["ChannelSelectBaseActions"] = HelpableActionMap(self,"ChannelSelectBaseActions",
			{
				"prevBouquet": (self.listLeft, _("Select left window")),
				"nextBouquet": (self.listRight, _("Select right window")),
				"prevMarker": self.listLeft,
				"nextMarker": self.listRight,
			}, -1)

		self["WizardActions"] = HelpableActionMap(self, "WizardActions", 
			{
				"ok": (self.ok, _("Play movie & music, show pictures, view/edit files, install/extract files, run scripts")),
				"back": (self.exit,_("Exit")),
				"up": (self.goUp, _("Selection up")),
				"down": (self.goDown, _("Selection down")),
				"left": (self.goLeft, _("Page up")),
				"right": (self.goRight, _("Page down")),
			}, -1)

		self["MenuActions"] = HelpableActionMap(self, "MenuActions", 
			{
				"menu": (self.goMenu, _("Settings")),
			}, -1)

		self["NumberActions"] = HelpableActionMap(self, "NumberActions", 
			{
				"0": (self.doRefresh, _("Refresh screen")),
				"1": (self.gomakeDir, _("New folder")),
				"2": (self.gomakeSym, _("New symlink with name")),
				"3": (self.gomakeSymlink, _("New symlink with foldername")),
				"4": (self.call_change_mode, _("User rights 644/755")),
				"5": (self.goDefaultfolder, _("Change to default folder")),
				"8": (self.sortMode, _("Toggle sort direction up, down")),
				"9": (self.QuickHelp, _("Toogle Quick-Help")),
			}, -1)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions", 
			{
				"red": (self.goRed, _("Delete")),
				"green": (self.goGreen, _("Move")),
				"yellow": (self.goYellow, _("Copy")),
				"blue": (self.goBlue, _("Rename")),
			}, -1)

		self["TimerEditActions"] = HelpableActionMap(self, "TimerEditActions", 
			{
				"eventview": (self.openTasklist, _("Show tasklist. Check copy/move progress in extensions menu")),
			}, -1)

		self["InfobarTeletextActions"] = HelpableActionMap(self, "InfobarTeletextActions", 
			{
				"startTeletext": (self.file_viewer, _("View/Edit files")),
			}, -1)

		self["InfobarActions"] = HelpableActionMap(self, "InfobarActions", 
			{
				"showMovies": (self.listSelect,  _("Multiselection list")),
			}, -1)

		if config.plugins.filebrowservti.path_left_selected:
			self.onLayoutFinish.append(self.listLeft)
		else:
			self.onLayoutFinish.append(self.listRight)

		self.onLayoutFinish.append(self.onLayout)
Ejemplo n.º 40
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 % (config.misc.graph_mepg.roundTo.getValue() * 60)
		self.closeRecursive = False
		self["key_red"] = Button("")
		self["key_green"] = Button("")
		self["key_yellow"] = Button("")
		self["key_blue"] = Button(_("Goto"))

		self.key_green_choice = self.EMPTY
		self.key_red_choice = self.EMPTY
		self["timeline_text"] = TimelineText()
		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, _("Show detailed event info"))
			}, -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")),
				"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"))
			}, -1)
		self["epgactions"].csel = self

		self["inputactions"] = HelpableActionMap(self, "InputActions",
			{
				"left":  (self.leftPressed,  _("Goto previous event")),
				"right": (self.rightPressed, _("Goto 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")),
				"7":     (self.prevPage,     _("Goto previous page of service")),
				"9":     (self.nextPage,     _("Goto next page of service")),
				"8":     (self.toTop,        _("Goto first service")),
				"0":     (self.toEnd,        _("Goto 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)
Ejemplo n.º 41
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 change 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 date/time")),
				"menu":	       (self.furtherOptions, _("Further Options")),
				"nextBouquet": (self.nextBouquet, self.getKeyNextBouquetHelptext),
				"prevBouquet": (self.prevBouquet, self.getKeyPrevBouquetHelptext),
				"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()