-from Screen import Screen
-from Components.ActionMap import ActionMap, HelpableActionMap
-from Components.ActionMap import NumberActionMap
-from Components.Label import *
-from Components.ProgressBar import *
-from Components.config import configfile, configsequencearg
-from Components.config import config, configElement, ConfigSubsection, configSequence
from ChannelSelection import ChannelSelection, BouquetSelector
-from Components.Pixmap import Pixmap, PixmapConditional
+from Components.ActionMap import ActionMap, HelpableActionMap
+from Components.ActionMap import NumberActionMap
from Components.BlinkingPixmap import BlinkingPixmapConditional
-from Components.ServiceName import ServiceName
-from Components.EventInfo import EventInfo, EventInfoProgress
from Components.Clock import Clock
+from Components.EventInfo import EventInfo, EventInfoProgress
+from Components.Harddisk import harddiskmanager
from Components.Input import Input
+from Components.Label import *
+from Components.Pixmap import Pixmap, PixmapConditional
+from Components.PluginComponent import plugins
+from Components.ProgressBar import *
+from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceName import ServiceName
+from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean
+from Components.config import configfile, configsequencearg
-from ServiceReference import ServiceReference
from EpgSelection import EPGSelection
+from Plugins.Plugin import PluginDescriptor
-from Screens.MessageBox import MessageBox
+from Screen import Screen
from Screens.ChoiceBox import ChoiceBox
-from Screens.InputBox import InputBox
from Screens.Dish import Dish
-from Screens.Standby import Standby
from Screens.EventView import EventViewEPGSelect, EventViewSimple
+from Screens.InputBox import InputBox
+from Screens.MessageBox import MessageBox
from Screens.MinuteInput import MinuteInput
-from Components.Harddisk import harddiskmanager
-
-from Components.ServiceEventTracker import ServiceEventTracker
+from Screens.Standby import Standby
+from ServiceReference import ServiceReference
from Tools import Notifications
from Tools.Directories import *
self.servicelist.setCurrentSelection(service) #select the service in servicelist
self.servicelist.zap()
+config.misc.initialchannelselection = configElementBoolean("config.misc.initialchannelselection", 1);
+
class InfoBarChannelSelection:
""" ChannelSelection - handles the channelSelection dialog and the initial
channelChange actions which open the channelSelection dialog """
def __init__(self):
#instantiate forever
self.servicelist = self.session.instantiateDialog(ChannelSelection)
+
+ if config.misc.initialchannelselection.value == 1:
+ self.onShown.append(self.firstRun)
self["ChannelSelectActions"] = HelpableActionMap(self, "InfobarChannelSelection",
{
"historyNext": (self.historyNext, _("next channel in history"))
})
+ def firstRun(self):
+ self.onShown.remove(self.firstRun)
+ config.misc.initialchannelselection.value = 0
+ config.misc.initialchannelselection.save()
+ self.switchChannelDown()
+
def historyBack(self):
self.servicelist.historyBack()
if action[:5] == "seek:":
time = int(action[5:])
self.screen.seekRelative(time * 90000)
+ return 1
else:
- HelpableActionMap.action(self, contexts, action)
+ return HelpableActionMap.action(self, contexts, action)
self["SeekActions"] = InfoBarSeekActionMap(self, "InfobarSeekActions",
{
if seekable is not None:
seekable.seekRelative(1, diff)
-from Screens.PVRState import PVRState
+from Screens.PVRState import PVRState, TimeshiftState
class InfoBarPVRState:
- def __init__(self):
+ def __init__(self, screen=PVRState):
self.onPlayStateChanged.append(self.__playStateChanged)
- self.pvrStateDialog = self.session.instantiateDialog(PVRState)
+ self.pvrStateDialog = self.session.instantiateDialog(screen)
self.onShow.append(self.__mayShow)
self.onHide.append(self.pvrStateDialog.hide)
def __mayShow(self):
- if self.seekstate != self.SEEK_STATE_PLAY:
+ if self.seekstate != self.SEEK_STATE_PLAY and self.execing:
self.pvrStateDialog.show()
def __playStateChanged(self, state):
self.pvrStateDialog["state"].setText(playstateString)
self.__mayShow()
+class InfoBarTimeshiftState(InfoBarPVRState):
+ def __init__(self):
+ InfoBarPVRState.__init__(self, screen=TimeshiftState)
+
+
class InfoBarShowMovies:
# i don't really like this class.
self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
{
+ iPlayableService.evStart: self.__serviceStarted,
iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged
})
print "hu, timeshift already enabled?"
else:
if not ts.startTimeshift():
+ import time
self.timeshift_enabled = 1
+ self.pvrStateDialog["timeshift"].setRelative(time.time())
# PAUSE.
self.setSeekState(self.SEEK_STATE_PAUSE)
print "timeshift activate:", enabled
self["TimeshiftActivateActions"].setEnabled(enabled)
+ def __serviceStarted(self):
+ self.timeshift_enabled = False
+ self.__seekableStatusChanged()
+
from RecordTimer import parseEvent
class InfoBarInstantRecord:
class InfoBarSummary(Screen):
skin = """
<screen position="0,0" size="132,64">
- <widget name="Clock" position="50,46" size="82,18" font="Regular;19" />
- <widget name="CurrentService" position="0,4" size="132,42" font="Regular;19" />
+ <widget name="Clock" position="50,46" size="82,18" font="Regular;16" />
+ <widget name="CurrentService" position="0,4" size="132,42" font="Regular;18" />
</screen>"""
def __init__(self, session, parent):
def createSummary(self):
return InfoBarSummary
+
+class InfoBarTeletextPlugin:
+ def __init__(self):
+ self.teletext_plugin = None
+
+ for p in plugins.getPlugins(PluginDescriptor.WHERE_TELETEXT):
+ self.teletext_plugin = p
+
+ if self.teletext_plugin is not None:
+ self["TeletextActions"] = HelpableActionMap(self, "InfobarTeletextActions",
+ {
+ "startTeletext": (self.startTeletext, "View teletext...")
+ })
+ else:
+ print "no teletext plugin found!"
+
+ def startTeletext(self):
+ self.teletext_plugin(session=self.session, service=self.session.nav.getCurrentService())