[SystemInfo] Add PVRSupport.
authorhschang <chang@dev3>
Fri, 2 Mar 2018 02:23:49 +0000 (11:23 +0900)
committerhschang <chang@dev3>
Fri, 2 Mar 2018 02:23:49 +0000 (11:23 +0900)
RecordTimer.py
data/menu.xml
data/setup.xml
lib/python/Components/SystemInfo.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/TimerEntry.py

index c3e9de7..443f050 100755 (executable)
@@ -4,6 +4,7 @@ from enigma import eEPGCache, getBestPlayableServiceReference, \
 from Components.config import config
 from Components.UsageConfig import defaultMoviePath
 from Components.TimerSanityCheck import TimerSanityCheck
+from Components.SystemInfo import SystemInfo
 
 from Screens.MessageBox import MessageBox
 import Screens.Standby
@@ -135,7 +136,10 @@ class RecordTimerEntry(timer.TimerEntry, object):
                self.timer = None
                self.__record_service = None
                self.start_prepare = 0
-               self.justplay = justplay
+               if SystemInfo["PVRSupport"]:
+                       self.justplay = justplay
+               else:
+                       self.justplay = True
                self.afterEvent = afterEvent
                self.dirname = dirname
                self.dirnameHadToFallback = False
@@ -460,7 +464,10 @@ def createTimer(xml):
        description = xml.get("description").encode("utf-8")
        repeated = xml.get("repeated").encode("utf-8")
        disabled = long(xml.get("disabled") or "0")
