import xml.dom.minidom
from Screens.MessageBox import MessageBox
+from Screens.SubserviceSelection import SubserviceSelection
import NavigationInstance
from Tools.XMLTools import elementsWithTag
description = ev.getShortDescription()
begin = ev.getBeginTime()
end = begin + ev.getDuration()
- eit = None
+ eit = ev.getEventId()
return (begin, end, name, description, eit)
class RecordTimerEntry(timer.TimerEntry):
<widget name="config" position="10,30" size="420,220" />
</screen>
<screen name="TimerEditList" position="70,100" size="560,400" title="Timer Editor">
- <widget name="timerlist" position="0,50" size="560,300" scrollbarMode="showOnDemand" />
+ <widget name="timerlist" position="0,45" size="560,350" scrollbarMode="showOnDemand" />
<widget name="key_red" position="0,0" size="140,40" backgroundColor="red" font="Regular;21" />
<widget name="key_green" position="140,0" size="140,40" backgroundColor="green" font="Regular;21" />
<widget name="key_yellow" position="280,0" size="140,40" backgroundColor="yellow" font="Regular;21" />
def TimerEntryComponent(timer, processed):
res = [ timer ]
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 220, 30, 0, RT_HALIGN_LEFT, timer.service_ref.getServiceName()))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 560, 30, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, timer.service_ref.getServiceName()))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 560, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, timer.name))
+
repeatedtext = ""
days = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ]
if (timer.repeated != 0):
repeatedtext += days[x]
count += 1
flags = flags >> 1
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 300, 20, 1, RT_HALIGN_LEFT, repeatedtext + (" %s ... %s" % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1]))))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, 300, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (" %s ... %s" % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1]))))
else:
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 300, 20, 1, RT_HALIGN_LEFT, repeatedtext + ("%s, %s ... %s" % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:]))))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, 300, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ("%s, %s ... %s" % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:]))))
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 240, 0, 320, 20, 1, RT_HALIGN_RIGHT, timer.name))
-
if not processed:
if timer.state == TimerEntry.StateWait:
state = "waiting"
else:
state = "done!"
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 320, 30, 240, 20, 1, RT_HALIGN_RIGHT, state))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 320, 50, 240, 20, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, state))
return res
def GUIcreate(self, parent):
self.instance = eListbox(parent)
self.instance.setContent(self.l)
- self.instance.setItemHeight(50)
+ self.instance.setItemHeight(70)
def GUIdelete(self):
self.instance.setContent(None)
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.Label import Label
-from enigma import eServiceReferencePtr, eServiceReference
+from enigma import eServiceReferencePtr, eServiceReference, iSubserviceListPtr, eServiceEventPtrPtr
class SubserviceSelection(Screen):
def KeyOk(self):
self.close(selection[1])
def Cancel(self):
self.close(None)
- def __init__(self, session, subservices):
+ def __init__(self, session, subservices, parent=None):
Screen.__init__(self, session)
self["actions"] = ActionMap(["OkCancelActions"],
self.subservices = subservices
+ print subservices
tlist = []
- n = subservices.getNumberOfSubservices()
- for x in range(n):
- i = subservices.getSubservice(x)
- tlist.append((i.getName(), i))
+ if isinstance(subservices, iSubserviceListPtr):
+ n = subservices.getNumberOfSubservices()
+ for x in range(n):
+ i = subservices.getSubservice(x)
+ tlist.append((i.getName(), i))
+ elif isinstance(subservices, eServiceEventPtrPtr):
+ n = subservices.getNumOfLinkageServices()
+ for x in range(n):
+ i = subservices.getLinkageService(parent, x)
+ tlist.append((i.getName(), i))
+ else:
+ print "unknown type of subservices"
self["subservices"] = MenuList(tlist)
from Components.NimManager import nimmanager
from Components.Label import Label
from Components.Pixmap import Pixmap
+from Screens.SubserviceSelection import SubserviceSelection
+from enigma import eEPGCache
import time
import datetime
if (config.timerentry.day[x].value == 0): self.timer.setRepeated(x)
self.timer.begin = self.getTimestamp(time.time(), config.timerentry.starttime.value)
- self.timer.end = self.getTimestamp(time.time(), config.timerentry.endtime.value)
-
+ self.timer.end = self.getTimestamp(time.time(), config.timerentry.endtime.value)
+
+ 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)
+ return
+ self.close((True, self.timer))
+
+ def subserviceSelected(self, service):
+ if not service is None:
+ self.timer.service_ref = ServiceReference(service)
self.close((True, self.timer))
def keyCancel(self):
return -1;
}
-RESULT eServiceEvent::getLinkageService(eServiceReference &service, int num) const
+RESULT eServiceEvent::getLinkageService(eServiceReference &service, eServiceReference &parent, int num) const
{
std::list<eServiceReference>::const_iterator it =
m_linkage_services.begin();
if ( it != m_linkage_services.end() )
{
service = *it;
+ eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) service;
+ eServiceReferenceDVB ¤t = (eServiceReferenceDVB&) parent;
+ subservice.setDVBNamespace(current.getDVBNamespace());
+ if ( current.getParentTransportStreamID().get() )
+ {
+ subservice.setParentTransportStreamID( current.getParentTransportStreamID() );
+ subservice.setParentServiceID( current.getParentServiceID() );
+ }
+ else
+ {
+ subservice.setParentTransportStreamID( current.getTransportStreamID() );
+ subservice.setParentServiceID( current.getServiceID() );
+ }
+ if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() &&
+ subservice.getParentServiceID() == subservice.getServiceID() )
+ {
+ subservice.setParentTransportStreamID( eTransportStreamID(0) );
+ subservice.setParentServiceID( eServiceID(0) );
+ }
return 0;
}
service.type = eServiceReference::idInvalid;
std::string getBeginTimeString() const;
SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
int getNumOfLinkageServices() const { return m_linkage_services.size(); }
- SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, int num) const;
+ SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
};
TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
eServiceReference::eServiceReference(const std::string &string)
{
const char *c=string.c_str();
- int pathl=-1;
-
+ int pathl=0;
+
if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 )
{
memset( data, 0, sizeof(data) );
}
if (pathl)
- path=c+pathl;
+ {
+ const char *pathstr = c+pathl;
+ const char *namestr = strchr(pathstr, ':');
+ if (namestr)
+ {
+ if (pathstr != namestr)
+ path.assign(pathstr, namestr-pathstr);
+ if (*(namestr+1))
+ name=namestr+1;
+ }
+ else
+ path=pathstr;
+ }
}
std::string eServiceReference::toString() const
ret += ":";
ret += getNum(flags);
for (unsigned int i=0; i<sizeof(data)/sizeof(*data); ++i)
- {
ret+=":"+ getNum(data[i], 0x10);
- }
ret+=":"+path;
+ if (name.length())
+ ret+=":"+name;
return ret;
}
ePtr<eServiceEvent> evt;
if (!m_event_handler.getEvent(evt, 0))
{
- if (!evt->getLinkageService(sub, n))
- {
- eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) sub;
- eServiceReferenceDVB ¤t = (eServiceReferenceDVB&) m_reference;
- subservice.setDVBNamespace(current.getDVBNamespace());
- if ( current.getParentTransportStreamID().get() )
- {
- subservice.setParentTransportStreamID( current.getParentTransportStreamID() );
- subservice.setParentServiceID( current.getParentServiceID() );
- }
- else
- {
- subservice.setParentTransportStreamID( current.getTransportStreamID() );
- subservice.setParentServiceID( current.getServiceID() );
- }
- if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() &&
- subservice.getParentServiceID() == subservice.getServiceID() )
- {
- subservice.setParentTransportStreamID( eTransportStreamID(0) );
- subservice.setParentServiceID( eServiceID(0) );
- }
+ if (!evt->getLinkageService(sub, m_reference, n))
return 0;
- }
}
sub.type=eServiceReference::idInvalid;
return -1;