update dm7080 hardware drivers (frontend / demux was broken in 20170409)
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-4.3.1r1 / 0007-dont-allow-to-do-anything-in-manual-automatic-scan-w.patch
1 From 2cd90a31eb6a5152dda6a1f89242449b9b72ac6a Mon Sep 17 00:00:00 2001
2 From: ghost <andreas.monzner@dream-property.net>
3 Date: Tue, 28 Mar 2017 02:05:01 +0200
4 Subject: [PATCH 7/9] dont allow to do anything in manual / automatic scan when
5  all nim slots are empty or all tuners are disabled
6
7 ---
8  usr/lib/enigma2/python/Screens/ScanSetup.py | 33 ++++++++++++++++++++-------------
9  1 file changed, 20 insertions(+), 13 deletions(-)
10
11 diff --git a/usr/lib/enigma2/python/Screens/ScanSetup.py b/usr/lib/enigma2/python/Screens/ScanSetup.py
12 index 7a93e80..8e9ce7b 100644
13 --- a/usr/lib/enigma2/python/Screens/ScanSetup.py
14 +++ b/usr/lib/enigma2/python/Screens/ScanSetup.py
15 @@ -2,7 +2,7 @@ from Screen import Screen
16  from Screens.DefaultWizard import DefaultWizard
17  from ServiceScan import ServiceScan
18  from Components.config import config, ConfigSubsection, ConfigSelection, \
19 -       ConfigYesNo, ConfigInteger, getConfigListEntry, ConfigSlider, ConfigOnOff
20 +       ConfigYesNo, ConfigInteger, getConfigListEntry, ConfigSlider, ConfigOnOff, ConfigText
21  from Components.ActionMap import NumberActionMap, ActionMap
22  from Components.ConfigList import ConfigListScreen
23  from Components.NimManager import nimmanager, getConfigSatlist
24 @@ -1283,7 +1283,7 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
25                         self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_typeterrestrial)
26                         self.list.append(self.typeOfScanEntry)
27  
28 -               if len(self.scan_type.getChoices()) > 1:
29 +               if len(self.scan_system.getChoices()) > 1:
30                         self.systemEntry = getConfigListEntry(_('System'), self.scan_system)
31                         self.list.append(self.systemEntry)
32  
33 @@ -1380,12 +1380,13 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
34                                         self.list.append(getConfigListEntry(_("Code rate HP"), base_path.crh))
35                                         self.list.append(getConfigListEntry(_("Code rate LP"), base_path.crl))
36  
37 -               self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan))
38 -               self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))
39 -               self.list.append(getConfigListEntry(_("Only Free scan"), self.scan_onlyfree))
40 -               if config.usage.setup_level.index >= 2:
41 -                       self.list.append(getConfigListEntry(_("Lookup other SDT"), self.scan_otherSDT))
42 -                       self.list.append(getConfigListEntry(_("Skip empty transponders"), self.scan_skipEmpty))
43 +               if len(self.scan_system.getChoices()) > 1:
44 +                       self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan))
45 +                       self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))
46 +                       self.list.append(getConfigListEntry(_("Only Free scan"), self.scan_onlyfree))
47 +                       if config.usage.setup_level.index >= 2:
48 +                               self.list.append(getConfigListEntry(_("Lookup other SDT"), self.scan_otherSDT))
49 +                               self.list.append(getConfigListEntry(_("Skip empty transponders"), self.scan_skipEmpty))
50                 self["config"].list = self.list
51                 self["config"].l.setList(self.list)
52  
53 @@ -1398,7 +1399,9 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
54         def newConfig(self):
55                 cur = self["config"].getCurrent()
56                 print "cur is", cur
57 -               if cur == self.typeOfScanEntry or \
58 +               if cur is None:
59 +                       pass
60 +               elif cur == self.typeOfScanEntry or \
61                         cur == self.tunerEntry or \
62                         cur == self.systemEntry or \
63                         (self.modulationEntry and self.systemEntry[1].value == "DVB-S2" and cur == self.modulationEntry) or \
64 @@ -1600,10 +1603,13 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
65                                         #  * the S2 tuner when it's connected with a S-only tuner ...
66                                         # Listing both would be required whenever non-backwards-compatible demods show up
67                                         # Currently none if the above is actually possible
68 -                               nim_list.append((str(n.slot), n.friendly_full_description, idx))
69 -                               if idx == slot_number:
70 -                                       tuned_slot = str(n.slot)
71 +                               if n.isEnabled('DVB-S') or n.isEnabled('DVB-C') or n.isEnabled('DVB-T'):
72 +                                       nim_list.append((str(n.slot), n.friendly_full_description, idx))
73 +                                       if idx == slot_number:
74 +                                               tuned_slot = str(n.slot)
75  
76 +                       if not nim_list:
77 +                               self.scan_nims = ConfigText('')
78                         if tuned_slot:
79                                 self.scan_nims = ConfigSelection(choices = nim_list, default = tuned_slot)
80                         else:
81 @@ -1835,7 +1841,8 @@ class ScanSetup(ConfigListScreen, Screen, TransponderSearchSupport, CableTranspo
82                                         self.nim_sat_band_cutoff_frequency.append(None)
83                                         self.scan_satselection.append(None)
84  
85 -                       self.scan_nims.addNotifier(self.nimChanged)
86 +                       if self.scan_nims.value != '':
87 +                               self.scan_nims.addNotifier(self.nimChanged)
88  
89                         return True
90  
91 -- 
92 2.1.4
93