def mainMenu(self):
print "loading mainmenu XML..."
- menu = mdom.childNodes[0]
- assert menu.tagName == "menu", "root element in menu must be 'menu'!"
+ menu = mdom.getroot()
+ assert menu.tag == "menu", "root element in menu must be 'menu'!"
self.session.infobar = self
# so we can access the currently active infobar from screens opened from within the mainmenu
# at the moment used from the SubserviceSelection
- self.session.openWithCallback(self.mainMenuClosed, MainMenu, menu, menu.childNodes)
+ self.session.openWithCallback(self.mainMenuClosed, MainMenu, menu)
def mainMenuClosed(self, *val):
self.session.infobar = None
self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions",
{
"showEventInfo": (self.openEventView, _("show EPG...")),
- "showSingleServiceEPG": (self.openSingleServiceEPG, _("show single service EPG...")),
+ "showEventInfoPlugin": (self.showEventInfoPlugins, _("show single service EPG...")),
"showInfobarOrEpgWhenInfobarAlreadyVisible": self.showEventInfoWhenNotVisible,
})
ref=self.session.nav.getCurrentlyPlayingServiceReference()
self.session.open(EPGSelection, ref)
+ def showEventInfoPlugins(self):
+ list = []
+ for p in plugins.getPlugins(where = PluginDescriptor.WHERE_EVENTINFO):
+ list.append((p.name, boundFunction(self.runPlugin, p)))
+ if len(list):
+ list.append((_("show single service EPG..."), self.openSingleServiceEPG))
+ self.session.openWithCallback(self.EventInfoPluginChosen, ChoiceBox, title=_("Please choose an extension..."), list = list)
+ else:
+ self.openSingleServiceEPG()
+
+ def runPlugin(self, plugin):
+ plugin(session = self.session, servicelist = self.servicelist)
+
+ def EventInfoPluginChosen(self, answer):
+ if answer is not None:
+ answer[1]()
+
def openSimilarList(self, eventid, refstr):
self.session.open(EPGSelection, refstr, None, eventid)
from Tools.BoundFunction import boundFunction
# depends on InfoBarExtensions
-from Components.PluginComponent import plugins
class InfoBarPlugins:
def __init__(self):
self.session.openWithCallback(self.JobViewCB, JobView, job)
def JobViewCB(self, in_background):
- from Screens.TaskView import JobView
job_manager.in_background = in_background
# depends on InfoBarExtensions
except:
pass
- begin = time()
- end = time() + 3600 * 24 * 365 * 1 # 1 year
+ begin = int(time())
+ end = begin + 3600 * 24 * 365 * 1 # 1 year
name = "instant record"
description = ""
eventid = None
localendtime = localtime(ret[1])
print "stopping recording at", strftime("%c", localendtime)
if self.recording[self.selectedEntry].end != ret[1]:
- recording.autoincrease = False
+ self.recording[self.selectedEntry].autoincrease = False
self.recording[self.selectedEntry].end = ret[1]
self.session.nav.RecordTimer.timeChanged(self.recording[self.selectedEntry])
if value is not None:
print "stopping recording after", int(value), "minutes."
if int(value) != 0:
- recording.autoincrease = False
- self.recording[self.selectedEntry].end = time() + 60 * int(value)
+ self.recording[self.selectedEntry].autoincrease = False
+ self.recording[self.selectedEntry].end = int(time()) + 60 * int(value)
self.session.nav.RecordTimer.timeChanged(self.recording[self.selectedEntry])
def instantRecord(self):