git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove unneeded code
[enigma2.git]
/
lib
/
python
/
Screens
/
EpgSelection.py
diff --git
a/lib/python/Screens/EpgSelection.py
b/lib/python/Screens/EpgSelection.py
index ffbea9a024118fe064c748ca83f387ac3c11f7b9..ef6545214787fa082f18769af0358d02c7db3c4f 100644
(file)
--- a/
lib/python/Screens/EpgSelection.py
+++ b/
lib/python/Screens/EpgSelection.py
@@
-1,22
+1,19
@@
from Screen import Screen
from Screen import Screen
+from Components.config import config, ConfigClock
from Components.Button import Button
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.Button import Button
from Components.Pixmap import Pixmap
from Components.Label import Label
-from Components.EpgList import
*
+from Components.EpgList import
EPGList, EPG_TYPE_SINGLE, EPG_TYPE_SIMILAR, EPG_TYPE_MULTI
from Components.ActionMap import ActionMap
from Components.ActionMap import ActionMap
-from Components.ScrollLabel import ScrollLabel
from Screens.EventView import EventViewSimple
from TimeDateInput import TimeDateInput
from Screens.EventView import EventViewSimple
from TimeDateInput import TimeDateInput
-from enigma import eServiceReference, eServiceEventPtr
-from Screens.FixedMenu import FixedMenu
+from enigma import eServiceReference
from RecordTimer import RecordTimerEntry, parseEvent
from RecordTimer import RecordTimerEntry, parseEvent
-from TimerEdit import TimerEditList
from TimerEntry import TimerEntry
from ServiceReference import ServiceReference
from TimerEntry import TimerEntry
from ServiceReference import ServiceReference
-from Components.config import config, currentConfigSelectionElement
from time import localtime, time
from time import localtime, time
-import xml.dom.minidom
+mepg_config_initialized = False
class EPGSelection(Screen):
def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None):
class EPGSelection(Screen):
def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None):
@@
-60,11
+57,7
@@
class EPGSelection(Screen):
self["key_green"] = Button(_("Add timer"))
self["list"] = EPGList(type = self.type, selChangedCB = self.onSelectionChanged, timer = self.session.nav.RecordTimer)
self["key_green"] = Button(_("Add timer"))
self["list"] = EPGList(type = self.type, selChangedCB = self.onSelectionChanged, timer = self.session.nav.RecordTimer)
- class ChannelActionMap(ActionMap):
- def action(self, contexts, action):
- return ActionMap.action(self, contexts, action)
-
- self["actions"] = ChannelActionMap(["EPGSelectActions", "OkCancelActions"],
+ self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions"],
{
"cancel": self.closeScreen,
"ok": self.eventSelected,
{
"cancel": self.closeScreen,
"ok": self.eventSelected,
@@
-91,7
+84,11
@@
class EPGSelection(Screen):
def enterDateTime(self):
if self.type == EPG_TYPE_MULTI:
def enterDateTime(self):
if self.type == EPG_TYPE_MULTI:
- self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput)
+ global mepg_config_initialized
+ if not mepg_config_initialized:
+ config.misc.prev_mepg_time=ConfigClock(default = time())
+ mepg_config_initialized = True
+ self.session.openWithCallback(self.onDateTimeInputClosed, TimeDateInput, config.misc.prev_mepg_time )
def onDateTimeInputClosed(self, ret):
if len(ret) > 1:
def onDateTimeInputClosed(self, ret):
if len(ret) > 1:
@@
-103,13
+100,9
@@
class EPGSelection(Screen):
self.close(self.closeRecursive)
def infoKeyPressed(self):
self.close(self.closeRecursive)
def infoKeyPressed(self):
- if self.type == EPG_TYPE_MULTI or self.type == EPG_TYPE_SIMILAR:
- cur = self["list"].getCurrent()
- event = cur[0]
- service = cur[1]
- else:
- event = self["list"].getCurrent()
- service = self.currentService
+ cur = self["list"].getCurrent()
+ event = cur[0]
+ service = cur[1]
if event is not None:
if self.type != EPG_TYPE_SIMILAR:
self.session.open(EventViewSimple, event, service, self.eventViewCallback, self.openSimilarList)
if event is not None:
if self.type != EPG_TYPE_SIMILAR:
self.session.open(EventViewSimple, event, service, self.eventViewCallback, self.openSimilarList)
@@
-126,15
+119,12
@@
class EPGSelection(Screen):
#just used in multipeg
def onCreate(self):
l = self["list"]
#just used in multipeg
def onCreate(self):
l = self["list"]
+ l.recalcEntrySize()
if self.type == EPG_TYPE_MULTI:
if self.type == EPG_TYPE_MULTI:
- l.recalcEntrySize()
l.fillMultiEPG(self.services, self.ask_time)
elif self.type == EPG_TYPE_SINGLE:
l.fillMultiEPG(self.services, self.ask_time)
elif self.type == EPG_TYPE_SINGLE:
- if SINGLE_CPP == 0:
- l.recalcEntrySize()
l.fillSingleEPG(self.currentService)
else:
l.fillSingleEPG(self.currentService)
else:
- l.recalcEntrySize()
l.fillSimilarList(self.currentService, self.eventid)
def eventViewCallback(self, setEvent, setService, val):
l.fillSimilarList(self.currentService, self.eventid)
def eventViewCallback(self, setEvent, setService, val):
@@
-145,14
+135,11
@@
class EPGSelection(Screen):
elif val == +1:
self.moveDown()
cur = l.getCurrent()
elif val == +1:
self.moveDown()
cur = l.getCurrent()
- if self.type == EPG_TYPE_
SINGLE
:
- se
tEvent(cur
)
+ if self.type == EPG_TYPE_
MULTI and cur[0] is None and cur[1].ref != old[1].ref
:
+ se
lf.eventViewCallback(setEvent, setService, val
)
else:
else:
- if self.type == EPG_TYPE_MULTI and cur[0] is None and cur[1].ref != old[1].ref:
- self.eventViewCallback(setEvent, setService, val)
- else:
- setService(cur[1])
- setEvent(cur[0])
+ setService(cur[1])
+ setEvent(cur[0])
def zapTo(self): # just used in multiepg
if self.zapFunc and self["key_red"].getText() == "Zap":
def zapTo(self): # just used in multiepg
if self.zapFunc and self["key_red"].getText() == "Zap":
@@
-175,13
+162,9
@@
class EPGSelection(Screen):
self["list"].updateMultiEPG(1)
def timerAdd(self):
self["list"].updateMultiEPG(1)
def timerAdd(self):
- if self.type == EPG_TYPE_SINGLE:
- event = self["list"].getCurrent()
- serviceref = self.currentService
- else:
- cur = self["list"].getCurrent()
- event = cur[0]
- serviceref = cur[1]
+ cur = self["list"].getCurrent()
+ event = cur[0]
+ serviceref = cur[1]
if event is None:
return
newEntry = RecordTimerEntry(serviceref, checkOldTimers = True, *parseEvent(event))
if event is None:
return
newEntry = RecordTimerEntry(serviceref, checkOldTimers = True, *parseEvent(event))