-       justplay = long(xml.get("justplay") or "0")
+       if SystemInfo["PVRSupport"]:
+               justplay = long(xml.get("justplay") or "0")
+       else:
+               justplay = long("1")
        afterevent = str(xml.get("afterevent") or "nothing")
        afterevent = {
                "nothing": AFTEREVENT.NONE,
@@ -658,7 +665,10 @@ class RecordTimer(timer.Timer):
                        if timer.tags is not None:
                                list.append(' tags="' + str(stringToXML(' '.join(timer.tags))) + '"')
                        list.append(' disabled="' + str(int(timer.disabled)) + '"')
-                       list.append(' justplay="' + str(int(timer.justplay)) + '"')
+                       if SystemInfo["PVRSupport"]:
+                               list.append(' justplay="' + str(int(timer.justplay)) + '"')
+                       else:
+                               list.append(' justplay="1"')
                        list.append('>\n')
                        
                        if config.recording.debug.value:
index 5c8cbb2..ed0b415 100755 (executable)
@@ -71,7 +71,7 @@
                                        <item level="1" text="Device Setup..." entryID="device_setup"><screen module="NetworkSetup" screen="NetworkAdapterSelection"/></item>
                                        <item level="1" text="Nameserver Setup..." entryID="dns_setup"><screen module="NetworkSetup" screen="NameserverSetup"/></item>
                                </menu>-->
-                               <item level="2" text="Recording paths" entryId="RecordPaths"><screen module="RecordPaths" screen="RecordPathsSettings" /></item>
+                               <item level="2" text="Recording paths" entryId="RecordPaths" requires="PVRSupport"><screen module="RecordPaths" screen="RecordPathsSettings" /></item>
                        </menu>
                        <item weight="10" level="1" text="Common Interface" entryID="ci_setup" requires="CommonInterface"><screen module="Ci" screen="CiSelection" /></item>
                        <item weight="15" level="0" text="Parental control" entryID="parental_setup"><screen module="ParentalControlSetup" screen="ParentalControlSetup" /></item>
index 9613440..9fb4a56 100755 (executable)
                </setup>
                <setup key="usage" title="Customize">
                        <item level="0" text="Setup Mode">config.usage.setup_level</item>
-                       <item level="1" text="Recordings always have priority">config.recording.asktozap</item>
-                       <item level="0" text="Margin before record (minutes)">config.recording.margin_before</item>
-                       <item level="0" text="Margin after record">config.recording.margin_after</item>
-                       <item level="0" text="Show blinking clock in display during recording">config.usage.blinking_display_clock_during_recording</item>
-                       <item level="2" text="Show Message when Recording starts">config.usage.show_message_when_recording_starts</item>
+                       <item level="1" text="Recordings always have priority" requires="PVRSupport">config.recording.asktozap</item>
+                       <item level="0" text="Margin before record (minutes)" requires="PVRSupport">config.recording.margin_before</item>
+                       <item level="0" text="Margin after record" requires="PVRSupport">config.recording.margin_after</item>
+                       <item level="0" text="Show blinking clock in display during recording" requires="PVRSupport">config.usage.blinking_display_clock_during_recording</item>
+                       <item level="2" text="Show Message when Recording starts" requires="PVRSupport">config.usage.show_message_when_recording_starts</item>
                        <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>
index 73c6111..5ee9510 100644 (file)
@@ -37,3 +37,4 @@ SystemInfo["MiniTV"] = fileExists("/proc/stb/lcd/live_enable")
 SystemInfo["DisableUsbRecord"] = HardwareInfo().get_vu_device_name() in ("solo4k", "uno4kse", "zero4k")
 SystemInfo["DefaultAniSpeed"] = HardwareInfo().get_vu_device_name() in ("uno4k", "uno4kse", "zero4k") and 25 or 20
 SystemInfo["DefaultFullHDSkin"] = HardwareInfo().get_vu_device_name() in ("solo4k","ultimo4k","uno4k","uno4kse","zero4k")
+SystemInfo["PVRSupport"] = HardwareInfo().get_vu_device_name() not in ["solose", "zero", "uno4k"]
index 0b01bf8..d1c6c84 100755 (executable)
@@ -235,7 +235,7 @@ class InfoBarNumberZap:
                        else:
                                self.servicelist.recallPrevService()
                else:
-                       if self.has_key("TimeshiftActions") and not self.timeshift_enabled:
+                       if not (self.has_key("TimeshiftActions") and self.timeshift_enabled):
                                self.session.openWithCallback(self.numberEntered, NumberZap, number)
 
        def numberEntered(self, retval):
@@ -1185,11 +1185,12 @@ class InfoBarShowMovies:
 
 class InfoBarTimeshift:
        def __init__(self):
-               self["TimeshiftActions"] = HelpableActionMap(self, "InfobarTimeshiftActions",
-                       {
-                               "timeshiftStart": (self.startTimeshift, _("start timeshift")),  # the "yellow key"
-                               "timeshiftStop": (self.stopTimeshift, _("stop timeshift"))      # currently undefined :), probably 'TV'
-                       }, prio=1)
+               if SystemInfo["PVRSupport"]:
+                       self["TimeshiftActions"] = HelpableActionMap(self, "InfobarTimeshiftActions",
+                               {
+                                       "timeshiftStart": (self.startTimeshift, _("start timeshift")),  # the "yellow key"
+                                       "timeshiftStop": (self.stopTimeshift, _("stop timeshift"))      # currently undefined :), probably 'TV'
+                               }, prio=1)
                self["TimeshiftActivateActions"] = ActionMap(["InfobarTimeshiftActivateActions"],
                        {
                                "timeshiftActivateEnd": self.activateTimeshiftEnd, # something like "rewind key"
@@ -1520,10 +1521,11 @@ class InfoBarInstantRecord:
        """Instant Record - handles the instantRecord action in order to
        start/stop instant records"""
        def __init__(self):
-               self["InstantRecordActions"] = HelpableActionMap(self, "InfobarInstantRecord",
-                       {
-                               "instantRecord": (self.instantRecord, _("Instant Record...")),
-                       })
+               if SystemInfo["PVRSupport"]:
+                       self["InstantRecordActions"] = HelpableActionMap(self, "InfobarInstantRecord",
+                               {
+                                       "instantRecord": (self.instantRecord, _("Instant Record...")),
+                               })
                self.recording = []
 
        def stopCurrentRecording(self, entry = -1):
index 9885e70..1d40547 100644 (file)
@@ -94,7 +94,12 @@ class TimerEntry(Screen, ConfigListScreen):
                                weekday = (int(strftime("%w", localtime(self.timer.begin))) - 1) % 7
                                day[weekday] = 1
 
-                       self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = {0: "record", 1: "zap"}[justplay])
+                       timer_choices = [("zap", _("zap"))]
+                       default = "zap"
+                       if SystemInfo["PVRSupport"]:
+                               timer_choices.append(("record", _("record")))
+                               default = {0: "record", 1: "zap"}[justplay]
+                       self.timerentry_justplay = ConfigSelection(choices = timer_choices, default = default)
                        if SystemInfo["DeepstandbySupport"]:
                                shutdownString = _("go to deep standby")
                        else: