enigma2: add dm520 support
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-4.3.0r7-dm7080 / 0001-dont-allow-recordings-for-dm520hd-because-of-missing.patch
1 From 1744a7cdb19783d553239c12c3d4d0df72cb510e Mon Sep 17 00:00:00 2001
2 From: ghost <andreas.monzner@dream-property.net>
3 Date: Wed, 15 Jun 2016 17:19:11 +0200
4 Subject: [PATCH 1/2] =?UTF-8?q?dont=20allow=20recordings=20for=20dm520hd?=
5  =?UTF-8?q?=20because=20of=20missing=20german=20ZP=C3=9C=20license?=
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 ---
11  usr/share/enigma2/data/defaults/Dream/settings.520   |  1 +
12  usr/lib/enigma2/python/Components/ActionMap.py |  6 +++++-
13  usr/lib/enigma2/python/Screens/TimerEntry.py   | 13 ++++++++-----
14  mytest.py                          |  1 +
15  4 files changed, 15 insertions(+), 6 deletions(-)
16
17 diff --git a/usr/share/enigma2/defaults/Dream/settings.520 b/usr/share/enigma2/defaults/Dream/settings.520
18 index 5521e30..e88b653 100644
19 --- a/usr/share/enigma2/defaults/Dream/settings.520
20 +++ b/usr/share/enigma2/defaults/Dream/settings.520
21 @@ -1,3 +1,4 @@
22  config.misc.rcused=2
23  config.skin.primary_skin=Default-HD/skin.xml
24  config.osd.window_animation_default=_-disabled-_
25 +config.misc.recording_allowed=false
26 diff --git a/usr/lib/enigma2/python/Components/ActionMap.py b/usr/lib/enigma2/python/Components/ActionMap.py
27 index 56bd85e..edf443e 100644
28 --- a/usr/lib/enigma2/python/Components/ActionMap.py
29 +++ b/usr/lib/enigma2/python/Components/ActionMap.py
30 @@ -1,4 +1,5 @@
31  from enigma import eActionMap
32 +from Components.config import config
33  
34  class ActionMap:
35         def __init__(self, contexts = [ ], actions = { }, prio=0):
36 @@ -43,7 +44,10 @@ class ActionMap:
37  
38         def action(self, context, action):
39                 print " ".join(("action -> ", context, action))
40 -               if self.actions.has_key(action):
41 +               if action in ('instantRecord', 'timeshiftStart') and not config.misc.recording_allowed.value:
42 +                       print "recording / timeshift not allowed with this dreambox!"
43 +                       return 0
44 +               elif self.actions.has_key(action):
45                         res = self.actions[action]()
46                         if res is not None:
47                                 return res
48 diff --git a/usr/lib/enigma2/python/Screens/TimerEntry.py b/usr/lib/enigma2/python/Screens/TimerEntry.py
49 index f78c0dd..4e69eb9 100644
50 --- a/usr/lib/enigma2/python/Screens/TimerEntry.py
51 +++ b/usr/lib/enigma2/python/Screens/TimerEntry.py
52 @@ -96,11 +96,14 @@ class TimerEntry(Screen, ConfigListScreen):
53                                 weekday = (int(strftime("%w", localtime(self.timer.begin))) - 1) % 7
54                                 day[weekday] = 1
55  
56 -                       justplay_default = {0: "record", 1: "zap"}[justplay]
57 -                       tmp_dir = self.timer.dirname or defaultMoviePath()
58 -                       if not harddiskmanager.inside_mountpoint(tmp_dir):
59 -                               justplay_default = {0: "record", 1: "zap"}[True]
60 -                       self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = justplay_default)
61 +                       if not config.misc.recording_allowed.value:
62 +                               self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap"))], default = "zap")
63 +                       else:
64 +                               tmp_dir = self.timer.dirname or defaultMoviePath()
65 +                               if not harddiskmanager.inside_mountpoint(tmp_dir):
66 +                                       justplay = 1
67 +                               justplay_default = {0: "record", 1: "zap"}[justplay]
68 +                               self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = justplay_default)
69  
70                         if SystemInfo["DeepstandbySupport"]:
71                                 shutdownString = _("go to standby")
72 diff --git a/usr/lib/enigma2/mytest.py b/usr/lib/enigma2/mytest.py
73 index c88fc30..764f56c 100644
74 --- a/usr/lib/enigma2/python/mytest.py
75 +++ b/usr/lib/enigma2/python/mytest.py
76 @@ -132,6 +132,7 @@ config.misc.prev_wakeup_time = ConfigInteger(default=0)
77  #config.misc.prev_wakeup_time_type is only valid when wakeup_time is not 0
78  config.misc.prev_wakeup_time_type = ConfigInteger(default=0) # 0 = RecordTimer, 1 = SleepTimer, 2 = Plugin
79  config.misc.use_legacy_virtual_subservices_detection = ConfigYesNo(default=False)
80 +config.misc.recording_allowed = ConfigYesNo(default=True)
81  
82  #gstreamer User-Agent settings (used by servicemp3)
83  config.mediaplayer = ConfigSubsection()
84 -- 
85 1.9.1
86