return res
class ChoiceList(MenuList, HTMLComponent, GUIComponent):
- def __init__(self, list):
+ def __init__(self, list, selection = 0):
GUIComponent.__init__(self)
self.l = eListboxPythonMultiContent()
self.list = list
self.l.setList(list)
self.l.setFont(0, gFont("Regular", 20))
+ self.selection = selection
GUI_WIDGET = eListbox
def postWidgetCreate(self, instance):
instance.setContent(self.l)
instance.setItemHeight(25)
+ self.moveToIndex(self.selection)
import os
class ChoiceBox(Screen):
- def __init__(self, session, title = "", list = [], keys = None):
+ def __init__(self, session, title = "", list = [], keys = None, selection = 0):
Screen.__init__(self, session)
self["text"] = Label(title)
if self.keys[pos] != "":
self.keymap[self.keys[pos]] = list[pos]
pos += 1
- self["list"] = ChoiceList(self.list)
+ self["list"] = ChoiceList(list = self.list, selection = selection)
self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions"],
{
if n > 0:
self.session.open(AudioSelection, audio)
-from Screens.SubserviceSelection import SubserviceSelection
-
class InfoBarSubserviceSelection:
def __init__(self):
self["SubserviceSelectionAction"] = HelpableActionMap(self, "InfobarSubserviceSelectionActions",
def subserviceSelection(self):
service = self.session.nav.getCurrentService()
subservices = service.subServices()
+
n = subservices.getNumberOfSubservices()
+ selection = 0
if n > 0:
- self.session.openWithCallback(self.subserviceSelected, SubserviceSelection, subservices)
+ ref = self.session.nav.getCurrentlyPlayingServiceReference()
+ tlist = []
+ for x in range(n):
+ i = subservices.getSubservice(x)
+ if i.toString() == ref.toString():
+ selection = x
+ tlist.append((i.getName(), i))
+
+ self.session.openWithCallback(self.subserviceSelected, ChoiceBox, title=_("Please select a subservice..."), list = tlist, selection = selection)
def subserviceSelected(self, service):
if not service is None:
- self.session.nav.playService(service)
+ self.session.nav.playService(service[1])
class InfoBarAdditionalInfo:
def __init__(self):
Satconfig.py ScanSetup.py NetworkSetup.py Ci.py TimerEntry.py Volume.py \
EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \
AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
- Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
+ Dish.py LanguageSelection.py StartWizard.py \
TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \
MediaPlayer.py TimerSelection.py PictureInPicture.py TimeDateInput.py
from Components.NimManager import nimmanager
from Components.Label import Label
from Components.Pixmap import Pixmap
-from Screens.SubserviceSelection import SubserviceSelection
from Screens.MessageBox import MessageBox
+from Screens.ChoiceBox import ChoiceBox
from RecordTimer import AFTEREVENT
from enigma import eEPGCache
import time
if self.timer.eit is not None:
event = eEPGCache.getInstance().lookupEventId(self.timer.service_ref.ref, self.timer.eit)
if event is not None:
- if event.getNumOfLinkageServices() > 0:
- self.session.openWithCallback(self.subserviceSelected, SubserviceSelection, event, self.timer.service_ref.ref)
+ n = event.getNumOfLinkageServices()
+ if n > 0:
+ tlist = []
+ ref = self.session.nav.getCurrentlyPlayingServiceReference()
+ parent = self.timer.service_ref.ref
+ for x in range(n):
+ i = event.getLinkageService(parent, x)
+ if i.toString() == ref.toString():
+ selection = x
+ tlist.append((i.getName(), i))
+ self.session.openWithCallback(self.subserviceSelected, ChoiceBox, title=_("Please select a subservice to record..."), list = tlist, selection = selection)
return
self.close((True, self.timer))
def subserviceSelected(self, service):
if not service is None:
- self.timer.service_ref = ServiceReference(service)
+ self.timer.service_ref = ServiceReference(service[1])
self.close((True, self.timer))
def keyCancel(self):
"TimerEdit", "Setup", "HarddiskSetup", "FixedMenu",
"Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py",
"EpgSelection", "EventView", "Standby", "ServiceInfo",
- "AudioSelection", "SubserviceSelection", "InfoBarGenerics", "HelpMenu", "Wizard",
+ "AudioSelection", "InfoBarGenerics", "HelpMenu", "Wizard",
"PVRState", "Console", "InputBox", "ChoiceBox", "SimpleSummary",
"TimerSelection" ]