update dm7080 hardware drivers (frontend / demux was broken in 20170409)
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-4.3.1r1 / 0009-ScanSetup-cosmetical-changes.patch
1 From 5fc073ef7bcc8e8811390fbd30e6350cbdd54d93 Mon Sep 17 00:00:00 2001
2 From: ghost <andreas.monzner@dream-property.net>
3 Date: Tue, 28 Mar 2017 13:22:40 +0200
4 Subject: [PATCH 9/9] ScanSetup: cosmetical changes - try to hold scan type on
5  tuner system change when possible - only show DVB-S/DVB-S2 and DVB-T/DVB-T2
6  when needed (single transponder search)
7
8 ---
9  usr/lib/enigma2/python/Screens/ScanSetup.py | 49 ++++++++++++++++++++++++++++++++++++-----
10  1 file changed, 43 insertions(+), 6 deletions(-)
11
12 diff --git a/usr/lib/enigma2/python/Screens/ScanSetup.py b/usr/lib/enigma2/python/Screens/ScanSetup.py
13 index 8e9ce7b..8442bcf 100644
14 --- a/usr/lib/enigma2/python/Screens/ScanSetup.py
15 +++ b/usr/lib/enigma2/python/Screens/ScanSetup.py
16 @@ -1265,6 +1265,11 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
17                 if self.scan_nims == [ ]:
18                         return
19  
20 +               try:
21 +                       oldTypeOfScan = self.typeOfScanEntry[1].value
22 +               except:
23 +                       oldTypeOfScan = None
24 +
25                 self.typeOfScanEntry = None
26                 self.plpidAutoEntry = None
27                 self.fecEntry = None
28 @@ -1283,6 +1288,25 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
29                         self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_typeterrestrial)
30                         self.list.append(self.typeOfScanEntry)
31  
32 +               # try to use the same scan type after system change
33 +               current = self.typeOfScanEntry[1].value
34 +               if oldTypeOfScan and current != oldTypeOfScan:
35 +                       # we map complete to multisat_yes and vice versa
36 +                       if oldTypeOfScan == "complete" and self.scan_system.value in ("DVB-S", "DVB-S2"):
37 +                               oldTypeOfScan = "multisat_yes"
38 +                       elif oldTypeOfScan == "multisat_yes" and self.scan_system.value in ("DVB-T", "DVB-T2", "DVB-C"):
39 +                               oldTypeOfScan = "complete"
40 +                       choices = self.typeOfScanEntry[1].getChoices()
41 +                       for ch in choices:
42 +                               if ch[0] == oldTypeOfScan:
43 +                                       self.typeOfScanEntry[1].value = oldTypeOfScan
44 +                                       break
45 +
46 +               if self.typeOfScanEntry[1].value == 'single_transponder':
47 +                       self.scan_system.setChoices(self.systems)
48 +               else:
49 +                       self.scan_system.setChoices(self.systems_filtered)
50 +
51                 if len(self.scan_system.getChoices()) > 1:
52                         self.systemEntry = getConfigListEntry(_('System'), self.scan_system)
53                         self.list.append(self.systemEntry)
54 @@ -1403,10 +1427,10 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
55                         pass
56                 elif cur == self.typeOfScanEntry or \
57                         cur == self.tunerEntry or \
58 -                       cur == self.systemEntry or \
59 -                       (self.modulationEntry and self.systemEntry[1].value == "DVB-S2" and cur == self.modulationEntry) or \
60 +                       (self.systemEntry and cur == self.systemEntry) or \
61 +                       (self.modulationEntry and cur == self.modulationEntry) or \
62                         (self.satelliteEntry and cur == self.satelliteEntry) or \
63 -                       (self.plpidAutoEntry and self.systemEntry[1].value == "DVB-T2" and cur == self.plpidAutoEntry):
64 +                       (self.plpidAutoEntry and cur == self.plpidAutoEntry):
65                         self.createSetup()
66  
67         def nimChanged(self, configElement):
68 @@ -1415,20 +1439,33 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
69                 nim = nimmanager.nim_slots[nim_idx]
70  
71                 systems = [ ]
72 +               systems_filtered = [ ]
73                 if 'S' in self.systems_enabled:
74 -                       if nim.isEnabled("DVB-S2"):
75 +                       s2_en = nim.isEnabled("DVB-S2")
76 +                       if s2_en:
77                                 systems.append(("DVB-S2", _("DVB-S2")))
78 +                               systems_filtered.append(("DVB-S2", _("DVB-S2")))
79                         if nim.isEnabled("DVB-S"):
80                                 systems.append(("DVB-S", _("DVB-S")))
81 +                               if not s2_en:
82 +                                       systems_filtered.append(("DVB-S", _("DVB-S")))
83  
84                 if 'C' in self.systems_enabled and nim.isEnabled("DVB-C"):
85                         systems.append(("DVB-C", _("DVB-C")))
86 +                       systems_filtered.append(("DVB-C", _("DVB-C")))
87  
88                 if 'T' in self.systems_enabled:
89 +                       t2_en = nim.isEnabled("DVB-T2")
90 +                       if t2_en:
91 +                               systems.append(("DVB-T2", _("DVB-T2")))
92 +                               systems_filtered.append(("DVB-T2", _("DVB-T2")))
93                         if nim.isEnabled("DVB-T"):
94                                 systems.append(("DVB-T", _("DVB-T")))
95 -                       if nim.isEnabled("DVB-T2"):
96 -                               systems.append(("DVB-T2", _("DVB-T2")))
97 +                               if not t2_en:
98 +                                       systems_filtered.append(("DVB-T", _("DVB-T")))
99 +
100 +               self.systems = systems
101 +               self.systems_filtered = systems_filtered
102  
103                 # for compability with old plugins...
104                 self.scan_sat.system = ConfigSelection(default = eDVBFrontendParametersSatellite.System_DVB_S, choices = [
105 -- 
106 2.1.4
107