from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Screens.ChannelSelection import SimpleChannelSelection
+from Screens.EpgSelection import EPGSelection
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
# Asking the user if this is what he wants might be better though
self.close(self.servicePath[-1])
-class AutoTimerEditorBase():
+class AutoTimerEPGSelection(EPGSelection):
+ def __init__(self, *args):
+ EPGSelection.__init__(*args)
+ self.skinName = "EPGSelection"
+
+ def infoKeyPressed(self):
+ self.timerAdd()
+
+ def timerAdd(self):
+ cur = self["list"].getCurrent()
+ evt = cur[0]
+ sref = cur[1]
+ if not evt:
+ return
+
+ addAutotimerFromEvent(self.session, evt = evt, service = sref)
+
+class AutoTimerEditorBase:
""" Base Class for all Editors """
def __init__(self, timer, editingDefaults = False):
# Keep Timer
sref = ServiceReference(service)
if evt:
- # timespan defaults to +- 1h
+ # timespan defaults to +- 1h
begin = evt.getBeginTime()-3600
end = begin + evt.getDuration()+7200
else:
from AutoTimerEditor import addAutotimerFromService
addAutotimerFromService(session, service)
+# Event Info
+def eventinfo(session, servicelist, **kwargs):
+ from AutoTimerEditor import AutoTimerEPGSelection
+ ref = session.nav.getCurrentlyPlayingServiceReference()
+ session.open(AutoTimerEPGSelection, ref)
+
def Plugins(**kwargs):
from Plugins.Plugin import PluginDescriptor
PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart),
PluginDescriptor(name="AutoTimer", description = _("Edit Timers and scan for new Events"), where = PluginDescriptor.WHERE_PLUGINMENU, icon = "plugin.png", fnc = main),
PluginDescriptor(name="AutoTimer", description = _("Edit Timers and scan for new Events"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc = main),
- PluginDescriptor(name="AutoTimer", description= _("Add AutoTimer..."), where = PluginDescriptor.WHERE_MOVIELIST, fnc = movielist)
+ PluginDescriptor(name="AutoTimer", description= _("Add AutoTimer..."), where = PluginDescriptor.WHERE_MOVIELIST, fnc = movielist),
+ PluginDescriptor(name="AutoTimer", description= _("Add AutoTimer..."), where = PluginDescriptor.WHERE_EVENTINFO, fnc = eventinfo),
]