X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/bf32c388285065d3e9024cc8181c737e621efadf..fe0d65abf126e400bd20a51aa96dd532b03efd3d:/lib/python/Screens/EpgSelection.py diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py index 3103bfa7..a2c31d26 100644 --- a/lib/python/Screens/EpgSelection.py +++ b/lib/python/Screens/EpgSelection.py @@ -3,21 +3,16 @@ from Components.config import config, ConfigClock 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.ScrollLabel import ScrollLabel from Screens.EventView import EventViewSimple from TimeDateInput import TimeDateInput from enigma import eServiceReference -from Screens.FixedMenu import FixedMenu from RecordTimer import RecordTimerEntry, parseEvent -from TimerEdit import TimerEditList from TimerEntry import TimerEntry from ServiceReference import ServiceReference from time import localtime, time -import xml.dom.minidom - mepg_config_initialized = False class EPGSelection(Screen): @@ -41,6 +36,8 @@ class EPGSelection(Screen): self["key_blue"] = Button() self.currentService=ServiceReference(service) self.zapFunc = None + self.sort_type = 0 + self.setSortDescription() else: self.skinName = "EPGSelectionMulti" self.type = EPG_TYPE_MULTI @@ -62,11 +59,7 @@ class EPGSelection(Screen): 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, @@ -165,6 +158,21 @@ class EPGSelection(Screen): def yellowButtonPressed(self): if self.type == EPG_TYPE_MULTI: self["list"].updateMultiEPG(-1) + elif self.type == EPG_TYPE_SINGLE: + if self.sort_type == 0: + self.sort_type = 1 + else: + self.sort_type = 0 + self["list"].sortSingleEPG(self.sort_type) + self.setSortDescription() + + def setSortDescription(self): + if self.sort_type == 1: + # TRANSLATORS: This must fit into the header button in the EPG-List + self["key_yellow"].setText(_("Sort Time")) + else: + # TRANSLATORS: This must fit into the header button in the EPG-List + self["key_yellow"].setText(_("Sort A-Z")) def blueButtonPressed(self): if self.type == EPG_TYPE_MULTI: