diff options
| -rwxr-xr-x | data/setup.xml | 1 | ||||
| -rw-r--r-- | lib/python/Components/UsageConfig.py | 2 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py | 40 | ||||
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/Hotplug/plugin.py | 10 | ||||
| -rw-r--r-- | lib/python/Screens/AudioSelection.py | 22 | ||||
| -rw-r--r-- | lib/python/Screens/ChannelSelection.py | 18 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBarGenerics.py | 23 | ||||
| -rw-r--r-- | lib/service/event.cpp | 4 |
8 files changed, 104 insertions, 16 deletions
diff --git a/data/setup.xml b/data/setup.xml index 5f7cbf60..86207094 100755 --- a/data/setup.xml +++ b/data/setup.xml @@ -28,6 +28,7 @@ <item level="2" text="Load Length of Movies in Movielist">config.usage.load_length_of_movies_in_moviellist</item> <item level="1" text="Show positioner movement">config.usage.showdish</item> <item level="1" text="Enable multiple bouquets">config.usage.multibouquet</item> + <item level="1" text="Multi-EPG bouquet selection">config.usage.multiepg_ask_bouquet</item> <item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item> <item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item> <item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item> diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index acbc3425..ce56f0f6 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -9,6 +9,8 @@ def InitUsageConfig(): config.usage = ConfigSubsection(); config.usage.showdish = ConfigYesNo(default = True) config.usage.multibouquet = ConfigYesNo(default = False) + config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False) + config.usage.quickzap_bouquet_change = ConfigYesNo(default = False) config.usage.e1like_radio_mode = ConfigYesNo(default = False) config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [ diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py index bcc7b9b2..af14578a 100644 --- a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py +++ b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py @@ -1,8 +1,9 @@ from Plugins.Plugin import PluginDescriptor from GraphMultiEpg import GraphMultiEPG -from Screens.ChannelSelection import BouquetSelector +from Screens.ChannelSelection import BouquetSelector, SilentBouquetSelector from enigma import eServiceCenter, eServiceReference from ServiceReference import ServiceReference +from Components.config import config Session = None Servicelist = None @@ -73,6 +74,32 @@ def changeBouquetCB(direction, epg): epg_bouquet = bouquet epg.setServices(services) +def openAskBouquet(Session, bouquets, cnt): + if cnt > 1: # show bouquet list + global bouquetSel + bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True) + dlg_stack.append(bouquetSel) + elif cnt == 1: + if not openBouquetEPG(bouquets[0][1]): + cleanup() + +def openSilent(Servicelist, bouquets, cnt): + root = Servicelist.getRoot() + if cnt > 1: # create bouquet list + global bouquetSel + current = 0 + rootstr = root.toCompareString() + for bouquet in bouquets: + if bouquet[1].toCompareString() == rootstr: + break + current += 1 + if current >= cnt: + current = 0 + bouquetSel = SilentBouquetSelector(bouquets, True, current) + if cnt >= 1: # open current bouquet + if not openBouquetEPG(root): + cleanup() + def main(session, servicelist, **kwargs): global Session Session = session @@ -83,13 +110,10 @@ def main(session, servicelist, **kwargs): cnt = 0 else: cnt = len(bouquets) - if cnt > 1: # show bouquet list - global bouquetSel - bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True) - dlg_stack.append(bouquetSel) - elif cnt == 1: - if not openBouquetEPG(bouquets[0][1]): - cleanup() + if config.usage.multiepg_ask_bouquet.value: + openAskBouquet(session, bouquets, cnt) + else: + openSilent(servicelist, bouquets, cnt) def Plugins(**kwargs): name = _("Graphical Multi EPG") diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py index 84cbbcb6..e26a93c6 100644 --- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py @@ -50,12 +50,12 @@ IOC_TYPESHIFT = (IOC_NRSHIFT+IOC_NRBITS) BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT)) def autostart(reason, **kwargs): + global bdpoll if reason == 0: print "starting hotplug handler" if fileExists('/dev/.udev'): global netlink - global bdpoll from enigma import eSocketNotifier, eTimer, ePythonMessagePump import socket from select import POLLIN, POLLPRI @@ -256,6 +256,8 @@ def autostart(reason, **kwargs): self.__lock.release() netlink = Netlink() + if bdpoll is not None: + bdpoll.running = False bdpoll = BDPoll() for blockdev, removable, is_cdrom, medium_found in harddiskmanager.devices_scanned_on_init: if removable or is_cdrom: @@ -295,6 +297,12 @@ def autostart(reason, **kwargs): factory = Factory() factory.protocol = Hotplug reactor.listenUNIX("/tmp/hotplug.socket", factory) + else: + if bdpoll: + bdpoll.running = False + bdpoll.timeout() # XXX: I assume the timer is shut down before it executes again, so release the semaphore manually + bdpoll.join() + bdpoll = None def Plugins(**kwargs): return PluginDescriptor(name = "Hotplug", description = "listens to hotplug events", where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = True, fnc = autostart) diff --git a/lib/python/Screens/AudioSelection.py b/lib/python/Screens/AudioSelection.py index 4c689620..a5e09c0b 100644 --- a/lib/python/Screens/AudioSelection.py +++ b/lib/python/Screens/AudioSelection.py @@ -1,6 +1,6 @@ from Screen import Screen from Components.ServiceEventTracker import ServiceEventTracker -from Components.ActionMap import ActionMap +from Components.ActionMap import NumberActionMap from Components.ConfigList import ConfigListScreen from Components.ChoiceList import ChoiceList, ChoiceEntryComponent from Components.config import config, ConfigSubsection, getConfigListEntry, ConfigNothing, ConfigSelection, ConfigOnOff @@ -36,7 +36,7 @@ class AudioSelection(Screen, ConfigListScreen): self.cached_subtitle_checked = False self.__selected_subtitle = None - self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"], + self["actions"] = NumberActionMap(["ColorActions", "SetupActions", "DirectionActions"], { "red": self.keyRed, "green": self.keyGreen, @@ -46,6 +46,15 @@ class AudioSelection(Screen, ConfigListScreen): "cancel": self.cancel, "up": self.keyUp, "down": self.keyDown, + "1": self.keyNumberGlobal, + "2": self.keyNumberGlobal, + "3": self.keyNumberGlobal, + "4": self.keyNumberGlobal, + "5": self.keyNumberGlobal, + "6": self.keyNumberGlobal, + "7": self.keyNumberGlobal, + "8": self.keyNumberGlobal, + "9": self.keyNumberGlobal, }, -2) self.settings = ConfigSubsection() @@ -87,7 +96,7 @@ class AudioSelection(Screen, ConfigListScreen): self["key_green"].setBoolean(False) selectedAudio = self.audioTracks.getCurrentTrack() for x in range(n): - number = str(x) + number = str(x + 1) i = audio.getTrackInfo(x) languages = i.getLanguage().split('/') description = i.getDescription() or _("<unknown>") @@ -289,11 +298,16 @@ class AudioSelection(Screen, ConfigListScreen): elif self.focus == FOCUS_STREAMS: self["streams"].selectNext() + def keyNumberGlobal(self, number): + if number <= len(self["streams"].list): + self["streams"].setIndex(number-1) + self.keyOk() + def keyOk(self): if self.focus == FOCUS_STREAMS and self["streams"].list: cur = self["streams"].getCurrent() if self.settings.menupage.getValue() == PAGE_AUDIO and cur[0] is not None: - self.changeAudio(cur[2]) + self.changeAudio(cur[0]) self.__updatedInfo() if self.settings.menupage.getValue() == PAGE_SUBTITLES and cur[0] is not None: if self.infobar.selected_subtitle == cur[0]: diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index c07e3495..912d6784 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -65,6 +65,24 @@ class BouquetSelector(Screen): def cancelClick(self): self.close(False) +class SilentBouquetSelector: + def __init__(self, bouquets, enableWrapAround=False, current=0): + self.bouquets = [b[1] for b in bouquets] + self.pos = current + self.count = len(bouquets) + self.enableWrapAround = enableWrapAround + + def up(self): + if self.pos > 0 or self.enableWrapAround: + self.pos = (self.pos - 1) % self.count + + def down(self): + if self.pos < (self.count - 1) or self.enableWrapAround: + self.pos = (self.pos + 1) % self.count + + def getCurrent(self): + return self.bouquets[self.pos] + # csel.bouquet_mark_edit values OFF = 0 EDIT_BOUQUET = 1 diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 2e97b59d..93a47886 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -1,4 +1,4 @@ -from ChannelSelection import ChannelSelection, BouquetSelector +from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector from Components.ActionMap import ActionMap, HelpableActionMap from Components.ActionMap import NumberActionMap @@ -559,6 +559,12 @@ class InfoBarEPG: cnt = 0 else: cnt = len(bouquets) + if config.usage.multiepg_ask_bouquet.value: + self.openMultiServiceEPGAskBouquet(bouquets, cnt, withCallback) + else: + self.openMultiServiceEPGSilent(bouquets, cnt, withCallback) + + def openMultiServiceEPGAskBouquet(self, bouquets, cnt, withCallback): if cnt > 1: # show bouquet list if withCallback: self.bouquetSel = self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True) @@ -568,6 +574,21 @@ class InfoBarEPG: elif cnt == 1: self.openBouquetEPG(bouquets[0][1], withCallback) + def openMultiServiceEPGSilent(self, bouquets, cnt, withCallback): + root = self.servicelist.getRoot() + rootstr = root.toCompareString() + current = 0 + for bouquet in bouquets: + if bouquet[1].toCompareString() == rootstr: + break + current += 1 + if current >= cnt: + current = 0 + if cnt > 1: # create bouquet list for bouq+/- + self.bouquetSel = SilentBouquetSelector(bouquets, True, self.servicelist.getBouquetNumOffset(root)) + if cnt >= 1: + self.openBouquetEPG(root, withCallback) + def changeServiceCB(self, direction, epg): if self.serviceSel: if direction > 0: diff --git a/lib/service/event.cpp b/lib/service/event.cpp index 949e150a..2a4cb0d1 100644 --- a/lib/service/event.cpp +++ b/lib/service/event.cpp @@ -86,7 +86,7 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang, int tsidonid) int table=encodingHandler.getCountryCodeDefaultMapping(cc); if (lang.empty()) lang = cc; // use first found language - if (cc == lang) + if (!strncasecmp(lang.c_str(), cc.c_str(), 3)) { m_event_name = convertDVBUTF8(replace_all(replace_all(sed->getEventName(), "\n", " "), "\t", " "), table, tsidonid); m_short_description = convertDVBUTF8(sed->getText(), table, tsidonid); @@ -101,7 +101,7 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang, int tsidonid) int table=encodingHandler.getCountryCodeDefaultMapping(cc); if (lang.empty()) lang = cc; // use first found language - if (cc == lang) + if (!strncasecmp(lang.c_str(), cc.c_str(), 3)) { m_extended_description += convertDVBUTF8(eed->getText(), table, tsidonid); retval=1; |
