[dvbapp] remove pvr active for solose & fix typo.
[vuplus_openvuplus_3.0] / meta-bsp / vusolose / recipes / vuplus / enigma2 / enigma2_vuplus_remove_pvr_action.patch
1 diff --git a/RecordTimer.py b/RecordTimer.py
2 index d3ccd75..838b18a 100755
3 --- a/RecordTimer.py
4 +++ b/RecordTimer.py
5 @@ -4,6 +4,7 @@ from enigma import eEPGCache, getBestPlayableServiceReference, \
6  from Components.config import config
7  from Components.UsageConfig import defaultMoviePath
8  from Components.TimerSanityCheck import TimerSanityCheck
9 +from Components.SystemInfo import SystemInfo
10  
11  from Screens.MessageBox import MessageBox
12  import Screens.Standby
13 @@ -114,7 +115,10 @@ class RecordTimerEntry(timer.TimerEntry, object):
14                 self.timer = None
15                 self.__record_service = None
16                 self.start_prepare = 0
17 -               self.justplay = justplay
18 +               if SystemInfo["PVRSupport"]:
19 +                       self.justplay = justplay
20 +               else:
21 +                       self.justplay = True
22                 self.afterEvent = afterEvent
23                 self.dirname = dirname
24                 self.dirnameHadToFallback = False
25 @@ -404,7 +408,10 @@ def createTimer(xml):
26         description = xml.get("description").encode("utf-8")
27         repeated = xml.get("repeated").encode("utf-8")
28         disabled = long(xml.get("disabled") or "0")
29 -       justplay = long(xml.get("justplay") or "0")
30 +       if SystemInfo["PVRSupport"]:
31 +               justplay = long(xml.get("justplay") or "0")
32 +       else:
33 +               justplay = long("1")
34         afterevent = str(xml.get("afterevent") or "nothing")
35         afterevent = {
36                 "nothing": AFTEREVENT.NONE,
37 @@ -590,7 +597,10 @@ class RecordTimer(timer.Timer):
38                         if timer.tags is not None:
39                                 list.append(' tags="' + str(stringToXML(' '.join(timer.tags))) + '"')
40                         list.append(' disabled="' + str(int(timer.disabled)) + '"')
41 -                       list.append(' justplay="' + str(int(timer.justplay)) + '"')
42 +                       if SystemInfo["PVRSupport"]:
43 +                               list.append(' justplay="' + str(int(timer.justplay)) + '"')
44 +                       else:
45 +                               list.append(' justplay="1"')
46                         list.append('>\n')
47                         
48                         if config.recording.debug.value:
49 diff --git a/data/menu.xml b/data/menu.xml
50 index 03e582c..ea225d6 100755
51 --- a/data/menu.xml
52 +++ b/data/menu.xml
53 @@ -70,7 +70,7 @@
54                                         <item level="1" text="Device Setup..." entryID="device_setup"><screen module="NetworkSetup" screen="NetworkAdapterSelection"/></item>
55                                         <item level="1" text="Nameserver Setup..." entryID="dns_setup"><screen module="NetworkSetup" screen="NameserverSetup"/></item>
56                                 </menu>-->
57 -                               <item level="2" text="Recording paths" entryId="RecordPaths"><screen module="RecordPaths" screen="RecordPathsSettings" /></item>
58 +                               <item level="2" text="Recording paths" entryId="RecordPaths" requires="PVRSupport"><screen module="RecordPaths" screen="RecordPathsSettings" /></item>
59                         </menu>
60                         <item weight="10" level="1" text="Common Interface" entryID="ci_setup" requires="CommonInterface"><screen module="Ci" screen="CiSelection" /></item>
61                         <item weight="15" level="0" text="Parental control" entryID="parental_setup"><screen module="ParentalControlSetup" screen="ParentalControlSetup" /></item>
62 diff --git a/data/setup.xml b/data/setup.xml
63 index 442fe13..e1e10dc 100755
64 --- a/data/setup.xml
65 +++ b/data/setup.xml
66 @@ -22,11 +22,11 @@
67                 </setup>
68                 <setup key="usage" title="Customize">
69                         <item level="0" text="Setup Mode">config.usage.setup_level</item>
70 -                       <item level="1" text="Recordings always have priority">config.recording.asktozap</item>
71 -                       <item level="0" text="Margin before record (minutes)">config.recording.margin_before</item>
72 -                       <item level="0" text="Margin after record">config.recording.margin_after</item>
73 -                       <item level="0" text="Show blinking clock in display during recording">config.usage.blinking_display_clock_during_recording</item>
74 -                       <item level="2" text="Show Message when Recording starts">config.usage.show_message_when_recording_starts</item>
75 +                       <item level="1" text="Recordings always have priority" requires="PVRSupport">config.recording.asktozap</item>
76 +                       <item level="0" text="Margin before record (minutes)" requires="PVRSupport">config.recording.margin_before</item>
77 +                       <item level="0" text="Margin after record" requires="PVRSupport">config.recording.margin_after</item>
78 +                       <item level="0" text="Show blinking clock in display during recording" requires="PVRSupport">config.usage.blinking_display_clock_during_recording</item>
79 +                       <item level="2" text="Show Message when Recording starts" requires="PVRSupport">config.usage.show_message_when_recording_starts</item>
80                         <item level="2" text="Load Length of Movies in Movielist">config.usage.load_length_of_movies_in_moviellist</item>
81                         <item level="1" text="Show positioner movement">config.usage.showdish</item>
82                         <item level="1" text="Enable multiple bouquets">config.usage.multibouquet</item>
83 diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py
84 index f9c4065..5817a49 100644
85 --- a/lib/python/Components/SystemInfo.py
86 +++ b/lib/python/Components/SystemInfo.py
87 @@ -1,6 +1,6 @@
88  from enigma import eDVBResourceManager
89  from Tools.Directories import fileExists
90 -from Tools.HardwareInfo import HardwareInfo
91 +from Tools.HardwareInfo import HardwareInfo, HardwareInfoVu
92  
93  SystemInfo = { }
94  
95 @@ -29,3 +29,4 @@ SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
96  SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
97  SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
98  SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
99 +SystemInfo["PVRSupport"] = HardwareInfoVu().get_device_name() != "solose"
100 diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
101 index 80cc196..68e99dc 100755
102 --- a/lib/python/Screens/InfoBarGenerics.py
103 +++ b/lib/python/Screens/InfoBarGenerics.py
104 @@ -1181,11 +1181,12 @@ class InfoBarShowMovies:
105  
106  class InfoBarTimeshift:
107         def __init__(self):
108 -               self["TimeshiftActions"] = HelpableActionMap(self, "InfobarTimeshiftActions",
109 -                       {
110 -                               "timeshiftStart": (self.startTimeshift, _("start timeshift")),  # the "yellow key"
111 -                               "timeshiftStop": (self.stopTimeshift, _("stop timeshift"))      # currently undefined :), probably 'TV'
112 -                       }, prio=1)
113 +               if SystemInfo["PVRSupport"]:
114 +                       self["TimeshiftActions"] = HelpableActionMap(self, "InfobarTimeshiftActions",
115 +                               {
116 +                                       "timeshiftStart": (self.startTimeshift, _("start timeshift")),  # the "yellow key"
117 +                                       "timeshiftStop": (self.stopTimeshift, _("stop timeshift"))      # currently undefined :), probably 'TV'
118 +                               }, prio=1)
119                 self["TimeshiftActivateActions"] = ActionMap(["InfobarTimeshiftActivateActions"],
120                         {
121                                 "timeshiftActivateEnd": self.activateTimeshiftEnd, # something like "rewind key"
122 @@ -1501,10 +1502,11 @@ class InfoBarInstantRecord:
123         """Instant Record - handles the instantRecord action in order to
124         start/stop instant records"""
125         def __init__(self):
126 -               self["InstantRecordActions"] = HelpableActionMap(self, "InfobarInstantRecord",
127 -                       {
128 -                               "instantRecord": (self.instantRecord, _("Instant Record...")),
129 -                       })
130 +               if SystemInfo["PVRSupport"]:
131 +                       self["InstantRecordActions"] = HelpableActionMap(self, "InfobarInstantRecord",
132 +                               {
133 +                                       "instantRecord": (self.instantRecord, _("Instant Record...")),
134 +                               })
135                 self.recording = []
136  
137         def stopCurrentRecording(self, entry = -1):
138 diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py
139 index 9885e70..1d40547 100644
140 --- a/lib/python/Screens/TimerEntry.py
141 +++ b/lib/python/Screens/TimerEntry.py
142 @@ -94,7 +94,12 @@ class TimerEntry(Screen, ConfigListScreen):
143                                 weekday = (int(strftime("%w", localtime(self.timer.begin))) - 1) % 7
144                                 day[weekday] = 1
145  
146 -                       self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = {0: "record", 1: "zap"}[justplay])
147 +                       timer_choices = [("zap", _("zap"))]
148 +                       default = "zap"
149 +                       if SystemInfo["PVRSupport"]:
150 +                               timer_choices.append(("record", _("record")))
151 +                               default = {0: "record", 1: "zap"}[justplay]
152 +                       self.timerentry_justplay = ConfigSelection(choices = timer_choices, default = default)
153                         if SystemInfo["DeepstandbySupport"]:
154                                 shutdownString = _("go to deep standby")
155                         else:
156 diff --git a/lib/python/Tools/HardwareInfo.py b/lib/python/Tools/HardwareInfo.py
157 index e72d291..a1188c1 100644
158 --- a/lib/python/Tools/HardwareInfo.py
159 +++ b/lib/python/Tools/HardwareInfo.py
160 @@ -32,3 +32,26 @@ class HardwareInfo:
161  
162         def get_device_name(self):
163                 return HardwareInfo.device_name
164 +
165 +class HardwareInfoVu:
166 +       device_name = None
167 +
168 +       def __init__(self):
169 +               if HardwareInfoVu.device_name is not None:
170 +                       return
171 +
172 +               HardwareInfoVu.device_name = "unknown"
173 +               HardwareInfoVu.vendor_name = "unknown"
174 +               try:
175 +                       file = open("/proc/stb/info/vumodel", "r")
176 +                       HardwareInfoVu.device_name = file.readline().strip()
177 +                       file.close()
178 +                       HardwareInfoVu.vendor_name = "vuplus"
179 +               except:
180 +                       pass
181 +
182 +       def get_device_name(self):
183 +               return HardwareInfoVu.device_name
184 +
185 +       def get_vendor_name(self):
186 +               return HardwareInfoVu.vendor_name