From 3434371ea1aa6f585ef4bb406ba5ac4e4e06a7ee Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 2 Nov 2009 16:04:08 +0100 Subject: Revert "disable unicable for release 2.6" This reverts commit 597d64c2e00be8759286e37fd15823b1c1518845. --- lib/python/Components/NimManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 5154e2b0..70cde47c 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -939,7 +939,7 @@ def InitNimManager(nimmgr): lnb_choices = { "universal_lnb": _("Universal LNB"), -# "unicable": _("Unicable"), + "unicable": _("Unicable"), "c_band": _("C-Band"), "user_defined": _("User defined")} -- cgit v1.2.3 From 43115f56227db0f655402fef45d1a2fc60533f86 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 6 Nov 2009 12:16:16 +0100 Subject: Revert "bug #258" This reverts commit 65ae5578663b82ddf54926047682ec1b6afdf4b6. its broken yet... --- lib/python/Components/config.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lib/python/Components/config.py (limited to 'lib/python/Components') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py old mode 100755 new mode 100644 -- cgit v1.2.3 From 3c8f046e30595b284a2b9c391a7ee7bdf662a284 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 6 Nov 2009 12:16:56 +0100 Subject: Revert "bug #258" This reverts commit 0bc4d77344f249d7e3c0adb2b2ea58d74f2d02ea. its broken yet --- lib/python/Components/config.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) mode change 100644 => 100755 lib/python/Components/config.py (limited to 'lib/python/Components') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py old mode 100644 new mode 100755 index d9f2104e..876e3a34 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1184,10 +1184,7 @@ class ConfigSatlist(ConfigSelection): def __init__(self, list, default = None): if default is not None: default = str(default) - choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list] - choices.sort(key = lambda x: int(x[0])) - - ConfigSelection.__init__(self, choices = choices, default = default) + ConfigSelection.__init__(self, choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list], default = default) def getOrbitalPosition(self): if self.value == "": -- cgit v1.2.3 From 3823b59986d6d47a8ca4b5db642c426f2e2b2652 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Nov 2009 08:48:37 +0100 Subject: config.py: fix set/getValue for ConfigSelectionNumber --- lib/python/Components/config.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 876e3a34..a6007b10 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1034,13 +1034,13 @@ class ConfigSelectionNumber(ConfigSelection): step += stepwidth ConfigSelection.__init__(self, choices, default) - + def getValue(self): - return int(self.text) + return int(ConfigSelection.getValue(self)) def setValue(self, val): - self.text = str(val) - + ConfigSelection.setValue(self, str(val)) + def handleKey(self, key): if not self.wraparound: if key == KEY_RIGHT: @@ -1050,8 +1050,6 @@ class ConfigSelectionNumber(ConfigSelection): if self.choices.index(self.value) == 0: return ConfigSelection.handleKey(self, key) - - class ConfigNumber(ConfigText): def __init__(self, default = 0): -- cgit v1.2.3 From a30169eba9644afe90859835be314055209fa3c1 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 19 Nov 2009 11:13:17 +0100 Subject: Components/About.py: fix /etc/image-version parser..now we also show image type (release/experimental) and major minor revision --- lib/python/Components/About.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/About.py b/lib/python/Components/About.py index bb2d7568..58d67dc9 100644 --- a/lib/python/Components/About.py +++ b/lib/python/Components/About.py @@ -19,11 +19,20 @@ class About: #0120 2005 11 29 01 16 #0123 4567 89 01 23 45 version = splitted[1] + image_type = version[0] # 0 = release, 1 = experimental + major = version[1] + minor = version[2] + revision = version[3] year = version[4:8] month = version[8:10] day = version[10:12] - - return '-'.join(("dev", year, month, day)) + if image_type == '0': + image_type = "Release" + else: + image_type = "Experimental" + date = '-'.join((year, month, day)) + version = '.'.join((major, minor, revision)) + return ' '.join((image_type, version, date)) file.close() except IOError: pass -- cgit v1.2.3 From 78c9520c9cc8030a7a14a895fb1775d5965d7a7e Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 20 Nov 2009 13:06:50 +0100 Subject: lib/python/Components/About.py: dont show version information for Experimental images.. only show date here.. --- lib/python/Components/About.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/About.py b/lib/python/Components/About.py index 58d67dc9..8e332e33 100644 --- a/lib/python/Components/About.py +++ b/lib/python/Components/About.py @@ -26,13 +26,14 @@ class About: year = version[4:8] month = version[8:10] day = version[10:12] + date = '-'.join((year, month, day)) if image_type == '0': image_type = "Release" + version = '.'.join((major, minor, revision)) + return ' '.join((image_type, version, date)) else: image_type = "Experimental" - date = '-'.join((year, month, day)) - version = '.'.join((major, minor, revision)) - return ' '.join((image_type, version, date)) + return ' '.join((image_type, date)) file.close() except IOError: pass -- cgit v1.2.3 From c72b0788e404a940f29888a696756d6b4cd6644f Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 1 Dec 2009 10:32:01 +0100 Subject: Components/Lcd.py: use 1 instead of 0 for Oled standby default value (with new drivers the oled is completely disabled on lowest step) --- lib/python/Components/Lcd.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index 0e501237..7d27c097 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -42,9 +42,18 @@ def InitLcd(): def setLCDinverted(configElement): ilcd.setInverted(configElement.value); + standby_default = 0 + ilcd = LCD() - config.lcd.standby = ConfigSlider(default=0, limits=(0, 10)) + if not ilcd.isOled(): + config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) + config.lcd.contrast.addNotifier(setLCDcontrast); + else: + config.lcd.contrast = ConfigNothing() + standby_default = 1 + + config.lcd.standby = ConfigSlider(default=standby_default, limits=(0, 10)) config.lcd.standby.addNotifier(setLCDbright); config.lcd.standby.apply = lambda : setLCDbright(config.lcd.standby) @@ -53,12 +62,6 @@ def InitLcd(): config.lcd.bright.apply = lambda : setLCDbright(config.lcd.bright) config.lcd.bright.callNotifiersOnSaveAndCancel = True - if not ilcd.isOled(): - config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20)) - config.lcd.contrast.addNotifier(setLCDcontrast); - else: - config.lcd.contrast = ConfigNothing() - config.lcd.invert = ConfigYesNo(default=False) config.lcd.invert.addNotifier(setLCDinverted); else: -- cgit v1.2.3 From 44fb489521cf6ad1defba93311366df08d7938a4 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 3 Dec 2009 16:37:52 +0100 Subject: Components/SystemInfo.py: add new SystemInfo entry "DeepstandbySupport" --- lib/python/Components/SystemInfo.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py index d2b405a2..f9c4065f 100644 --- a/lib/python/Components/SystemInfo.py +++ b/lib/python/Components/SystemInfo.py @@ -1,5 +1,6 @@ from enigma import eDVBResourceManager from Tools.Directories import fileExists +from Tools.HardwareInfo import HardwareInfo SystemInfo = { } @@ -27,3 +28,4 @@ def countFrontpanelLEDs(): SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs() SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0") SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0") +SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800" -- cgit v1.2.3 From 41b99d4a2d737817b75c93c8331f038326d13862 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 22 Dec 2009 14:18:00 +0100 Subject: NimManager.py: increased delay after enable voltage before send motor diseqc command... this fixes bug #261 --- lib/python/Components/NimManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 78e17bb7..d374f7e7 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -899,7 +899,7 @@ def InitSecParams(): x.addNotifier(lambda configElement: secClass.setParam(secClass.DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MEASURE_IDLE_INPUTPOWER, configElement.value)) config.sec.delay_after_voltage_change_before_measure_idle_inputpower = x - x = ConfigInteger(default=750, limits = (0, 9999)) + x = ConfigInteger(default=900, limits = (0, 9999)) x.addNotifier(lambda configElement: secClass.setParam(secClass.DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_MOTOR_CMD, configElement.value)) config.sec.delay_after_enable_voltage_before_motor_command = x -- cgit v1.2.3 From 2701861d66fd17ed825de7bbfdea8e000fdb30b4 Mon Sep 17 00:00:00 2001 From: thedoc Date: Wed, 23 Dec 2009 11:42:22 +0100 Subject: fixes bug #322 change default visibility of blinking dish icon to true --- lib/python/Components/UsageConfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 680b5944..60827107 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -7,7 +7,7 @@ import os def InitUsageConfig(): config.usage = ConfigSubsection(); - config.usage.showdish = ConfigYesNo(default = False) + config.usage.showdish = ConfigYesNo(default = True) config.usage.multibouquet = ConfigYesNo(default = False) config.usage.quickzap_bouquet_change = ConfigYesNo(default = False) config.usage.e1like_radio_mode = ConfigYesNo(default = False) -- cgit v1.2.3 From a88994b2d0bab5d8a5d0b38b5a66f374372b0830 Mon Sep 17 00:00:00 2001 From: thedoc Date: Tue, 15 Dec 2009 16:18:52 +0100 Subject: fixes bug #354 change MenuList to ChoiceList in ChannelContext and assign Blue button to PiP activation --- data/skin_default.xml | 4 ++-- lib/python/Components/ChoiceList.py | 2 +- lib/python/Screens/ChannelSelection.py | 27 +++++++++++++++++---------- 3 files changed, 20 insertions(+), 13 deletions(-) (limited to 'lib/python/Components') diff --git a/data/skin_default.xml b/data/skin_default.xml index 71f579cb..7aaff38f 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -70,8 +70,8 @@ - - + + diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py index 4700e9e6..33868d61 100755 --- a/lib/python/Components/ChoiceList.py +++ b/lib/python/Components/ChoiceList.py @@ -3,7 +3,7 @@ from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont from Tools.LoadPixmap import LoadPixmap -def ChoiceEntryComponent(key, text): +def ChoiceEntryComponent(key = "", text = ["--"]): res = [ text ] if text[0] == "--": res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 00, 800, 25, 0, RT_HALIGN_LEFT, "-"*200)) diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index d4a098c3..e8bbce15 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -21,6 +21,7 @@ profile("ChannelSelection.py 2.3") from Components.Input import Input profile("ChannelSelection.py 3") from Components.ParentalControl import parentalControl +from Components.ChoiceList import ChoiceList, ChoiceEntryComponent from Screens.InputBox import InputBox, PinInput from Screens.MessageBox import MessageBox from Screens.ServiceInfo import ServiceInfo @@ -70,9 +71,9 @@ OFF = 0 EDIT_BOUQUET = 1 EDIT_ALTERNATIVES = 2 -def append_when_current_valid(current, menu, args, level = 0): +def append_when_current_valid(current, menu, args, level = 0, key = ""): if current and current.valid() and level <= config.usage.setup_level.index: - menu.append(args) + menu.append(ChoiceEntryComponent(key, args)) class ChannelContextMenu(Screen): def __init__(self, session, csel): @@ -81,13 +82,15 @@ class ChannelContextMenu(Screen): self.csel = csel self.bsel = None - self["actions"] = ActionMap(["OkCancelActions"], + self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "NumberActions"], { "ok": self.okbuttonClick, - "cancel": self.cancelClick + "cancel": self.cancelClick, + "blue": self.showServiceInPiP }) menu = [ ] + self.pipAvailable = False current = csel.getCurrentSelection() current_root = csel.getRoot() current_sel_path = current.getPath() @@ -102,7 +105,6 @@ class ChannelContextMenu(Screen): if not inBouquetRootList: isPlayable = not (current_sel_flags & (eServiceReference.isMarker|eServiceReference.isDirectory)) if isPlayable: - append_when_current_valid(current, menu, (_("Activate Picture in Picture"), self.showServiceInPiP), level = 0) if config.ParentalControl.configured.value: if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1: append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())), level = 0) @@ -124,8 +126,11 @@ class ChannelContextMenu(Screen): append_when_current_valid(current, menu, (_("remove entry"), self.removeCurrentService), level = 0) if current_root and current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1: append_when_current_valid(current, menu, (_("remove new found flag"), self.removeNewFoundFlag), level = 0) + if isPlayable: + append_when_current_valid(current, menu, (_("Activate Picture in Picture"), self.showServiceInPiP), level = 0, key = "blue") + self.pipAvailable = True else: - menu.append((_("add bouquet"), self.showBouquetInputBox)) + menu.append(ChoiceEntryComponent(text = (_("add bouquet"), self.showBouquetInputBox))) append_when_current_valid(current, menu, (_("remove entry"), self.removeBouquet), level = 0) if inBouquet: # current list is editable? @@ -133,7 +138,7 @@ class ChannelContextMenu(Screen): if not csel.movemode: append_when_current_valid(current, menu, (_("enable move mode"), self.toggleMoveMode), level = 1) if not inBouquetRootList and current_root and not (current_root.flags & eServiceReference.isGroup): - menu.append((_("add marker"), self.showMarkerInputBox)) + menu.append(ChoiceEntryComponent(text = (_("add marker"), self.showMarkerInputBox))) if haveBouquets: append_when_current_valid(current, menu, (_("enable bouquet edit"), self.bouquetMarkStart), level = 0) else: @@ -158,11 +163,11 @@ class ChannelContextMenu(Screen): append_when_current_valid(current, menu, (_("end alternatives edit"), self.bouquetMarkEnd), level = 0) append_when_current_valid(current, menu, (_("abort alternatives edit"), self.bouquetMarkAbort), level = 0) - menu.append((_("back"), self.cancelClick)) - self["menu"] = MenuList(menu) + menu.append(ChoiceEntryComponent(text = (_("back"), self.cancelClick))) + self["menu"] = ChoiceList(menu) def okbuttonClick(self): - self["menu"].getCurrent()[1]() + self["menu"].getCurrent()[0][1]() def cancelClick(self): self.close(False) @@ -193,6 +198,8 @@ class ChannelContextMenu(Screen): self.session.openWithCallback(self.close, MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) def showServiceInPiP(self): + if not self.pipAvailable: + return if self.session.pipshown: del self.session.pip self.session.pip = self.session.instantiateDialog(PictureInPicture) -- cgit v1.2.3 From a03c8f3703decf54844695107ddce289df77a0aa Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 23 Dec 2009 21:56:03 +0100 Subject: NimManager.py/Satconfig.py: add possibility to change the tone amplitide (22Khz amplitude) in Tunerconfig for Alps BSBE2 tuners when the usage level is configured as expert --- lib/python/Components/NimManager.py | 12 ++++++++++++ lib/python/Screens/Satconfig.py | 2 ++ 2 files changed, 14 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index d374f7e7..613305d0 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -1213,10 +1213,21 @@ def InitNimManager(nimmgr): tmp.lnb = lnb nim.advanced.sat[x] = tmp + def toneAmplitudeChanged(configElement): + fe_id = configElement.fe_id + slot_id = configElement.slot_id + if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2': + open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value) + + empty_slots = 0 for slot in nimmgr.nim_slots: x = slot.slot nim = config.Nims[x] if slot.isCompatible("DVB-S"): + nim.toneAmplitude = ConfigSelection([("9", "600mV"), ("8", "700mV"), ("7", "800mV"), ("6", "900mV"), ("5", "1100mV")], "7") + nim.toneAmplitude.fe_id = x - empty_slots + nim.toneAmplitude.slot_id = x + nim.toneAmplitude.addNotifier(toneAmplitudeChanged) nim.diseqc13V = ConfigYesNo(False) nim.diseqcMode = ConfigSelection(diseqc_mode_choices, "diseqc_a_b") nim.connectedTo = ConfigSelection([(str(id), nimmgr.getNimDescription(id)) for id in nimmgr.getNimListOfType("DVB-S") if id != x]) @@ -1306,6 +1317,7 @@ def InitNimManager(nimmgr): nim.terrestrial = ConfigSelection(choices = list) nim.terrestrial_5V = ConfigOnOff() else: + empty_slots += 1 nim.configMode = ConfigSelection(choices = { "nothing": _("disabled") }, default="nothing"); if slot.type is not None: print "pls add support for this frontend type!", slot.type diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index e24e4636..634d231a 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -145,6 +145,8 @@ class NimSetup(Screen, ConfigListScreen): currSat = self.nimConfig.advanced.sat[cur_orb_pos] self.fillListWithAdvancedSatEntrys(currSat) self.have_advanced = True + if self.nim.description == "Alps BSBE2" and config.usage.setup_level.index >= 2: # expert + self.list.append(getConfigListEntry(_("Tone Amplitude"), self.nimConfig.toneAmplitude)) elif self.nim.isCompatible("DVB-C"): self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode) self.list.append(self.configMode) -- cgit v1.2.3 From c9315c0737c473abd384dc8950b4c6bbd16dcccc Mon Sep 17 00:00:00 2001 From: thedoc Date: Fri, 1 Jan 2010 14:00:47 +0100 Subject: fixes bug #362 allow assigning standby function to long power button press --- lib/python/Components/UsageConfig.py | 3 ++- mytest.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 60827107..f133f9f6 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -51,7 +51,8 @@ def InitUsageConfig(): config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [ ("show_menu", _("show shutdown menu")), - ("shutdown", _("immediate shutdown")) ] ) + ("shutdown", _("immediate shutdown")), + ("standby", _("Standby")) ] ) config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [ ("0", "DVB-S/-C/-T"), diff --git a/mytest.py b/mytest.py index c748538a..7eb045ee 100755 --- a/mytest.py +++ b/mytest.py @@ -380,6 +380,8 @@ class PowerKey: menu_screen = self.session.openWithCallback(self.MenuClosed, MainMenu, x) menu_screen.setTitle(_("Standby / Restart")) return + elif action == "standby": + self.standby() def powerdown(self): self.standbyblocked = 0 -- cgit v1.2.3 From b6f95a8f5457c60ccc14192a4d13d3c05fa608be Mon Sep 17 00:00:00 2001 From: thedoc Date: Fri, 1 Jan 2010 14:07:03 +0100 Subject: fixes bug #362 allow configuring short power button action to shutdown, standby, menu --- data/setup.xml | 1 + lib/python/Components/UsageConfig.py | 6 ++++++ mytest.py | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/python/Components') diff --git a/data/setup.xml b/data/setup.xml index 9425afda..92bbc0f1 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -31,6 +31,7 @@ config.usage.quickzap_bouquet_change config.usage.e1like_radio_mode config.usage.on_long_powerpress + config.usage.on_short_powerpress config.usage.infobar_timeout config.usage.output_12V config.usage.show_infobar_on_zap diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index f133f9f6..21478e90 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -53,6 +53,12 @@ def InitUsageConfig(): ("show_menu", _("show shutdown menu")), ("shutdown", _("immediate shutdown")), ("standby", _("Standby")) ] ) + + config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [ + ("show_menu", _("show shutdown menu")), + ("shutdown", _("immediate shutdown")), + ("standby", _("Standby")) ] ) + config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [ ("0", "DVB-S/-C/-T"), diff --git a/mytest.py b/mytest.py index 7eb045ee..4b687e05 100755 --- a/mytest.py +++ b/mytest.py @@ -363,9 +363,10 @@ class PowerKey: def powerlong(self): if Screens.Standby.inTryQuitMainloop or (self.session.current_dialog and not self.session.current_dialog.ALLOW_SUSPEND): return + self.doAction(action = config.usage.on_long_powerpress.value) + def doAction(self, action): self.standbyblocked = 1 - action = config.usage.on_long_powerpress.value if action == "shutdown": self.shutdown() elif action == "show_menu": @@ -388,8 +389,7 @@ class PowerKey: def powerup(self): if self.standbyblocked == 0: - self.standbyblocked = 1 - self.standby() + self.doAction(action = config.usage.on_short_powerpress.value) def standby(self): if not Screens.Standby.inStandby and self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND and self.session.in_exec: -- cgit v1.2.3 From 08413feb6f7217a4ddb598dfc0ab46e80adb5f99 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 2 Jan 2010 13:48:36 +0100 Subject: Components/config.py: dont show configtext input help in ConfigDirectory's --- lib/python/Components/config.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index a6007b10..471b59ec 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1138,6 +1138,9 @@ class ConfigDirectory(ConfigText): else: return ConfigText.getMulti(self, selected) + def onSelect(self, session): + self.allmarked = (self.value != "") + # a slider. class ConfigSlider(ConfigElement): def __init__(self, default = 0, increment = 1, limits = (0, 100)): -- cgit v1.2.3 From e7d3f74e6679c23d3f6174e2d8857b5788748af9 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 5 Jan 2010 14:41:54 +0100 Subject: bug #238 added m4v file extension to media player capabilities Conflicts: lib/python/Plugins/Extensions/MediaPlayer/plugin.py --- lib/python/Components/FileList.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index 222512ea..841a2fe5 100755 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -23,6 +23,7 @@ EXTENSIONS = { "ts": "movie", "avi": "movie", "divx": "movie", + "m4v": "movie", "mpg": "movie", "mpeg": "movie", "mkv": "movie", -- cgit v1.2.3 From 7a3d4cb061893cf157d980b164a0635706f70aa5 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 27 Jan 2010 12:11:34 +0100 Subject: disabe fan on enter standby, restart fan on leave standby this fixes bug #418 --- lib/python/Components/FanControl.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/FanControl.py b/lib/python/Components/FanControl.py index cc133ac0..cee0523e 100644 --- a/lib/python/Components/FanControl.py +++ b/lib/python/Components/FanControl.py @@ -11,6 +11,20 @@ class FanControl: else: self.fancount = 0 self.createConfig() + config.misc.standbyCounter.addNotifier(self.standbyCounterChanged, initial_call = False) + + def leaveStandby(self): + for fanid in range(self.getFanCount()): + cfg = self.getConfig(fanid) + self.setVoltage(fanid, cfg.vlt.value) + self.setPWM(fanid, cfg.pwm.value) + + def standbyCounterChanged(self, configElement): + from Screens.Standby import inStandby + inStandby.onClose.append(self.leaveStandby) + for fanid in range(self.getFanCount()): + self.setVoltage(fanid, 0) + self.setPWM(fanid, 0) def createConfig(self): def setVlt(fancontrol, fanid, configElement): -- cgit v1.2.3 From c50a4697aa4a47d93f9ac7c3526758ff5a7ace26 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 27 Jan 2010 12:14:14 +0100 Subject: cleanup lcd code --- lib/python/Components/Lcd.py | 11 +++++++++++ lib/python/Screens/Standby.py | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Lcd.py b/lib/python/Components/Lcd.py index 7d27c097..dde158b6 100644 --- a/lib/python/Components/Lcd.py +++ b/lib/python/Components/Lcd.py @@ -28,6 +28,14 @@ class LCD: def isOled(self): return eDBoxLCD.getInstance().isOled() +def leaveStandby(): + config.lcd.bright.apply() + +def standbyCounterChanged(configElement): + from Screens.Standby import inStandby + inStandby.onClose.append(leaveStandby) + config.lcd.standby.apply() + def InitLcd(): detected = eDBoxLCD.getInstance().detected() SystemInfo["Display"] = detected @@ -72,3 +80,6 @@ def InitLcd(): config.lcd.standby = ConfigNothing() config.lcd.bright.apply = lambda : doNothing() config.lcd.standby.apply = lambda : doNothing() + + config.misc.standbyCounter.addNotifier(standbyCounterChanged, initial_call = False) + diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py index c598b545..406b87cb 100644 --- a/lib/python/Screens/Standby.py +++ b/lib/python/Screens/Standby.py @@ -15,8 +15,6 @@ class Standby(Screen): #restart last played service #unmute adc self.leaveMute() - #set brightness of lcd - config.lcd.bright.apply() #kill me self.close(True) @@ -63,8 +61,6 @@ class Standby(Screen): self.avswitch.setInput("SCART") else: self.avswitch.setInput("AUX") - #set lcd brightness to standby value - config.lcd.standby.apply() self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose) -- cgit v1.2.3 From 7c2f35aa189b8e3d4d5e3fece3362d71ee160762 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 11 Feb 2010 23:12:47 +0100 Subject: add possibility to disable/enable listbox selection in multicontent templates fixes bug #443 --- .../Components/Converter/TemplatedMultiContent.py | 20 +++++++++++--------- lib/python/Components/Renderer/Listbox.py | 4 ++++ lib/python/Components/Sources/List.py | 5 +++-- 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Converter/TemplatedMultiContent.py b/lib/python/Components/Converter/TemplatedMultiContent.py index b86d94bf..b5a98449 100644 --- a/lib/python/Components/Converter/TemplatedMultiContent.py +++ b/lib/python/Components/Converter/TemplatedMultiContent.py @@ -10,8 +10,8 @@ class TemplatedMultiContent(StringList): del l["self"] # cleanup locals a bit del l["args"] - self.template = eval(args, {}, l) self.active_style = None + self.template = eval(args, {}, l) assert "fonts" in self.template assert "itemHeight" in self.template assert "template" in self.template or "templates" in self.template @@ -25,7 +25,6 @@ class TemplatedMultiContent(StringList): if not self.content: from enigma import eListboxPythonMultiContent self.content = eListboxPythonMultiContent() - self.setTemplate() # also setup fonts (also given by source) index = 0 @@ -35,30 +34,33 @@ class TemplatedMultiContent(StringList): # if only template changed, don't reload list if what[0] == self.CHANGED_SPECIFIC and what[1] == "style": - self.setTemplate() - return - - if self.source: + pass + elif self.source: self.content.setList(self.source.list) - self.setTemplate() + self.setTemplate() self.downstream_elements.changed(what) def setTemplate(self): if self.source: style = self.source.style + if style == self.active_style: - return # style did not change + return # if skin defined "templates", that means that it defines multiple styles in a dict. template should still be a default templates = self.template.get("templates") template = self.template.get("template") itemheight = self.template["itemHeight"] + selectionEnabled = self.template.get("selectionEnabled", True) if templates and style and style in templates: # if we have a custom style defined in the source, and different templates in the skin, look it up template = templates[style][1] itemheight = templates[style][0] + if len(templates[style]) > 2: + selectionEnabled = templates[style][2] self.content.setTemplate(template) - self.content.setItemHeight(itemheight) + self.selectionEnabled = selectionEnabled + self.active_style = style diff --git a/lib/python/Components/Renderer/Listbox.py b/lib/python/Components/Renderer/Listbox.py index 7a895330..640121e1 100644 --- a/lib/python/Components/Renderer/Listbox.py +++ b/lib/python/Components/Renderer/Listbox.py @@ -77,6 +77,10 @@ class Listbox(Renderer, object): selection_enabled = property(lambda self: self.__selection_enabled, setSelectionEnabled) def changed(self, what): + if hasattr(self.source, "selectionEnabled"): + self.selection_enabled = self.source.selectionEnabled + if len(what) > 1 and isinstance(what[1], str) and what[1] == "style": + return self.content = self.source.content def entry_changed(self, index): diff --git a/lib/python/Components/Sources/List.py b/lib/python/Components/Sources/List.py index 1eab32b2..6f0670a1 100644 --- a/lib/python/Components/Sources/List.py +++ b/lib/python/Components/Sources/List.py @@ -91,8 +91,9 @@ to generate HTML.""" return self.__style def setStyle(self, style): - self.__style = style - self.changed((self.CHANGED_SPECIFIC, "style")) + if self.__style != style: + self.__style = style + self.changed((self.CHANGED_SPECIFIC, "style")) style = property(getStyle, setStyle) -- cgit v1.2.3 From 01d75322e7f2c56a3fc67db645440a5a71ef3d1e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 15 Feb 2010 10:25:34 +0100 Subject: lib/python/Components/PluginsComponent.py: even allow .pyo files --- lib/python/Components/PluginComponent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py index c91d6ad5..5e439fdf 100755 --- a/lib/python/Components/PluginComponent.py +++ b/lib/python/Components/PluginComponent.py @@ -46,7 +46,7 @@ class PluginComponent: for pluginname in os_listdir(directory_category): path = directory_category + "/" + pluginname if os_path.isdir(path): - if fileExists(path + "/plugin.pyc") or fileExists(path + "/plugin.py"): + if fileExists(path + "/plugin.pyc") or fileExists(path + "/plugin.pyo") or fileExists(path + "/plugin.py"): try: plugin = my_import('.'.join(["Plugins", c, pluginname, "plugin"])) -- cgit v1.2.3 From abd1ad03da2989e3f57a999b9e50be0c95833891 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 5 Feb 2010 00:18:33 +0100 Subject: fixes bug #436 add support for mixed nims --- lib/python/Components/NimManager.py | 47 ++++++++++++++++++++++++++++++++++--- lib/python/Screens/Satconfig.py | 18 +++++++++++++- 2 files changed, 61 insertions(+), 4 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 613305d0..6650c717 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -444,7 +444,7 @@ class SecConfigure: self.update() class NIM(object): - def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None): + def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}): self.slot = slot if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", None): @@ -455,6 +455,7 @@ class NIM(object): self.description = description self.has_outputs = has_outputs self.internally_connectable = internally_connectable + self.multi_type = multi_type def isCompatible(self, what): compatible = { @@ -466,6 +467,9 @@ class NIM(object): } return what in compatible[self.type] + def getType(self): + return self.type + def connectableTo(self): connectable = { "DVB-S": ("DVB-S", "DVB-S2"), @@ -491,6 +495,13 @@ class NIM(object): def internallyConnectableTo(self): return self.internally_connectable + + def isMultiType(self): + return (len(self.multi_type) > 0) + + # returns dict {: } + def getMultiTypeList(self): + return self.multi_type slot_id = property(getSlotID) @@ -636,7 +647,15 @@ class NimManager: entries[current_slot]["has_outputs"] = (input == "yes") elif line.strip().startswith("Internally_Connectable:"): input = int(line.strip()[len("Internally_Connectable:") + 1:]) - entries[current_slot]["internally_connectable"] = input + entries[current_slot]["internally_connectable"] = input + elif line.strip().startswith("Mode"): + # "Mode 0: DVB-T" -> ["Mode 0", " DVB-T"] + split = line.strip().split(":") + # "Mode 0" -> ["Mode, "0"] + split2 = split[0].split(" ") + modes = entries[current_slot].get("multi_type", {}) + modes[split2[1]] = split[1].strip() + entries[current_slot]["multi_type"] = modes elif line.strip().startswith("empty"): entries[current_slot]["type"] = None entries[current_slot]["name"] = _("N/A") @@ -650,12 +669,17 @@ class NimManager: entry["has_outputs"] = True if not (entry.has_key("internally_connectable")): entry["internally_connectable"] = None - self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"])) + if not (entry.has_key("multi_type")): + entry["multi_type"] = {} + self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"])) def hasNimType(self, chktype): for slot in self.nim_slots: if slot.isCompatible(chktype): return True + for type in slot.getMultiTypeList().values(): + if chktype == type: + return True return False def getNimType(self, slotid): @@ -1218,11 +1242,28 @@ def InitNimManager(nimmgr): slot_id = configElement.slot_id if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2': open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value) + + def tunerTypeChanged(configElement): + fe_id = configElement.fe_id + open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value) empty_slots = 0 for slot in nimmgr.nim_slots: x = slot.slot nim = config.Nims[x] + if slot.isMultiType(): + typeList = [] + value = None + for id in slot.getMultiTypeList().keys(): + type = slot.getMultiTypeList()[id] + typeList.append((id, type)) + if type == slot.getType(): + value = id + nim.multiType = ConfigSelection(typeList, "0") + nim.multiType.value = value + nim.multiType.fe_id = x - empty_slots + nim.multiType.addNotifier(tunerTypeChanged) + if slot.isCompatible("DVB-S"): nim.toneAmplitude = ConfigSelection([("9", "600mV"), ("8", "700mV"), ("7", "800mV"), ("6", "900mV"), ("5", "1100mV")], "7") nim.toneAmplitude.fe_id = x - empty_slots diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 156f7780..0d10a2c0 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -94,6 +94,11 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.advancedType = None self.advancedManufacturer = None self.advancedSCR = None + + if self.nim.isMultiType(): + multiType = self.nimConfig.multiType + self.multiType = getConfigListEntry(_("Tuner type"), multiType) + self.list.append(self.multiType) if self.nim.isCompatible("DVB-S"): self.configMode = getConfigListEntry(_("Configuration Mode"), self.nimConfig.configMode) @@ -200,10 +205,19 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry, \ self.advancedLof, self.advancedPowerMeasurement, self.turningSpeed, \ self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, \ - self.uncommittedDiseqcCommand, self.cableScanType) + self.uncommittedDiseqcCommand, self.cableScanType, self.multiType) + if self["config"].getCurrent() == self.multiType: + print "enumerating:" + nimmanager.enumerateNIMs() + print "mode value:", self.multiType[1].value + from Components.NimManager import InitNimManager + InitNimManager(nimmanager) + self.nim = nimmanager.nim_slots[self.slotid] + self.nimConfig = self.nim.config for x in checkList: if self["config"].getCurrent() == x: self.createSetup() + break def run(self): if self.have_advanced and self.nim.config_mode == "advanced": @@ -511,6 +525,8 @@ class NimSelection(Screen): text = _("nothing connected") elif nimConfig.configMode.value == "enabled": text = _("enabled") + if x.isMultiType(): + text = _("Switchable tuner types:") + "(" + ','.join(x.getMultiTypeList().values()) + ")" + "\n" + text self.list.append((slotid, x.friendly_full_description, text, x)) self["nimlist"].setList(self.list) -- cgit v1.2.3 From bdea0dd8ac75294737564b1c2a4178a32ba3d284 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 23 Feb 2010 22:57:29 +0100 Subject: lib/python/Components/Ipkg.py: small fix for opkg --- lib/python/Components/Ipkg.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Ipkg.py b/lib/python/Components/Ipkg.py index 0ba1165c..71447775 100755 --- a/lib/python/Components/Ipkg.py +++ b/lib/python/Components/Ipkg.py @@ -1,4 +1,5 @@ from enigma import eConsoleAppContainer +from Tools.Directories import fileExists class IpkgComponent: EVENT_INSTALL = 0 @@ -20,7 +21,7 @@ class IpkgComponent: def __init__(self, ipkg = '/usr/bin/ipkg'): self.ipkg = ipkg - + self.opkgAvail = fileExists('/usr/bin/opkg') self.cmd = eConsoleAppContainer() self.cache = None self.callbackList = [] @@ -89,7 +90,10 @@ class IpkgComponent: if data.find('Downloading') == 0: self.callCallbacks(self.EVENT_DOWNLOAD, data.split(' ', 5)[1].strip()) elif data.find('Upgrading') == 0: - self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0]) + if self.opkgAvail: + self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0]) + else: + self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0]) elif data.find('Installing') == 0: self.callCallbacks(self.EVENT_INSTALL, data.split(' ', 1)[1].split(' ')[0]) elif data.find('Removing') == 0: -- cgit v1.2.3 From eca33f89346b4ad0e7bbaef7438e8a87daa963a9 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 11 Jan 2010 19:18:34 +0100 Subject: Add some parental control improvements (made by Tode) --- data/skin_default/Makefile.am | 4 + data/skin_default/lock.png | Bin 0 -> 1053 bytes data/skin_default/lockBouquet.png | Bin 0 -> 1176 bytes data/skin_default/unlock.png | Bin 0 -> 965 bytes data/skin_default/unlockBouquet.png | Bin 0 -> 1141 bytes lib/python/Components/ParentalControl.py | 316 +++++++++++++++++++-------- lib/python/Components/ParentalControlList.py | 29 ++- lib/python/Screens/ParentalControlSetup.py | 79 +++++-- 8 files changed, 320 insertions(+), 108 deletions(-) create mode 100644 data/skin_default/lock.png create mode 100644 data/skin_default/lockBouquet.png create mode 100644 data/skin_default/unlock.png create mode 100644 data/skin_default/unlockBouquet.png mode change 100755 => 100644 lib/python/Components/ParentalControl.py mode change 100755 => 100644 lib/python/Screens/ParentalControlSetup.py (limited to 'lib/python/Components') diff --git a/data/skin_default/Makefile.am b/data/skin_default/Makefile.am index 9e9b7cd4..85bb800d 100755 --- a/data/skin_default/Makefile.am +++ b/data/skin_default/Makefile.am @@ -32,6 +32,8 @@ dist_install_DATA = \ expanded-plugins.png \ info-bg_mp.png \ info-bg.png \ + lock.png \ + lockBouquet.png \ mediaplayer_bg.png \ mute.png \ nim_active.png \ @@ -52,6 +54,8 @@ dist_install_DATA = \ timeline-now.png \ timeline.png \ unhandled-key.png \ + unlock.png \ + unlockBouquet.png \ verticalline-plugins.png \ vkey_backspace.png \ vkey_bg.png \ diff --git a/data/skin_default/lock.png b/data/skin_default/lock.png new file mode 100644 index 00000000..d0ae7f64 Binary files /dev/null and b/data/skin_default/lock.png differ diff --git a/data/skin_default/lockBouquet.png b/data/skin_default/lockBouquet.png new file mode 100644 index 00000000..d503dd2b Binary files /dev/null and b/data/skin_default/lockBouquet.png differ diff --git a/data/skin_default/unlock.png b/data/skin_default/unlock.png new file mode 100644 index 00000000..bd4486e9 Binary files /dev/null and b/data/skin_default/unlock.png differ diff --git a/data/skin_default/unlockBouquet.png b/data/skin_default/unlockBouquet.png new file mode 100644 index 00000000..c5d146d7 Binary files /dev/null and b/data/skin_default/unlockBouquet.png differ diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py old mode 100755 new mode 100644 index d68e01ff..4830d20a --- a/lib/python/Components/ParentalControl.py +++ b/lib/python/Components/ParentalControl.py @@ -1,19 +1,34 @@ -from Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigYesNo, ConfigSubList, ConfigInteger +from Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigText, ConfigYesNo, ConfigSubList, ConfigInteger +#from Screens.ChannelSelection import service_types_tv from Screens.InputBox import PinInput from Screens.MessageBox import MessageBox from Tools.BoundFunction import boundFunction from ServiceReference import ServiceReference from Tools import Notifications from Tools.Directories import resolveFilename, SCOPE_CONFIG +from enigma import eTimer +import time + +TYPE_SERVICE = "SERVICE" +TYPE_BOUQUETSERVICE = "BOUQUETSERVICE" +TYPE_BOUQUET = "BOUQUET" +LIST_BLACKLIST = "blacklist" +LIST_WHITELIST = "whitelist" + +IMG_WHITESERVICE = LIST_WHITELIST + "-" + TYPE_SERVICE +IMG_WHITEBOUQUET = LIST_WHITELIST + "-" + TYPE_BOUQUET +IMG_BLACKSERVICE = LIST_BLACKLIST + "-" + TYPE_SERVICE +IMG_BLACKBOUQUET = LIST_BLACKLIST + "-" + TYPE_BOUQUET def InitParentalControl(): config.ParentalControl = ConfigSubsection() config.ParentalControl.configured = ConfigYesNo(default = False) config.ParentalControl.mode = ConfigSelection(default = "simple", choices = [("simple", _("simple")), ("complex", _("complex"))]) - config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5_minutes", _("5 minutes")), ("30_minutes", _("30 minutes")), ("60_minutes", _("60 minutes")), ("restart", _("until restart"))]) + config.ParentalControl.storeservicepin = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))]) + config.ParentalControl.storeservicepincancel = ConfigSelection(default = "never", choices = [("never", _("never")), ("5", _("5 minutes")), ("30", _("30 minutes")), ("60", _("60 minutes")), ("standby", _("until standby/restart"))]) config.ParentalControl.servicepinactive = ConfigYesNo(default = False) config.ParentalControl.setuppinactive = ConfigYesNo(default = False) - config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [("whitelist", _("whitelist")), ("blacklist", _("blacklist"))]) + config.ParentalControl.type = ConfigSelection(default = "blacklist", choices = [(LIST_WHITELIST, _("whitelist")), (LIST_BLACKLIST, _("blacklist"))]) config.ParentalControl.setuppin = ConfigPIN(default = -1) config.ParentalControl.retries = ConfigSubsection() @@ -39,40 +54,58 @@ def InitParentalControl(): class ParentalControl: def __init__(self): - self.open() + #Do not call open on init, because bouquets are not ready at that moment +# self.open() self.serviceLevel = {} - - def addWhitelistService(self, service): - self.whitelist.append(service) + #Instead: Use Flags to see, if we already initialized config and called open + self.configInitialized = False + self.filesOpened = False + #This is the timer that is used to see, if the time for caching the pin is over + #Of course we could also work without a timer and compare the times every + #time we call isServicePlayable. But this might probably slow down zapping, + #That's why I decided to use a timer + self.sessionPinTimer = eTimer() + self.sessionPinTimer.callback.append(self.resetSessionPin) - def addBlacklistService(self, service): - self.blacklist.append(service) - - def setServiceLevel(self, service, level): - self.serviceLevel[service] = level - - def deleteWhitelistService(self, service): - self.whitelist.remove(service) - if self.serviceLevel.has_key(service): - self.serviceLevel.remove(service) + def serviceMethodWrapper(self, service, method, *args): + #This method is used to call all functions that need a service as Parameter: + #It takes either a Service- Reference or a Bouquet- Reference and passes + #Either the service or all services contained in the bouquet to the method given + #That way all other functions do not need to distinguish between service and bouquet. + if "FROM BOUQUET" in service: + method( service , TYPE_BOUQUET , *args ) + servicelist = self.readServicesFromBouquet(service,"C") + for ref in servicelist: + sRef = str(ref[0]) + method( sRef , TYPE_BOUQUETSERVICE , *args ) + else: + ref = ServiceReference(service) + sRef = str(ref) + method( sRef , TYPE_SERVICE , *args ) - def deleteBlacklistService(self, service): - self.blacklist.remove(service) - if self.serviceLevel.has_key(service): - self.serviceLevel.remove(service) + def setServiceLevel(self, service, type, level): + self.serviceLevel[service] = level def isServicePlayable(self, ref, callback): if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value: return True - #print "whitelist:", self.whitelist - #print "blacklist:", self.blacklist - #print "config.ParentalControl.type.value:", config.ParentalControl.type.value - #print "not in whitelist:", (service not in self.whitelist) - #print "checking parental control for service:", ref.toString() + #Check if we already read the whitelists and blacklists. If not: call open + if self.filesOpened == False: + self.open() + #Check if configuration has already been read or if the significant values have changed. + #If true: read the configuration + if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value or self.storeServicePinCancel != config.ParentalControl.storeservicepincancel.value: + self.getConfigValues() service = ref.toCompareString() - if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist): + if (config.ParentalControl.type.value == LIST_WHITELIST and not self.whitelist.has_key(service)) or (config.ParentalControl.type.value == LIST_BLACKLIST and self.blacklist.has_key(service)): + #Check if the session pin is cached and return the cached value, if it is. + if self.sessionPinCached == True: + #As we can cache successful pin- entries as well as canceled pin- entries, + #We give back the last action + return self.sessionPinCachedValue self.callback = callback - #print "service:", ServiceReference(service).getServiceName() + #Someone started to implement different levels of protection. Seems they were never completed + #I did not throw out this code, although it is of no use at the moment levelNeeded = 0 if self.serviceLevel.has_key(service): levelNeeded = self.serviceLevel[service] @@ -83,103 +116,214 @@ class ParentalControl: return True def protectService(self, service): - #print "protect" - #print "config.ParentalControl.type.value:", config.ParentalControl.type.value - if config.ParentalControl.type.value == "whitelist": - if service in self.whitelist: - self.deleteWhitelistService(service) + if config.ParentalControl.type.value == LIST_WHITELIST: + if self.whitelist.has_key(service): + self.serviceMethodWrapper(service, self.removeServiceFromList, self.whitelist) + #self.deleteWhitelistService(service) else: # blacklist - if service not in self.blacklist: - self.addBlacklistService(service) + if not self.blacklist.has_key(service): + self.serviceMethodWrapper(service, self.addServiceToList, self.blacklist) + #self.addBlacklistService(service) #print "whitelist:", self.whitelist #print "blacklist:", self.blacklist - def unProtectService(self, service): #print "unprotect" #print "config.ParentalControl.type.value:", config.ParentalControl.type.value - if config.ParentalControl.type.value == "whitelist": - if service not in self.whitelist: - self.addWhitelistService(service) + if config.ParentalControl.type.value == LIST_WHITELIST: + if not self.whitelist.has_key(service): + self.serviceMethodWrapper(service, self.addServiceToList, self.whitelist) + #self.addWhitelistService(service) else: # blacklist - if service in self.blacklist: - self.deleteBlacklistService(service) + if self.blacklist.has_key(service): + self.serviceMethodWrapper(service, self.removeServiceFromList, self.blacklist) + #self.deleteBlacklistService(service) #print "whitelist:", self.whitelist #print "blacklist:", self.blacklist def getProtectionLevel(self, service): - if (config.ParentalControl.type.value == "whitelist" and service not in self.whitelist) or (config.ParentalControl.type.value == "blacklist" and service in self.blacklist): + if (config.ParentalControl.type.value == LIST_WHITELIST and not self.whitelist.has_key(service)) or (config.ParentalControl.type.value == LIST_BLACKLIST and self.blacklist.has_key(service)): if self.serviceLevel.has_key(service): return self.serviceLevel[service] else: return 0 else: return -1 + + def getProtectionType(self, service): + #New method used in ParentalControlList: This method does not only return + #if a service is protected or not, it also returns, why (whitelist or blacklist, service or bouquet) + if self.filesOpened == False: + self.open() + sImage = "" + if (config.ParentalControl.type.value == LIST_WHITELIST): + if self.whitelist.has_key(service): + if TYPE_SERVICE in self.whitelist[service]: + sImage = IMG_WHITESERVICE + else: + sImage = IMG_WHITEBOUQUET + elif (config.ParentalControl.type.value == LIST_BLACKLIST): + if self.blacklist.has_key(service): + if TYPE_SERVICE in self.blacklist[service]: + sImage = IMG_BLACKSERVICE + else: + sImage = IMG_BLACKBOUQUET + bLocked = self.getProtectionLevel(service) != -1 + return (bLocked,sImage) + + def getConfigValues(self): + #Read all values from configuration + self.checkPinInterval = False + self.checkPinIntervalCancel = False + self.checkSessionPin = False + self.checkSessionPinCancel = False + + self.sessionPinCached = False + self.pinIntervalSeconds = 0 + self.pinIntervalSecondsCancel = 0 + + self.storeServicePin = config.ParentalControl.storeservicepin.value + self.storeServicePinCancel = config.ParentalControl.storeservicepincancel.value + + if self.storeServicePin == "never": + pass + elif self.storeServicePin == "standby": + self.checkSessionPin = True + else: + self.checkPinInterval = True + iMinutes = float(self.storeServicePin) + iSeconds = iMinutes*60 + self.pinIntervalSeconds = iSeconds + + if self.storeServicePinCancel == "never": + pass + elif self.storeServicePinCancel == "standby": + self.checkSessionPinCancel = True + else: + self.checkPinIntervalCancel = True + iMinutes = float(self.storeServicePinCancel) + iSeconds = iMinutes*60 + self.pinIntervalSecondsCancel = iSeconds + self.configInitialized = True + # Reset PIN cache on standby: Use StandbyCounter- Config- Callback + config.misc.standbyCounter.addNotifier(self.standbyCounterCallback, initial_call = False) + + def standbyCounterCallback(self, configElement): + self.resetSessionPin() + + def resetSessionPin(self): + #Reset the session pin, stop the timer + self.sessionPinCached = False + self.sessionPinTimer.stop() + + def getCurrentTimeStamp(self): + return time.time() + def getPinList(self): return [ x.value for x in config.ParentalControl.servicepin ] - + def servicePinEntered(self, service, result): -# levelNeeded = 0 - #if self.serviceLevel.has_key(service): - #levelNeeded = self.serviceLevel[service] -# - #print "getPinList():", self.getPinList() - #pinList = self.getPinList()[:levelNeeded + 1] - #print "pinList:", pinList -# -# print "pin entered for service", service, "and pin was", pin - #if pin is not None and int(pin) in pinList: + if result is not None and result: - #print "pin ok, playing service" + #This is the new function of caching the service pin + #save last session and time of last entered pin... + if self.checkSessionPin == True: + self.sessionPinCached = True + self.sessionPinCachedValue = True + if self.checkPinInterval == True: + self.sessionPinCached = True + self.sessionPinCachedValue = True + self.sessionPinTimer.start(self.pinIntervalSeconds*1000,1) self.callback(ref = service) else: + #This is the new function of caching cancelling of service pin if result is not None: Notifications.AddNotification(MessageBox, _("The pin code you entered is wrong."), MessageBox.TYPE_ERROR) - #print "wrong pin entered" + else: + if self.checkSessionPinCancel == True: + self.sessionPinCached = True + self.sessionPinCachedValue = False + if self.checkPinIntervalCancel == True: + self.sessionPinCached = True + self.sessionPinCachedValue = False + self.sessionPinTimer.start(self.pinIntervalSecondsCancel*1000,1) - def saveWhitelist(self): - file = open(resolveFilename(SCOPE_CONFIG, "whitelist"), 'w') - for x in self.whitelist: - file.write(x + "\n") - file.close - - def openWhitelist(self): - self.whitelist = [] - try: - file = open(resolveFilename(SCOPE_CONFIG, "whitelist"), 'r') - lines = file.readlines() - for x in lines: - ref = ServiceReference(x.strip()) - self.whitelist.append(str(ref)) - file.close - except: - pass - - def saveBlacklist(self): - file = open(resolveFilename(SCOPE_CONFIG, "blacklist"), 'w') - for x in self.blacklist: - file.write(x + "\n") + def saveListToFile(self,sWhichList): + #Replaces saveWhiteList and saveBlackList: + #I don't like to have two functions with identical code... + if sWhichList == LIST_BLACKLIST: + vList = self.blacklist + else: + vList = self.whitelist + file = open(resolveFilename(SCOPE_CONFIG, sWhichList), 'w') + for sService,sType in vList.iteritems(): + #Only Services that are selected directly and Bouqets are saved. + #Services that are added by a bouquet are not saved. + #This is the reason for the change in self.whitelist and self.blacklist + if TYPE_SERVICE in sType or TYPE_BOUQUET in sType: + file.write(str(sService) + "\n") file.close - def openBlacklist(self): - self.blacklist = [] + def openListFromFile(self,sWhichList): + #Replaces openWhiteList and openBlackList: + #I don't like to have two functions with identical code... + if sWhichList == LIST_BLACKLIST: + self.blacklist = {} + vList = self.blacklist + else: + self.whitelist = {} + vList = self.whitelist try: - file = open(resolveFilename(SCOPE_CONFIG, "blacklist"), 'r') + file = open(resolveFilename(SCOPE_CONFIG, sWhichList ), 'r') lines = file.readlines() for x in lines: - ref = ServiceReference(x.strip()) - self.blacklist.append(str(ref)) + sPlain = x.strip() + self.serviceMethodWrapper(sPlain, self.addServiceToList, vList) file.close except: pass + + def addServiceToList(self, service, type, vList): + #Replaces addWhitelistService and addBlacklistService + #The lists are not only lists of service references any more. + #They are named lists with the service as key and an array of types as value: + + if vList.has_key(service): + if not type in vList[service]: + vList[service].append(type) + else: + vList[service] = [type] + + def removeServiceFromList(self, service, type, vList): + #Replaces deleteWhitelistService and deleteBlacklistService + if vList.has_key(service): + if type in vList[service]: + vList[service].remove(type) + if not vList[service]: + del vList[service] + if self.serviceLevel.has_key(service): + self.serviceLevel.remove(service) + + def readServicesFromBouquet(self,sBouquetSelection,formatstring): + #This method gives back a list of services for a given bouquet + from enigma import eServiceCenter, eServiceReference + from Screens.ChannelSelection import service_types_tv + serviceHandler = eServiceCenter.getInstance() + refstr = sBouquetSelection + root = eServiceReference(refstr) + list = serviceHandler.list(root) + if list is not None: + services = list.getContent("CN", True) #(servicecomparestring, name) + return services def save(self): - self.saveBlacklist() - self.saveWhitelist() + self.saveListToFile(LIST_BLACKLIST) + self.saveListToFile(LIST_WHITELIST) def open(self): - self.openBlacklist() - self.openWhitelist() + self.openListFromFile(LIST_BLACKLIST) + self.openListFromFile(LIST_WHITELIST) + self.filesOpened = True parentalControl = ParentalControl() diff --git a/lib/python/Components/ParentalControlList.py b/lib/python/Components/ParentalControlList.py index 128e6d3e..797ea391 100644 --- a/lib/python/Components/ParentalControlList.py +++ b/lib/python/Components/ParentalControlList.py @@ -1,19 +1,28 @@ from MenuList import MenuList -from Components.ParentalControl import parentalControl +from Components.ParentalControl import parentalControl, IMG_WHITESERVICE, IMG_WHITEBOUQUET, IMG_BLACKSERVICE, IMG_BLACKBOUQUET from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT from Tools.LoadPixmap import LoadPixmap -lockPicture = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/lock.png")) +#Now there is a list of pictures instead of one... +entryPicture = {} -def ParentalControlEntryComponent(service, name, locked = True): +entryPicture[IMG_BLACKSERVICE] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/lock.png")) +entryPicture[IMG_BLACKBOUQUET] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/lockBouquet.png")) +entryPicture[IMG_WHITESERVICE] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/unlock.png")) +entryPicture[IMG_WHITEBOUQUET] = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/unlockBouquet.png")) + +def ParentalControlEntryComponent(service, name, protectionType): + locked = protectionType[0] + sImage = protectionType[1] res = [ (service, name, locked), (eListboxPythonMultiContent.TYPE_TEXT, 80, 5, 300, 50, 0, RT_HALIGN_LEFT, name) ] - if locked: - res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 32, 32, lockPicture)) + #Changed logic: The image is defined by sImage, not by locked anymore + if sImage != "": + res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 32, 32, entryPicture[sImage])) return res class ParentalControlList(MenuList): @@ -25,9 +34,11 @@ class ParentalControlList(MenuList): def toggleSelectedLock(self): print "self.l.getCurrentSelection():", self.l.getCurrentSelection() print "self.l.getCurrentSelectionIndex():", self.l.getCurrentSelectionIndex() - self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(self.l.getCurrentSelection()[0][0], self.l.getCurrentSelection()[0][1], not self.l.getCurrentSelection()[0][2]); - if self.l.getCurrentSelection()[0][2]: - parentalControl.protectService(self.l.getCurrentSelection()[0][0]) + curSel = self.l.getCurrentSelection() + if curSel[0][2]: + parentalControl.unProtectService(self.l.getCurrentSelection()[0][0]) else: - parentalControl.unProtectService(self.l.getCurrentSelection()[0][0]) + parentalControl.protectService(self.l.getCurrentSelection()[0][0]) + #Instead of just negating the locked- flag, now I call the getProtectionType every time... + self.list[self.l.getCurrentSelectionIndex()] = ParentalControlEntryComponent(curSel[0][0], curSel[0][1], parentalControl.getProtectionType(curSel[0][0])) self.l.setList(self.list) diff --git a/lib/python/Screens/ParentalControlSetup.py b/lib/python/Screens/ParentalControlSetup.py old mode 100755 new mode 100644 index a123d2d3..2bf4841e --- a/lib/python/Screens/ParentalControlSetup.py +++ b/lib/python/Screens/ParentalControlSetup.py @@ -16,7 +16,7 @@ from operator import itemgetter class ProtectedScreen: def __init__(self): if self.isProtected(): - self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.protectedWithPin()], triesEntry = self.getTriesEntry(), title = self.getPinText(), windowTitle = _("Change pin code"))) + self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.protectedWithPin()], triesEntry = self.getTriesEntry(), title = self.getPinText(), windowTitle = _("Enter pin code"))) def getTriesEntry(self): return config.ParentalControl.retries.setuppin @@ -48,11 +48,11 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): self.list = [] ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry) self.createSetup() - + self["actions"] = NumberActionMap(["SetupActions"], { - "cancel": self.keyCancel, - "save": self.keyCancel + "cancel": self.keyCancel, + "save": self.keyCancel }, -2) self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("OK")) @@ -63,12 +63,12 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): def isProtected(self): return config.ParentalControl.setuppinactive.value and config.ParentalControl.configured.value - + def createSetup(self): self.editListEntry = None self.changePin = None self.changeSetupPin = None - + self.list = [] self.list.append(getConfigListEntry(_("Enable parental control"), config.ParentalControl.configured)) print "config.ParentalControl.configured.value", config.ParentalControl.configured.value @@ -87,10 +87,19 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): elif config.ParentalControl.mode.value == "simple": self.changePin = getConfigListEntry(_("Change service pin"), NoSave(ConfigNothing())) self.list.append(self.changePin) - #self.list.append(getConfigListEntry(_("Remember service pin"), config.ParentalControl.storeservicepin)) + #Added Option to remember the service pin + self.list.append(getConfigListEntry(_("Remember service pin"), config.ParentalControl.storeservicepin)) + #Added Option to remember the cancellation of service pin entry + self.list.append(getConfigListEntry(_("Remember service pin cancel"), config.ParentalControl.storeservicepincancel)) self.editListEntry = getConfigListEntry(_("Edit services list"), NoSave(ConfigNothing())) self.list.append(self.editListEntry) - + #New funtion: Possibility to add Bouquets to whitelist / blacklist + self.editBouquetListEntry = getConfigListEntry(_("Edit bouquets list"), NoSave(ConfigNothing())) + self.list.append(self.editBouquetListEntry) + #New option to reload service lists (for example if bouquets have changed) + self.reloadLists = getConfigListEntry(_("Reload Black-/Whitelists"), NoSave(ConfigNothing())) + self.list.append(self.reloadLists) + self["config"].list = self.list self["config"].setList(self.list) @@ -98,6 +107,8 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): print "self[\"config\"].l.getCurrentSelection()", self["config"].l.getCurrentSelection() if self["config"].l.getCurrentSelection() == self.editListEntry: self.session.open(ParentalControlEditor) + elif self["config"].l.getCurrentSelection() == self.editBouquetListEntry: + self.session.open(ParentalControlBouquetEditor) elif self["config"].l.getCurrentSelection() == self.changePin: if config.ParentalControl.mode.value == "complex": pass @@ -105,6 +116,8 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service pin")) elif self["config"].l.getCurrentSelection() == self.changeSetupPin: self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup pin")) + elif self["config"].l.getCurrentSelection() == self.reloadLists: + parentalControl.open() else: ConfigListScreen.keyRight(self) print "current selection:", self["config"].l.getCurrentSelection() @@ -149,6 +162,7 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): def keyNumberGlobal(self, number): pass + # for summary: def changedEntry(self): for x in self.onChangedEntry: @@ -224,13 +238,13 @@ class ParentalControlEditor(Screen): if not self.servicesList.has_key(key): self.servicesList[key] = [] self.servicesList[key].append(s) - + def chooseLetter(self): print "choose letter" mylist = [] for x in self.servicesList.keys(): if x == chr(SPECIAL_CHAR): - x = ("special characters", x) + x = (_("special characters"), x) else: x = (x, x) mylist.append(x) @@ -242,12 +256,51 @@ class ParentalControlEditor(Screen): if result is not None: print "result:", result self.currentLetter = result[1] - self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionLevel(x[0]) != -1) for x in self.servicesList[result[1]]] + #Replace getProtectionLevel by new getProtectionType + self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionType(x[0])) for x in self.servicesList[result[1]]] self.servicelist.setList(self.list) else: parentalControl.save() self.close() +class ParentalControlBouquetEditor(Screen): + #This new class allows adding complete bouquets to black- and whitelists + #The servicereference that is stored for bouquets is their refstr as listed in bouquets.tv + def __init__(self, session): + Screen.__init__(self, session) + self.skinName = "ParentalControlEditor" + self.list = [] + self.bouquetslist = ParentalControlList(self.list) + self["servicelist"] = self.bouquetslist; + self.readBouquetList() + self.onLayoutFinish.append(self.selectBouquet) + + self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"], + { + "ok": self.select, + "cancel": self.cancel + }, -1) + + def cancel(self): + parentalControl.save() + self.close() + + def select(self): + self.bouquetslist.toggleSelectedLock() + + def readBouquetList(self): + serviceHandler = eServiceCenter.getInstance() + refstr = '1:134:1:0:0:0:0:0:0:0:FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet' + bouquetroot = eServiceReference(refstr) + self.bouquetlist = {} + list = serviceHandler.list(bouquetroot) + if list is not None: + self.bouquetlist = list.getContent("CN", True) + + def selectBouquet(self): + self.list = [ParentalControlEntryComponent(x[0], x[1], parentalControl.getProtectionType(x[0])) for x in self.bouquetlist] + self.bouquetslist.setList(self.list) + class ParentalControlChangePin(Screen, ConfigListScreen, ProtectedScreen): def __init__(self, session, pin, pinname): Screen.__init__(self, session) @@ -264,12 +317,12 @@ class ParentalControlChangePin(Screen, ConfigListScreen, ProtectedScreen): self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2)) self.list.append(getConfigListEntry(_("New pin"), NoSave(self.pin1))) self.list.append(getConfigListEntry(_("Reenter new pin"), NoSave(self.pin2))) - ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry) + ConfigListScreen.__init__(self, self.list) # print "old pin:", pin #if pin.value != "aaaa": #self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code"))) ProtectedScreen.__init__(self) - + self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"], { "cancel": self.cancel, -- cgit v1.2.3 From 31037f2bac27fb9a592d63a09e1e9ef2792f8e7e Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 1 Mar 2010 01:47:26 +0100 Subject: fixes bug #381 some small fixes for the parental control functions --- lib/python/Components/ParentalControl.py | 3 +++ lib/python/Screens/ParentalControlSetup.py | 2 ++ 2 files changed, 5 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py index 4830d20a..9942bca7 100644 --- a/lib/python/Components/ParentalControl.py +++ b/lib/python/Components/ParentalControl.py @@ -318,6 +318,9 @@ class ParentalControl: return services def save(self): + # we need to open the files in case we havent's read them yet + if not self.filesOpened: + self.open() self.saveListToFile(LIST_BLACKLIST) self.saveListToFile(LIST_WHITELIST) diff --git a/lib/python/Screens/ParentalControlSetup.py b/lib/python/Screens/ParentalControlSetup.py index 2bf4841e..eae12da4 100644 --- a/lib/python/Screens/ParentalControlSetup.py +++ b/lib/python/Screens/ParentalControlSetup.py @@ -72,6 +72,8 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen): self.list = [] self.list.append(getConfigListEntry(_("Enable parental control"), config.ParentalControl.configured)) print "config.ParentalControl.configured.value", config.ParentalControl.configured.value + self.editBouquetListEntry = -1 + self.reloadLists = -1 if config.ParentalControl.configured.value: #self.list.append(getConfigListEntry(_("Configuration mode"), config.ParentalControl.mode)) self.list.append(getConfigListEntry(_("Protect setup"), config.ParentalControl.setuppinactive)) -- cgit v1.2.3 From f9ebb7117c782cd7687523abc8bdccfe8153290e Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 1 Mar 2010 19:37:57 +0100 Subject: fix no more turning positioner after leave positioner setup in some cases this fixes bug #321 --- lib/dvb/frontend.cpp | 19 +++++++++++++++++-- lib/dvb/frontend.h | 1 + lib/dvb/sec.cpp | 5 +++++ lib/python/Components/TuneTest.py | 5 +++-- .../Plugins/SystemPlugins/PositionerSetup/plugin.py | 2 +- 5 files changed, 27 insertions(+), 5 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index c0263fb4..f85a37fe 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -455,7 +455,7 @@ int eDVBFrontend::PriorityOrder=0; eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate) :m_simulate(simulate), m_enabled(false), m_type(-1), m_dvbid(fe), m_slotid(fe) - ,m_fd(-1), m_need_rotor_workaround(false), m_can_handle_dvbs2(false) + ,m_fd(-1), m_rotor_mode(false), m_need_rotor_workaround(false), m_can_handle_dvbs2(false) ,m_state(stateClosed), m_timeout(0), m_tuneTimer(0) #if HAVE_DVB_API_VERSION < 3 ,m_secfd(-1) @@ -692,7 +692,8 @@ void eDVBFrontend::feEvent(int w) { eDebug("stateLostLock"); state = stateLostLock; - sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc + if (!m_rotor_mode) + sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc } } if (m_state != state) @@ -2343,6 +2344,20 @@ RESULT eDVBFrontend::tune(const iDVBFrontendParameters &where) res = -EINVAL; goto tune_error; } + if (m_rotor_mode != feparm.no_rotor_command_on_tune && !feparm.no_rotor_command_on_tune) + { + eDVBFrontend *sec_fe = this; + long tmp = m_data[LINKED_PREV_PTR]; + while (tmp != -1) + { + eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*)tmp; + sec_fe = linked_fe->m_frontend; + sec_fe->getData(LINKED_NEXT_PTR, tmp); + } + eDebug("(fe%d) reset diseqc after leave rotor mode!", m_dvbid); + sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = sec_fe->m_data[ROTOR_CMD] = sec_fe->m_data[ROTOR_POS] = -1; // reset diseqc + } + m_rotor_mode = feparm.no_rotor_command_on_tune; if (!m_simulate) m_sec->setRotorMoving(m_slotid, false); res=prepare_sat(feparm, timeout); diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h index bac27539..4cf05081 100644 --- a/lib/dvb/frontend.h +++ b/lib/dvb/frontend.h @@ -75,6 +75,7 @@ private: int m_dvbid; int m_slotid; int m_fd; + bool m_rotor_mode; bool m_need_rotor_workaround; bool m_can_handle_dvbs2; char m_filename[128]; diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 91246889..44cbe709 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -156,6 +156,11 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite ret = 15000; } + if (sat.no_rotor_command_on_tune && !rotor) { + eSecDebugNoSimulate("no rotor but no_rotor_command_on_tune is set.. ignore lnb %d", idx); + continue; + } + eSecDebugNoSimulate("ret1 %d", ret); if (linked_in_use) diff --git a/lib/python/Components/TuneTest.py b/lib/python/Components/TuneTest.py index f9ab3edb..44b19091 100644 --- a/lib/python/Components/TuneTest.py +++ b/lib/python/Components/TuneTest.py @@ -1,8 +1,9 @@ from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParameters, eDVBResourceManager, eTimer class Tuner: - def __init__(self, frontend): + def __init__(self, frontend, ignore_rotor=False): self.frontend = frontend + self.ignore_rotor = ignore_rotor # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation, rolloff, pilot, tsid, onid) # 0 1 2 3 4 5 6 7 8 9 10 11 @@ -21,7 +22,7 @@ class Tuner: parm.rolloff = transponder[8] parm.pilot = transponder[9] feparm = eDVBFrontendParameters() - feparm.setDVBS(parm) + feparm.setDVBS(parm, self.ignore_rotor) self.lastparm = feparm self.frontend.tune(feparm) diff --git a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py index fa533c0b..3cc9e751 100644 --- a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py +++ b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py @@ -77,7 +77,7 @@ class PositionerSetup(Screen): self.frontendStatus = { } self.diseqc = Diseqc(self.frontend) - self.tuner = Tuner(self.frontend) + self.tuner = Tuner(self.frontend, True) #True means we dont like that the normal sec stuff sends commands to the rotor! tp = ( cur.get("frequency", 0) / 1000, cur.get("symbol_rate", 0) / 1000, -- cgit v1.2.3 From b9078822ea1ab5a65389532b3f34c2a26e4660bb Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 4 Mar 2010 00:19:21 +0100 Subject: fixes bug #460 allow setting a timer end time for zapping timers zapping timers with no end time set end right after the zapping timer was started now, so no conflicts with other timers occur that the user doesn't expect --- lib/python/Components/TimerList.py | 10 ++++++++-- lib/python/Screens/TimerEntry.py | 23 +++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 2a7405df..30097c96 100755 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -33,12 +33,18 @@ class TimerList(HTMLComponent, GUIComponent, object): count += 1 flags = flags >> 1 if timer.justplay: - res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s "+ _("(ZAP)")) % (FuzzyTime(timer.begin)[1])))) + if timer.end - timer.begin < 4: # rounding differences + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s "+ _("(ZAP)")) % (FuzzyTime(timer.begin)[1])))) + else: + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s ... %s (%d " + _("mins") + ") ") % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1], (timer.end - timer.begin) / 60)) + _("(ZAP)"))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ((" %s ... %s (%d " + _("mins") + ")") % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1], (timer.end - timer.begin) / 60)))) else: if timer.justplay: - res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s " + _("(ZAP)")) % (FuzzyTime(timer.begin))))) + if timer.end - timer.begin < 4: + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s " + _("(ZAP)")) % (FuzzyTime(timer.begin))))) + else: + res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s ... %s (%d " + _("mins") + ") ") % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:] + ((timer.end - timer.begin) / 60,))) + _("(ZAP)"))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, width-150, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (("%s, %s ... %s (%d " + _("mins") + ")") % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:] + ((timer.end - timer.begin) / 60,))))) diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py index b231b568..64fa9f19 100644 --- a/lib/python/Screens/TimerEntry.py +++ b/lib/python/Screens/TimerEntry.py @@ -106,10 +106,11 @@ class TimerEntry(Screen, ConfigListScreen): self.timerentry_tagsset = ConfigSelection(choices = [not self.timerentry_tags and "None" or " ".join(self.timerentry_tags)]) self.timerentry_repeated = ConfigSelection(default = repeated, choices = [("daily", _("daily")), ("weekly", _("weekly")), ("weekdays", _("Mon-Fri")), ("user", _("user defined"))]) - + self.timerentry_date = ConfigDateTime(default = self.timer.begin, formatstring = _("%d.%B %Y"), increment = 86400) self.timerentry_starttime = ConfigClock(default = self.timer.begin) self.timerentry_endtime = ConfigClock(default = self.timer.end) + self.timerentry_showendtime = ConfigSelection(default = ((self.timer.end - self.timer.begin) > 4), choices = [(True, _("yes")), (False, _("no"))]) default = self.timer.dirname or defaultMoviePath() tmp = config.movielist.videodirs.value @@ -172,11 +173,14 @@ class TimerEntry(Screen, ConfigListScreen): self.entryStartTime = getConfigListEntry(_("StartTime"), self.timerentry_starttime) self.list.append(self.entryStartTime) - if self.timerentry_justplay.value != "zap": - self.entryEndTime = getConfigListEntry(_("EndTime"), self.timerentry_endtime) + + self.entryShowEndTime = getConfigListEntry(_("Set End Time"), self.timerentry_showendtime) + if self.timerentry_justplay.value == "zap": + self.list.append(self.entryShowEndTime) + self.entryEndTime = getConfigListEntry(_("EndTime"), self.timerentry_endtime) + if self.timerentry_justplay.value != "zap" or self.timerentry_showendtime.value: self.list.append(self.entryEndTime) - else: - self.entryEndTime = None + self.channelEntry = getConfigListEntry(_("Channel"), self.timerentry_service) self.list.append(self.channelEntry) @@ -194,11 +198,7 @@ class TimerEntry(Screen, ConfigListScreen): def newConfig(self): print "newConfig", self["config"].getCurrent() - if self["config"].getCurrent() == self.timerTypeEntry: - self.createSetup("config") - if self["config"].getCurrent() == self.timerJustplayEntry: - self.createSetup("config") - if self["config"].getCurrent() == self.frequencyEntry: + if self["config"].getCurrent() in (self.timerTypeEntry, self.timerJustplayEntry, self.frequencyEntry, self.entryShowEndTime): self.createSetup("config") def keyLeft(self): @@ -268,6 +268,9 @@ class TimerEntry(Screen, ConfigListScreen): self.timer.name = self.timerentry_name.value self.timer.description = self.timerentry_description.value self.timer.justplay = self.timerentry_justplay.value == "zap" + if self.timerentry_justplay.value == "zap": + if not self.timerentry_showendtime.value: + self.timerentry_endtime.value = self.timerentry_starttime.value self.timer.resetRepeated() self.timer.afterEvent = { "nothing": AFTEREVENT.NONE, -- cgit v1.2.3 From a35c57a736086abaef5a82e2e117a12e3a79b273 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 8 Mar 2010 15:40:35 +0100 Subject: refs bug #429 remove some absolute paths --- lib/python/Components/Harddisk.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 03f574f3..e8e612a4 100755 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -166,7 +166,7 @@ class Harddisk: lines = mounts.readlines() mounts.close() - cmd = "/bin/umount" + cmd = "umount" for line in lines: parts = line.strip().split(" ") @@ -177,12 +177,12 @@ class Harddisk: return (res >> 8) def createPartition(self): - cmd = 'printf "0,\n;\n;\n;\ny\n" | /sbin/sfdisk -f ' + self.disk_path + cmd = 'printf "0,\n;\n;\n;\ny\n" | sfdisk -f ' + self.disk_path res = system(cmd) return (res >> 8) def mkfs(self): - cmd = "/sbin/mkfs.ext3 " + cmd = "mkfs.ext3 " if self.diskSize() > 4 * 1024: cmd += "-T largefile " cmd += "-m0 -O dir_index " + self.partitionPath("1") @@ -202,7 +202,7 @@ class Harddisk: for line in lines: parts = line.strip().split(" ") if path.realpath(parts[0]) == self.partitionPath("1"): - cmd = "/bin/mount -t ext3 " + parts[0] + cmd = "mount -t ext3 " + parts[0] res = system(cmd) break @@ -218,7 +218,7 @@ class Harddisk: def fsck(self): # We autocorrect any failures # TODO: we could check if the fs is actually ext3 - cmd = "/sbin/fsck.ext3 -f -p " + self.partitionPath("1") + cmd = "fsck.ext3 -f -p " + self.partitionPath("1") res = system(cmd) return (res >> 8) @@ -226,7 +226,7 @@ class Harddisk: part = self.partitionPath(n) if access(part, 0): - cmd = '/bin/dd bs=512 count=3 if=/dev/zero of=' + part + cmd = 'dd bs=512 count=3 if=/dev/zero of=' + part res = system(cmd) else: res = 0 -- cgit v1.2.3 From bb4afcfbede3c7e04bc6c9213818cc5d9a60887c Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 8 Mar 2010 16:16:28 +0100 Subject: refs bug #429 use PATH variable to determine, if an executable file exists instead of just parsing the command string for a leading / --- lib/python/Components/Task.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index df94f8a6..86bd233e 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -370,12 +370,14 @@ class DiskspacePrecondition(Condition): class ToolExistsPrecondition(Condition): def check(self, task): import os - if task.cmd[0]=='/': - realpath = task.cmd - else: - realpath = task.cwd + '/' + task.cmd - self.realpath = realpath - return os.access(realpath, os.X_OK) + + self.realpath = task.cmd + path = os.environ.get('PATH', '').split(os.pathsep) + absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) + if len(absolutes) > 0: + self.realpath = task.cmd[0] + return True + return False def getErrorMessage(self, task): return _("A required tool (%s) was not found.") % (self.realpath) -- cgit v1.2.3 From 46987d3de4111d3ccdbfe615b9f3f9f489941b23 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 8 Mar 2010 16:18:50 +0100 Subject: fixes bug #429 remove some absolute paths --- lib/python/Components/Network.py | 2 +- lib/python/Plugins/Extensions/DVDBurn/Process.py | 36 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 29491cb0..b9da48d8 100755 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -14,7 +14,7 @@ class Network: self.NetworkState = 0 self.DnsState = 0 self.nameservers = [] - self.ethtool_bin = "/usr/sbin/ethtool" + self.ethtool_bin = "ethtool" self.container = eConsoleAppContainer() self.Console = Console() self.LinkConsole = Console() diff --git a/lib/python/Plugins/Extensions/DVDBurn/Process.py b/lib/python/Plugins/Extensions/DVDBurn/Process.py index 642a898d..f7f44db6 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/Process.py +++ b/lib/python/Plugins/Extensions/DVDBurn/Process.py @@ -5,7 +5,7 @@ from Screens.MessageBox import MessageBox class png2yuvTask(Task): def __init__(self, job, inputfile, outputfile): Task.__init__(self, job, "Creating menu video") - self.setTool("/usr/bin/png2yuv") + self.setTool("png2yuv") self.args += ["-n1", "-Ip", "-f25", "-j", inputfile] self.dumpFile = outputfile self.weighting = 15 @@ -21,7 +21,7 @@ class png2yuvTask(Task): class mpeg2encTask(Task): def __init__(self, job, inputfile, outputfile): Task.__init__(self, job, "Encoding menu video") - self.setTool("/usr/bin/mpeg2enc") + self.setTool("mpeg2enc") self.args += ["-f8", "-np", "-a2", "-o", outputfile] self.inputFile = inputfile self.weighting = 25 @@ -36,7 +36,7 @@ class mpeg2encTask(Task): class spumuxTask(Task): def __init__(self, job, xmlfile, inputfile, outputfile): Task.__init__(self, job, "Muxing buttons into menu") - self.setTool("/usr/bin/spumux") + self.setTool("spumux") self.args += [xmlfile] self.inputFile = inputfile self.dumpFile = outputfile @@ -54,7 +54,7 @@ class spumuxTask(Task): class MakeFifoNode(Task): def __init__(self, job, number): Task.__init__(self, job, "Make FIFO nodes") - self.setTool("/bin/mknod") + self.setTool("mknod") nodename = self.job.workspace + "/dvd_title_%d" % number + ".mpg" self.args += [nodename, "p"] self.weighting = 10 @@ -62,14 +62,14 @@ class MakeFifoNode(Task): class LinkTS(Task): def __init__(self, job, sourcefile, link_name): Task.__init__(self, job, "Creating symlink for source titles") - self.setTool("/bin/ln") + self.setTool("ln") self.args += ["-s", sourcefile, link_name] self.weighting = 10 class CopyMeta(Task): def __init__(self, job, sourcefile): Task.__init__(self, job, "Copy title meta files") - self.setTool("/bin/cp") + self.setTool("cp") from os import listdir path, filename = sourcefile.rstrip("/").rsplit("/",1) tsfiles = listdir(path) @@ -84,7 +84,7 @@ class DemuxTask(Task): Task.__init__(self, job, "Demux video into ES") title = job.project.titles[job.i] self.global_preconditions.append(DiskspacePrecondition(title.estimatedDiskspace)) - self.setTool("/usr/bin/projectx") + self.setTool("projectx") self.args += [inputfile, "-demux", "-out", self.job.workspace ] self.end = 300 self.prog_state = 0 @@ -194,7 +194,7 @@ class MplexTask(Task): self.weighting = weighting self.demux_task = demux_task self.postconditions.append(MplexTaskPostcondition()) - self.setTool("/usr/bin/mplex") + self.setTool("mplex") self.args += ["-f8", "-o", outputfile, "-v1"] if inputfiles: self.args += inputfiles @@ -222,7 +222,7 @@ class RemoveESFiles(Task): def __init__(self, job, demux_task): Task.__init__(self, job, "Remove temp. files") self.demux_task = demux_task - self.setTool("/bin/rm") + self.setTool("rm") self.weighting = 10 def prepare(self): @@ -234,7 +234,7 @@ class DVDAuthorTask(Task): def __init__(self, job): Task.__init__(self, job, "Authoring DVD") self.weighting = 20 - self.setTool("/usr/bin/dvdauthor") + self.setTool("dvdauthor") self.CWD = self.job.workspace self.args += ["-x", self.job.workspace+"/dvdauthor.xml"] self.menupreview = job.menupreview @@ -255,7 +255,7 @@ class DVDAuthorTask(Task): class DVDAuthorFinalTask(Task): def __init__(self, job): Task.__init__(self, job, "dvdauthor finalize") - self.setTool("/usr/bin/dvdauthor") + self.setTool("dvdauthor") self.args += ["-T", "-o", self.job.workspace + "/dvd"] class WaitForResidentTasks(Task): @@ -292,7 +292,7 @@ class BurnTaskPostcondition(Condition): class BurnTask(Task): ERROR_NOTWRITEABLE, ERROR_LOAD, ERROR_SIZE, ERROR_WRITE_FAILED, ERROR_DVDROM, ERROR_ISOFS, ERROR_FILETOOLARGE, ERROR_ISOTOOLARGE, ERROR_MINUSRWBUG, ERROR_UNKNOWN = range(10) - def __init__(self, job, extra_args=[], tool="/bin/growisofs"): + def __init__(self, job, extra_args=[], tool="growisofs"): Task.__init__(self, job, job.name) self.weighting = 500 self.end = 120 # 100 for writing, 10 for buffer flush, 10 for closing disc @@ -357,7 +357,7 @@ class BurnTask(Task): class RemoveDVDFolder(Task): def __init__(self, job): Task.__init__(self, job, "Remove temp. files") - self.setTool("/bin/rm") + self.setTool("rm") self.args += ["-rf", self.job.workspace] self.weighting = 10 @@ -882,13 +882,13 @@ class DVDJob(Job): volName = self.project.settings.name.getValue() if output == "dvd": self.name = _("Burn DVD") - tool = "/bin/growisofs" + tool = "growisofs" burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ] if self.project.size/(1024*1024) > self.project.MAX_SL: burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ] elif output == "iso": self.name = _("Create DVD-ISO") - tool = "/usr/bin/mkisofs" + tool = "mkisofs" isopathfile = getISOfilename(self.project.settings.isopath.getValue(), volName) burnargs = [ "-o", isopathfile ] burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, self.workspace + "/dvd" ] @@ -920,14 +920,14 @@ class DVDdataJob(Job): output = self.project.settings.output.getValue() volName = self.project.settings.name.getValue() - tool = "/bin/growisofs" + tool = "growisofs" if output == "dvd": self.name = _("Burn DVD") burnargs = [ "-Z", "/dev/" + harddiskmanager.getCD(), "-dvd-compat" ] if self.project.size/(1024*1024) > self.project.MAX_SL: burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ] elif output == "iso": - tool = "/usr/bin/mkisofs" + tool = "mkisofs" self.name = _("Create DVD-ISO") isopathfile = getISOfilename(self.project.settings.isopath.getValue(), volName) burnargs = [ "-o", isopathfile ] @@ -959,5 +959,5 @@ class DVDisoJob(Job): if getSize(imagepath)/(1024*1024) > self.project.MAX_SL: burnargs += [ "-use-the-force-luke=4gms", "-speed=1", "-R" ] burnargs += [ "-dvd-video", "-publisher", "Dreambox", "-V", volName, imagepath ] - tool = "/bin/growisofs" + tool = "growisofs" BurnTask(self, burnargs, tool) -- cgit v1.2.3 From d0509622a73b8b84edf260599b853cab72903402 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 8 Mar 2010 17:25:37 +0100 Subject: refs bug #429 - allow absolute path names in Task.py but print a warning - search in task.cwd as well --- lib/python/Components/Task.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index 86bd233e..a1e04bce 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -371,12 +371,18 @@ class ToolExistsPrecondition(Condition): def check(self, task): import os - self.realpath = task.cmd - path = os.environ.get('PATH', '').split(os.pathsep) - absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) - if len(absolutes) > 0: - self.realpath = task.cmd[0] - return True + if task.cmd[0]=='/': + self.realpath = task.cmd + print "[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!" + return os.access(self.realpath, os.X_OK) + else: + self.realpath = task.cmd + path = os.environ.get('PATH', '').split(os.pathsep) + path.append(task.cwd + '/') + absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) + if len(absolutes) > 0: + self.realpath = task.cmd[0] + return True return False def getErrorMessage(self, task): -- cgit v1.2.3 From 4d01a8b971e7631cf999d4773891cce657b9aa27 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 24 Mar 2010 11:29:50 +0100 Subject: add possibility to separately set fan voltage and fan pwm for standby and normal run when a recording starts in standby switch to normal mode and vice versa this fixes bug #430 (thx to Dr.Best) --- lib/python/Components/FanControl.py | 43 ++++++++++++++++++---- .../Plugins/SystemPlugins/TempFanControl/plugin.py | 22 +++++++---- 2 files changed, 50 insertions(+), 15 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/FanControl.py b/lib/python/Components/FanControl.py index cee0523e..a993c396 100644 --- a/lib/python/Components/FanControl.py +++ b/lib/python/Components/FanControl.py @@ -3,6 +3,9 @@ import os from Components.config import config, ConfigSubList, ConfigSubsection, ConfigSlider from Tools.BoundFunction import boundFunction +import NavigationInstance +from enigma import iRecordableService + class FanControl: # ATM there's only support for one fan def __init__(self): @@ -13,18 +16,42 @@ class FanControl: self.createConfig() config.misc.standbyCounter.addNotifier(self.standbyCounterChanged, initial_call = False) - def leaveStandby(self): + def setVoltage_PWM(self): for fanid in range(self.getFanCount()): cfg = self.getConfig(fanid) self.setVoltage(fanid, cfg.vlt.value) self.setPWM(fanid, cfg.pwm.value) + print "[FanControl]: setting fan values: fanid = %d, voltage = %d, pwm = %d" % (fanid, cfg.vlt.value, cfg.pwm.value) + + def setVoltage_PWM_Standby(self): + for fanid in range(self.getFanCount()): + cfg = self.getConfig(fanid) + self.setVoltage(fanid, cfg.vlt_standby.value) + self.setPWM(fanid, cfg.pwm_standby.value) + print "[FanControl]: setting fan values (standby mode): fanid = %d, voltage = %d, pwm = %d" % (fanid, cfg.vlt_standby.value, cfg.pwm_standby.value) + + def getRecordEvent(self, recservice, event): + recordings = len(NavigationInstance.instance.getRecordings()) + if event == iRecordableService.evEnd: + if recordings == 0: + self.setVoltage_PWM_Standby() + elif event == iRecordableService.evStart: + if recordings == 1: + self.setVoltage_PWM() + + def leaveStandby(self): + NavigationInstance.instance.record_event.remove(self.getRecordEvent) + recordings = NavigationInstance.instance.getRecordings() + if not recordings: + self.setVoltage_PWM() def standbyCounterChanged(self, configElement): from Screens.Standby import inStandby inStandby.onClose.append(self.leaveStandby) - for fanid in range(self.getFanCount()): - self.setVoltage(fanid, 0) - self.setPWM(fanid, 0) + recordings = NavigationInstance.instance.getRecordings() + NavigationInstance.instance.record_event.append(self.getRecordEvent) + if not recordings: + self.setVoltage_PWM_Standby() def createConfig(self): def setVlt(fancontrol, fanid, configElement): @@ -35,12 +62,14 @@ class FanControl: config.fans = ConfigSubList() for fanid in range(self.getFanCount()): fan = ConfigSubsection() - fan.vlt = ConfigSlider(default = 16, increment = 5, limits = (0, 255)) + fan.vlt = ConfigSlider(default = 15, increment = 5, limits = (0, 255)) fan.pwm = ConfigSlider(default = 0, increment = 5, limits = (0, 255)) + fan.vlt_standby = ConfigSlider(default = 5, increment = 5, limits = (0, 255)) + fan.pwm_standby = ConfigSlider(default = 0, increment = 5, limits = (0, 255)) fan.vlt.addNotifier(boundFunction(setVlt, self, fanid)) fan.pwm.addNotifier(boundFunction(setPWM, self, fanid)) config.fans.append(fan) - + def getConfig(self, fanid): return config.fans[fanid] @@ -85,4 +114,4 @@ class FanControl: f.write("%x" % value) f.close() -fancontrol = FanControl() \ No newline at end of file +fancontrol = FanControl() diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py b/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py index 38e343f9..c8af9cdd 100644 --- a/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py @@ -12,7 +12,7 @@ from Components.FanControl import fancontrol class TempFanControl(Screen, ConfigListScreen): skin = """ - + @@ -22,7 +22,7 @@ class TempFanControl(Screen, ConfigListScreen): - + @@ -90,7 +90,7 @@ class TempFanControl(Screen, ConfigListScreen): """ - + def __init__(self, session, args = None): Screen.__init__(self, session) @@ -125,6 +125,9 @@ class TempFanControl(Screen, ConfigListScreen): for count in range(fancontrol.getFanCount()): self.list.append(getConfigListEntry(_("Fan %d Voltage") % (count + 1), fancontrol.getConfig(count).vlt)) self.list.append(getConfigListEntry(_("Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm)) + self.list.append(getConfigListEntry(_("Standby Fan %d Voltage") % (count + 1), fancontrol.getConfig(count).vlt_standby)) + self.list.append(getConfigListEntry(_("Standby Fan %d PWM") % (count + 1), fancontrol.getConfig(count).pwm_standby)) + ConfigListScreen.__init__(self, self.list, session = self.session) #self["config"].list = self.list #self["config"].setList(self.list) @@ -136,28 +139,31 @@ class TempFanControl(Screen, ConfigListScreen): "red": self.revert, "green": self.save }, -1) - + def save(self): for count in range(fancontrol.getFanCount()): fancontrol.getConfig(count).vlt.save() fancontrol.getConfig(count).pwm.save() + fancontrol.getConfig(count).vlt_standby.save() + fancontrol.getConfig(count).pwm_standby.save() self.close() - + def revert(self): for count in range(fancontrol.getFanCount()): fancontrol.getConfig(count).vlt.load() fancontrol.getConfig(count).pwm.load() + fancontrol.getConfig(count).vlt_standby.load() + fancontrol.getConfig(count).pwm_standby.load() self.close() - + def main(session, **kwargs): session.open(TempFanControl) def startMenu(menuid): if menuid != "system": return [] - return [(_("Temperature and Fan control"), main, "tempfancontrol", 80)] def Plugins(**kwargs): return PluginDescriptor(name = "Temperature and Fan control", description = _("Temperature and Fan control"), where = PluginDescriptor.WHERE_MENU, fnc = startMenu) - \ No newline at end of file + -- cgit v1.2.3 From 1398385cff4a4fc4d770afa1e9d1f6d560431b23 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 24 Mar 2010 15:17:39 +0100 Subject: add support for event progressbar per service in channelselection default this is disabled.. you can enable it in the Usage config this fixes bug #486 (patch by Dr.Best) --- data/setup.xml | 1 + data/skin_default/Makefile.am | 1 + data/skin_default/celserviceeventprogressbar.png | Bin 0 -> 1056 bytes lib/python/Components/ServiceList.py | 29 ++++++++-- lib/python/Components/UsageConfig.py | 2 + lib/service/listboxservice.cpp | 65 ++++++++++++++++++++--- lib/service/listboxservice.h | 6 +++ 7 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 data/skin_default/celserviceeventprogressbar.png mode change 100755 => 100644 lib/python/Components/ServiceList.py (limited to 'lib/python/Components') diff --git a/data/setup.xml b/data/setup.xml index 92bbc0f1..705eaf33 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -34,6 +34,7 @@ config.usage.on_short_powerpress config.usage.infobar_timeout config.usage.output_12V + config.usage.show_event_progress_in_servicelist config.usage.show_infobar_on_zap config.usage.show_infobar_on_skip config.usage.show_infobar_on_event_change diff --git a/data/skin_default/Makefile.am b/data/skin_default/Makefile.am index 85bb800d..6038c2e9 100755 --- a/data/skin_default/Makefile.am +++ b/data/skin_default/Makefile.am @@ -23,6 +23,7 @@ dist_install_DATA = \ b_tl.png \ b_t.png \ b_tr.png \ + celserviceeventprogressbar.png \ div-h.png \ div-v.png \ epg_more.png \ diff --git a/data/skin_default/celserviceeventprogressbar.png b/data/skin_default/celserviceeventprogressbar.png new file mode 100644 index 00000000..7bf5c658 Binary files /dev/null and b/data/skin_default/celserviceeventprogressbar.png differ diff --git a/lib/python/Components/ServiceList.py b/lib/python/Components/ServiceList.py old mode 100755 new mode 100644 index 6095812a..3452e27d --- a/lib/python/Components/ServiceList.py +++ b/lib/python/Components/ServiceList.py @@ -7,6 +7,8 @@ from Tools.LoadPixmap import LoadPixmap from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN +from Components.config import config + class ServiceList(HTMLComponent, GUIComponent): MODE_NORMAL = 0 MODE_FAVOURITES = 1 @@ -62,6 +64,18 @@ class ServiceList(HTMLComponent, GUIComponent): self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) + elif attrib == "colorEventProgressbar": + self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) + elif attrib == "colorEventProgressbarSelected": + self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value)) + elif attrib == "colorEventProgressbarBorder": + self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) + elif attrib == "colorEventProgressbarBorderSelected": + self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value)) + elif attrib == "picServiceEventProgressbar": + pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) + if pic: + self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": @@ -213,17 +227,24 @@ class ServiceList(HTMLComponent, GUIComponent): def setMode(self, mode): self.mode = mode + self.l.setItemHeight(self.ItemHeight) + self.l.setVisualMode(eListboxServiceContent.visModeComplex) if mode == self.MODE_NORMAL: - self.l.setItemHeight(self.ItemHeight) - self.l.setVisualMode(eListboxServiceContent.visModeComplex) + if config.usage.show_event_progress_in_servicelist.value: + self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(0, 0, 52, self.ItemHeight)) + else: + self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(0, 0, 0, 0)) self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont) self.l.setElementPosition(self.l.celServiceName, eRect(0, 0, self.instance.size().width(), self.ItemHeight)) self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont) else: - self.l.setItemHeight(self.ItemHeight) - self.l.setVisualMode(eListboxServiceContent.visModeComplex) + if config.usage.show_event_progress_in_servicelist.value: + self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(60, 0, 52, self.ItemHeight)) + else: + self.l.setElementPosition(self.l.celServiceEventProgressbar, eRect(60, 0, 0, 0)) self.l.setElementFont(self.l.celServiceNumber, self.ServiceNumberFont) self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 0, 50, self.ItemHeight)) self.l.setElementFont(self.l.celServiceName, self.ServiceNameFont) self.l.setElementPosition(self.l.celServiceName, eRect(60, 0, self.instance.size().width()-60, self.ItemHeight)) self.l.setElementFont(self.l.celServiceInfo, self.ServiceInfoFont) + diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 21478e90..b86c1a13 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -68,6 +68,8 @@ def InitUsageConfig(): ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C") ]) + config.usage.show_event_progress_in_servicelist = ConfigYesNo(default = False) + config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False) config.usage.show_message_when_recording_starts = ConfigYesNo(default = True) diff --git a/lib/service/listboxservice.cpp b/lib/service/listboxservice.cpp index 05aaf731..faee1ee6 100644 --- a/lib/service/listboxservice.cpp +++ b/lib/service/listboxservice.cpp @@ -526,7 +526,9 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const ePtr service_info; m_service_center->info(*m_cursor, service_info); eServiceReference ref = *m_cursor; - bool isPlayable = !(ref.flags & eServiceReference::isDirectory || ref.flags & eServiceReference::isMarker); + bool isMarker = ref.flags & eServiceReference::isMarker; + bool isPlayable = !(ref.flags & eServiceReference::isDirectory || isMarker); + ePtr evt; if (!marked && isPlayable && service_info && m_is_playable_ignore.valid() && !service_info->isPlayable(*m_cursor, m_is_playable_ignore)) { @@ -539,7 +541,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const if (selected && local_style && local_style->m_selection) painter.blit(local_style->m_selection, offset, eRect(), gPainter::BT_ALPHATEST); - int xoffset=0; // used as offset when painting the folder/marker symbol + int xoffset=0; // used as offset when painting the folder/marker symbol or the serviceevent progress for (int e = 0; e < celElements; ++e) { @@ -583,8 +585,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const } case celServiceInfo: { - ePtr evt; - if ( isPlayable && service_info && !service_info->getEvent(*m_cursor, evt) ) + if ( isPlayable && evt ) { std::string name = evt->getEventName(); if (!name.length()) @@ -608,9 +609,9 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const { eRect bbox = para->getBoundBox(); int name_width = bbox.width()+8; - m_element_position[celServiceInfo].setLeft(area.left()+name_width); + m_element_position[celServiceInfo].setLeft(area.left()+name_width+xoffs); m_element_position[celServiceInfo].setTop(area.top()); - m_element_position[celServiceInfo].setWidth(area.width()-name_width); + m_element_position[celServiceInfo].setWidth(area.width()-(name_width+xoffs)); m_element_position[celServiceInfo].setHeight(area.height()); } @@ -678,8 +679,58 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const painter.clippop(); } } + else if (e == celServiceEventProgressbar) + { + int p = celServiceEventProgressbar; + eRect area = m_element_position[p]; + if (area.width() > 0 && (isPlayable || isMarker)) + { + + if ( isPlayable && service_info && !service_info->getEvent(*m_cursor, evt) ) + { + if (!selected && m_color_set[serviceEventProgressbarBorderColor]) + painter.setForegroundColor(m_color[serviceEventProgressbarBorderColor]); + else if (selected && m_color_set[serviceEventProgressbarBorderColorSelected]) + painter.setForegroundColor(m_color[serviceEventProgressbarBorderColorSelected]); + + int border = 1; + int progressH = 6; + int progressX = area.left() + offset.x(); + int progressW = area.width() - 2 * border; + int progressT = offset.y() + (m_itemsize.height() - progressH - 2*border) / 2; + + // paint progressbar frame + painter.fill(eRect(progressX, progressT, area.width(), border)); + painter.fill(eRect(progressX, progressT + border, border, progressH)); + painter.fill(eRect(progressX, progressT + progressH + border, area.width(), border)); + painter.fill(eRect(progressX + area.width() - border, progressT + border, border, progressH)); + + // calculate value + time_t now = time(0); + int value = progressW * (now - evt->getBeginTime()) / evt->getDuration(); + + eRect tmp = eRect(progressX + border, progressT + border, value, progressH); + ePtr &pixmap = m_pixmaps[picServiceEventProgressbar]; + if (pixmap) + { + area.moveBy(offset); + painter.clip(area); + painter.blit(pixmap, ePoint(progressX + border, progressT + border), tmp, gPainter::BT_ALPHATEST); + painter.clippop(); + } + else + { + if (!selected && m_color_set[serviceEventProgressbarColor]) + painter.setForegroundColor(m_color[serviceEventProgressbarColor]); + else if (selected && m_color_set[serviceEventProgressbarColorSelected]) + painter.setForegroundColor(m_color[serviceEventProgressbarColorSelected]); + painter.fill(tmp); + } + } + xoffset = area.width() + 10; + } + } } - if (selected && (!local_style || !local_style->m_selection)) style.drawFrame(painter, eRect(offset, m_itemsize), eWindowStyle::frameListboxEntry); } diff --git a/lib/service/listboxservice.h b/lib/service/listboxservice.h index 5228a2f2..982d7e14 100644 --- a/lib/service/listboxservice.h +++ b/lib/service/listboxservice.h @@ -49,6 +49,7 @@ public: celServiceNumber, celMarkerPixmap, celFolderPixmap, + celServiceEventProgressbar, celServiceName, celServiceTypePixmap, celServiceInfo, // "now" event @@ -62,6 +63,7 @@ public: picServiceGroup, picFolder, picMarker, + picServiceEventProgressbar, picElements }; @@ -84,6 +86,10 @@ public: markedBackground, markedBackgroundSelected, serviceNotAvail, + serviceEventProgressbarColor, + serviceEventProgressbarColorSelected, + serviceEventProgressbarBorderColor, + serviceEventProgressbarBorderColorSelected, colorElements }; -- cgit v1.2.3 From 0b41d21e11a9aa7f70f6e148490cc26a03d7d4d7 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 24 Mar 2010 20:59:55 +0100 Subject: make channel selection service description color configurable this fixes bug #487 (patch by Dr.Best) --- lib/python/Components/ServiceList.py | 4 ++++ lib/service/listboxservice.cpp | 10 ++++++++++ lib/service/listboxservice.h | 2 ++ 3 files changed, 16 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ServiceList.py b/lib/python/Components/ServiceList.py index 3452e27d..cd055a82 100644 --- a/lib/python/Components/ServiceList.py +++ b/lib/python/Components/ServiceList.py @@ -72,6 +72,10 @@ class ServiceList(HTMLComponent, GUIComponent): self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value)) + elif attrib == "colorServiceDescription": + self.l.setColor(eListboxServiceContent.serviceDescriptionColor, parseColor(value)) + elif attrib == "colorServiceDescriptionSelected": + self.l.setColor(eListboxServiceContent.serviceDescriptionColorSelected, parseColor(value)) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: diff --git a/lib/service/listboxservice.cpp b/lib/service/listboxservice.cpp index f8ac0ff2..cc8c32b5 100644 --- a/lib/service/listboxservice.cpp +++ b/lib/service/listboxservice.cpp @@ -531,12 +531,15 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const bool paintProgress = false; ePtr evt; + bool serviceAvail = true; + if (!marked && isPlayable && service_info && m_is_playable_ignore.valid() && !service_info->isPlayable(*m_cursor, m_is_playable_ignore)) { if (m_color_set[serviceNotAvail]) painter.setForegroundColor(m_color[serviceNotAvail]); else painter.setForegroundColor(gRGB(0xbbbbbb)); + serviceAvail = false; } if (selected && local_style && local_style->m_selection) @@ -592,6 +595,13 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const if (!name.length()) continue; text = '(' + evt->getEventName() + ')'; + if (serviceAvail) + { + if (!selected && m_color_set[serviceDescriptionColor]) + painter.setForegroundColor(m_color[serviceDescriptionColor]); + else if (selected && m_color_set[serviceDescriptionColorSelected]) + painter.setForegroundColor(m_color[serviceDescriptionColorSelected]); + } } else continue; diff --git a/lib/service/listboxservice.h b/lib/service/listboxservice.h index 982d7e14..589afba6 100644 --- a/lib/service/listboxservice.h +++ b/lib/service/listboxservice.h @@ -90,6 +90,8 @@ public: serviceEventProgressbarColorSelected, serviceEventProgressbarBorderColor, serviceEventProgressbarBorderColorSelected, + serviceDescriptionColor, + serviceDescriptionColorSelected, colorElements }; -- cgit v1.2.3 From 58630f7b0de796e3589d2c1eaeb3e9d531d60d37 Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Tue, 30 Mar 2010 16:58:54 +0200 Subject: save supposed afterEvent config in class Job member (fixes #394 DVDBurn shutdown not being executed) --- lib/python/Components/Task.py | 1 + lib/python/Screens/TaskView.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index a1e04bce..2e4e757d 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -16,6 +16,7 @@ class Job(object): self.end = 100 self.__progress = 0 self.weightScale = 1 + self.afterEvent = None self.state_changed = CList() diff --git a/lib/python/Screens/TaskView.py b/lib/python/Screens/TaskView.py index eb926ca3..9907e2fb 100644 --- a/lib/python/Screens/TaskView.py +++ b/lib/python/Screens/TaskView.py @@ -7,7 +7,7 @@ import Screens.Standby from Tools import Notifications class JobView(InfoBarNotifications, Screen, ConfigListScreen): - def __init__(self, session, job, parent=None, cancelable = True, backgroundable = True, afterEvent = 0): + def __init__(self, session, job, parent=None, cancelable = True, backgroundable = True): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress from Components.Sources.Boolean import Boolean @@ -43,19 +43,20 @@ class JobView(InfoBarNotifications, Screen, ConfigListScreen): "ok": self.ok, }, -2) - self.afterevents = [ "nothing", "standby", "deepstandby", "close" ] self.settings = ConfigSubsection() if SystemInfo["DeepstandbySupport"]: shutdownString = _("go to deep standby") else: shutdownString = _("shut down") - self.settings.afterEvent = ConfigSelection(choices = [("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString)], default = self.afterevents[afterEvent]) + self.settings.afterEvent = ConfigSelection(choices = [("nothing", _("do nothing")), ("close", _("Close")), ("standby", _("go to standby")), ("deepstandby", shutdownString)], default = self.job.afterEvent or "nothing") + self.job.afterEvent = self.settings.afterEvent.getValue() self.setupList() self.state_changed() def setupList(self): self["config"].setList( [ getConfigListEntry(_("After event"), self.settings.afterEvent) ]) - + self.job.afterEvent = self.settings.afterEvent.getValue() + def keyLeft(self): ConfigListScreen.keyLeft(self) self.setupList() -- cgit v1.2.3 From 525b031d2b8401750293fde4e334dfc8a5193517 Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Tue, 30 Mar 2010 17:49:15 +0200 Subject: add transfer bps to service interface (requires touching enigma_python.i) --- lib/python/Components/Converter/ServiceInfo.py | 4 ++++ lib/service/iservice.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Converter/ServiceInfo.py b/lib/python/Components/Converter/ServiceInfo.py index 5014fde6..fa3518ce 100644 --- a/lib/python/Components/Converter/ServiceInfo.py +++ b/lib/python/Components/Converter/ServiceInfo.py @@ -19,6 +19,7 @@ class ServiceInfo(Converter, object): ONID = 13 SID = 14 FRAMERATE = 15 + TRANSFERBPS = 16 def __init__(self, type): @@ -40,6 +41,7 @@ class ServiceInfo(Converter, object): "OnId": (self.ONID, (iPlayableService.evUpdatedInfo,)), "Sid": (self.SID, (iPlayableService.evUpdatedInfo,)), "Framerate": (self.FRAMERATE, (iPlayableService.evVideoSizeChanged,iPlayableService.evUpdatedInfo,)), + "TransferBPS": (self.TRANSFERBPS, (iPlayableService.evUpdatedInfo,)), }[type] def getServiceInfoString(self, info, what, convert = lambda x: "%d" % x): @@ -112,6 +114,8 @@ class ServiceInfo(Converter, object): return self.getServiceInfoString(info, iServiceInformation.sSID) elif self.type == self.FRAMERATE: return self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d fps" % ((x+500)/1000)) + elif self.type == self.TRANSFERBPS: + return self.getServiceInfoString(info, iServiceInformation.sTransferBPS, lambda x: "%d kB/s" % (x/1024)) return "" text = property(getText) diff --git a/lib/service/iservice.h b/lib/service/iservice.h index d80733df..2ba7cb46 100644 --- a/lib/service/iservice.h +++ b/lib/service/iservice.h @@ -356,6 +356,8 @@ public: sTagCRC, sTagChannelMode, + sTransferBPS, + sUser = 0x100 }; enum { -- cgit v1.2.3 From 54e03fa5099bfe1862dd8fd83761c64ce17d555b Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 30 Mar 2010 18:25:06 +0200 Subject: fixes bug #436 some improvements to the multi tuner type switching --- lib/dvb/frontend.cpp | 7 ++++++ lib/dvb/frontend.h | 1 + lib/dvb/idvb.h | 1 + lib/python/Components/NimManager.py | 46 +++++++++++++++++++++++++++---------- lib/python/Screens/Satconfig.py | 2 +- 5 files changed, 44 insertions(+), 13 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index f85a37fe..8216eea0 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -483,6 +483,13 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate) closeFrontend(); } +void eDVBFrontend::reopenFrontend() +{ + closeFrontend(); + m_type = -1; + openFrontend(); +} + int eDVBFrontend::openFrontend() { if (m_state != stateClosed) diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h index 4cf05081..bc31755c 100644 --- a/lib/dvb/frontend.h +++ b/lib/dvb/frontend.h @@ -146,6 +146,7 @@ public: static void setTypePriorityOrder(int val) { PriorityOrder = val; } static int getTypePriorityOrder() { return PriorityOrder; } + void reopenFrontend(); int openFrontend(); int closeFrontend(bool force=false); const char *getDescription() const { return m_description; } diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index 4ef7efad..a3e87e35 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -459,6 +459,7 @@ class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject public: virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0; virtual RESULT tune(const iDVBFrontendParameters &where)=0; + virtual void reopenFrontend()=0; #ifndef SWIG virtual RESULT connectStateChange(const Slot1 &stateChange, ePtr &connection)=0; #endif diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 6650c717..6af4c52c 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -1,4 +1,5 @@ from Tools.HardwareInfo import HardwareInfo +from Tools.BoundFunction import boundFunction from config import config, ConfigSubsection, ConfigSelection, ConfigFloat, \ ConfigSatlist, ConfigYesNo, ConfigInteger, ConfigSubList, ConfigNothing, \ @@ -13,6 +14,7 @@ from enigma import eDVBSatelliteEquipmentControl as secClass, \ from time import localtime, mktime from datetime import datetime +from Tools.BoundFunction import boundFunction def getConfigSatlist(orbpos, satlist): default_orbpos = None @@ -687,6 +689,9 @@ class NimManager: def getNimDescription(self, slotid): return self.nim_slots[slotid].friendly_full_description + + def getNimName(self, slotid): + return self.nim_slots[slotid].description def getNimListOfType(self, type, exception = -1): # returns a list of indexes for NIMs compatible to the given type, except for 'exception' @@ -962,12 +967,18 @@ def InitSecParams(): # the configElement should be only visible when diseqc 1.2 is disabled def InitNimManager(nimmgr): - InitSecParams() hw = HardwareInfo() + addNimConfig = False + try: + config.Nims + except: + addNimConfig = True - config.Nims = ConfigSubList() - for x in range(len(nimmgr.nim_slots)): - config.Nims.append(ConfigSubsection()) + if addNimConfig: + InitSecParams() + config.Nims = ConfigSubList() + for x in range(len(nimmgr.nim_slots)): + config.Nims.append(ConfigSubsection()) lnb_choices = { "universal_lnb": _("Universal LNB"), @@ -1243,27 +1254,38 @@ def InitNimManager(nimmgr): if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2': open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value) - def tunerTypeChanged(configElement): + def tunerTypeChanged(nimmgr, configElement): fe_id = configElement.fe_id + print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value) open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value) - + frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend() + frontend.reopenFrontend() + nimmgr.enumerateNIMs() + empty_slots = 0 for slot in nimmgr.nim_slots: x = slot.slot nim = config.Nims[x] - if slot.isMultiType(): + addMultiType = False + try: + nim.multiType + except: + addMultiType = True + if slot.isMultiType() and addMultiType: typeList = [] - value = None for id in slot.getMultiTypeList().keys(): type = slot.getMultiTypeList()[id] typeList.append((id, type)) - if type == slot.getType(): - value = id nim.multiType = ConfigSelection(typeList, "0") - nim.multiType.value = value + nim.multiType.fe_id = x - empty_slots - nim.multiType.addNotifier(tunerTypeChanged) + nim.multiType.addNotifier(boundFunction(tunerTypeChanged, nimmgr)) + empty_slots = 0 + for slot in nimmgr.nim_slots: + x = slot.slot + nim = config.Nims[x] + if slot.isCompatible("DVB-S"): nim.toneAmplitude = ConfigSelection([("9", "600mV"), ("8", "700mV"), ("7", "800mV"), ("6", "900mV"), ("5", "1100mV")], "7") nim.toneAmplitude.fe_id = x - empty_slots diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 7ba3a134..87d65e54 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -208,11 +208,11 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, \ self.uncommittedDiseqcCommand, self.cableScanType, self.multiType) if self["config"].getCurrent() == self.multiType: - nimmanager.enumerateNIMs() from Components.NimManager import InitNimManager InitNimManager(nimmanager) self.nim = nimmanager.nim_slots[self.slotid] self.nimConfig = self.nim.config + for x in checkList: if self["config"].getCurrent() == x: self.createSetup() -- cgit v1.2.3 From 6c69f8d469e17ce1f07775574526b76a2edf60c8 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Wed, 31 Mar 2010 23:24:18 +0200 Subject: fixes bug #436 (again) multi tuner support: add a magic sleep(1) to workaround strange behaviour write a magic 0 into /sys/module/dvb_core/parameters/dvb_shutdown_timeout --- lib/dvb/frontend.cpp | 2 +- lib/dvb/idvb.h | 1 + lib/python/Components/NimManager.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 8216eea0..bc3a88da 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -485,7 +485,7 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate) void eDVBFrontend::reopenFrontend() { - closeFrontend(); + sleep(1); m_type = -1; openFrontend(); } diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index a3e87e35..d20829bf 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -459,6 +459,7 @@ class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject public: virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0; virtual RESULT tune(const iDVBFrontendParameters &where)=0; + virtual int closeFrontend(bool force = false)=0; virtual void reopenFrontend()=0; #ifndef SWIG virtual RESULT connectStateChange(const Slot1 &stateChange, ePtr &connection)=0; diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 6af4c52c..c68e9404 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -1257,9 +1257,19 @@ def InitNimManager(nimmgr): def tunerTypeChanged(nimmgr, configElement): fe_id = configElement.fe_id print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value) - open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value) + try: + oldvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline() + open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0") + except: + print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available" frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend() + frontend.closeFrontend() + open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value) frontend.reopenFrontend() + try: + open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(oldvalue) + except: + print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available" nimmgr.enumerateNIMs() empty_slots = 0 -- cgit v1.2.3 From 995cb7dd936b2ec22ea414182a227ed8b2da867c Mon Sep 17 00:00:00 2001 From: acid-burn Date: Thu, 6 May 2010 14:24:22 +0200 Subject: Network.py,NetworkSetup.py,skin_default.xml: * Introduce new unified naming for network interfaces. * Redesign NetworkadapterSelection Screen. * small cleanups. Refs #137 , Fixes #418 --- data/skin_default.xml | 14 +++- data/skin_default/icons/Makefile.am | 6 ++ data/skin_default/icons/network_wired-active.png | Bin 0 -> 2771 bytes data/skin_default/icons/network_wired-inactive.png | Bin 0 -> 2745 bytes data/skin_default/icons/network_wired.png | Bin 0 -> 2477 bytes .../skin_default/icons/network_wireless-active.png | Bin 0 -> 2821 bytes .../icons/network_wireless-inactive.png | Bin 0 -> 2745 bytes data/skin_default/icons/network_wireless.png | Bin 0 -> 2539 bytes lib/python/Components/Network.py | 51 ++++++++++-- lib/python/Screens/NetworkSetup.py | 90 ++++++++++++--------- 10 files changed, 114 insertions(+), 47 deletions(-) mode change 100644 => 100755 data/skin_default/icons/Makefile.am create mode 100755 data/skin_default/icons/network_wired-active.png create mode 100755 data/skin_default/icons/network_wired-inactive.png create mode 100755 data/skin_default/icons/network_wired.png create mode 100755 data/skin_default/icons/network_wireless-active.png create mode 100755 data/skin_default/icons/network_wireless-inactive.png create mode 100755 data/skin_default/icons/network_wireless.png (limited to 'lib/python/Components') diff --git a/data/skin_default.xml b/data/skin_default.xml index 0114349b..497d33ac 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -577,7 +577,19 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) - + + + {"template": [ + MultiContentEntryText(pos = (85, 6), size = (440, 28), font=0, flags = RT_HALIGN_LEFT|RT_VALIGN_TOP, text = 1), # index 1 is the interfacename + MultiContentEntryText(pos = (85, 43), size = (440, 20), font=1, flags = RT_HALIGN_LEFT|RT_VALIGN_BOTTOM, text = 2), # index 2 is the description + MultiContentEntryPixmapAlphaTest(pos = (2, 8), size = (54, 54), png = 3), # index 3 is the interface pixmap + MultiContentEntryPixmapAlphaTest(pos = (63, 46), size = (15, 16), png = 4), # index 4 is the default pixmap + ], + "fonts": [gFont("Regular", 28),gFont("Regular", 20)], + "itemHeight": 70 + } + + diff --git a/data/skin_default/icons/Makefile.am b/data/skin_default/icons/Makefile.am old mode 100644 new mode 100755 index 8e2052b0..088556a6 --- a/data/skin_default/icons/Makefile.am +++ b/data/skin_default/icons/Makefile.am @@ -34,6 +34,12 @@ dist_install_DATA = \ lock.png \ marker.png \ mp_buttons.png \ + network_wired.png \ + network_wired-active.png \ + network_wired-inactive.png \ + network_wireless.png \ + network_wireless-active.png \ + network_wireless-inactive.png \ plugin.png \ rass_logo.png \ rass_page1.png \ diff --git a/data/skin_default/icons/network_wired-active.png b/data/skin_default/icons/network_wired-active.png new file mode 100755 index 00000000..d8efc9c8 Binary files /dev/null and b/data/skin_default/icons/network_wired-active.png differ diff --git a/data/skin_default/icons/network_wired-inactive.png b/data/skin_default/icons/network_wired-inactive.png new file mode 100755 index 00000000..18f2c70f Binary files /dev/null and b/data/skin_default/icons/network_wired-inactive.png differ diff --git a/data/skin_default/icons/network_wired.png b/data/skin_default/icons/network_wired.png new file mode 100755 index 00000000..db695ad5 Binary files /dev/null and b/data/skin_default/icons/network_wired.png differ diff --git a/data/skin_default/icons/network_wireless-active.png b/data/skin_default/icons/network_wireless-active.png new file mode 100755 index 00000000..07a21874 Binary files /dev/null and b/data/skin_default/icons/network_wireless-active.png differ diff --git a/data/skin_default/icons/network_wireless-inactive.png b/data/skin_default/icons/network_wireless-inactive.png new file mode 100755 index 00000000..5bd69f9d Binary files /dev/null and b/data/skin_default/icons/network_wireless-inactive.png differ diff --git a/data/skin_default/icons/network_wireless.png b/data/skin_default/icons/network_wireless.png new file mode 100755 index 00000000..629a05a6 Binary files /dev/null and b/data/skin_default/icons/network_wireless.png differ diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index b9da48d8..e8a3d459 100755 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -26,6 +26,9 @@ class Network: self.DnsConsole = Console() self.PingConsole = Console() self.config_ready = None + self.friendlyNames = {} + self.lan_interfaces = [] + self.wlan_interfaces = [] self.getInterfaces() def onRemoteRootFS(self): @@ -309,13 +312,47 @@ class Network: return len(self.ifaces) def getFriendlyAdapterName(self, x): - # maybe this needs to be replaced by an external list. - friendlyNames = { - "eth0": _("Integrated Ethernet"), - "wlan0": _("Wireless"), - "ath0": _("Integrated Wireless") - } - return friendlyNames.get(x, x) # when we have no friendly name, use adapter name + if x in self.friendlyNames.keys(): + return self.friendlyNames.get(x, x) + else: + self.friendlyNames[x] = self.getFriendlyAdapterNaming(x) + return self.friendlyNames.get(x, x) # when we have no friendly name, use adapter name + + def getFriendlyAdapterNaming(self, iface): + if iface.startswith('eth'): + if iface not in self.lan_interfaces and len(self.lan_interfaces) == 0: + self.lan_interfaces.append(iface) + return _("LAN connection") + elif iface not in self.lan_interfaces and len(self.lan_interfaces) >= 1: + self.lan_interfaces.append(iface) + return _("LAN connection") + " " + str(len(self.lan_interfaces)) + else: + if iface not in self.wlan_interfaces and len(self.wlan_interfaces) == 0: + self.wlan_interfaces.append(iface) + return _("WLAN connection") + elif iface not in self.wlan_interfaces and len(self.wlan_interfaces) >= 1: + self.wlan_interfaces.append(iface) + return _("WLAN connection") + " " + str(len(self.wlan_interfaces)) + + def getFriendlyAdapterDescription(self, iface): + if iface == 'eth0': + return _("Internal LAN adapter.") + else: + classdir = "/sys/class/net/" + iface + "/device/" + driverdir = "/sys/class/net/" + iface + "/device/driver/" + if os_path.exists(classdir): + files = listdir(classdir) + if 'driver' in files: + if os_path.realpath(driverdir).endswith('ath_pci'): + return _("Atheros")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") + elif os_path.realpath(driverdir).endswith('zd1211b'): + return _("Zydas")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") + elif os_path.realpath(driverdir).endswith('rt73'): + return _("Ralink")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") + else: + return _("Unknown network adapter.") + else: + return _("Unknown network adapter.") def getAdapterName(self, iface): return iface diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py index c0037f81..2e33ac3b 100755 --- a/lib/python/Screens/NetworkSetup.py +++ b/lib/python/Screens/NetworkSetup.py @@ -7,6 +7,7 @@ from Screens.HelpMenu import HelpableScreen from Components.Network import iNetwork from Components.Sources.StaticText import StaticText from Components.Sources.Boolean import Boolean +from Components.Sources.List import List from Components.Label import Label,MultiColorLabel from Components.Pixmap import Pixmap,MultiPixmap from Components.MenuList import MenuList @@ -23,32 +24,6 @@ from os import path as os_path, system as os_system, unlink from re import compile as re_compile, search as re_search -class InterfaceList(MenuList): - def __init__(self, list, enableWrapAround=False): - MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) - self.l.setFont(0, gFont("Regular", 20)) - self.l.setItemHeight(30) - -def InterfaceEntryComponent(index,name,default,active ): - res = [ - (index), - MultiContentEntryText(pos=(80, 5), size=(430, 25), font=0, text=name) - ] - num_configured_if = len(iNetwork.getConfiguredAdapters()) - if num_configured_if >= 2: - if default is True: - png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue.png")) - if default is False: - png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue_off.png")) - res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 5), size=(25, 25), png = png)) - if active is True: - png2 = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_on.png")) - if active is False: - png2 = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_error.png")) - res.append(MultiContentEntryPixmapAlphaTest(pos=(40, 1), size=(25, 25), png = png2)) - return res - - class NetworkAdapterSelection(Screen,HelpableScreen): def __init__(self, session): Screen.__init__(self, session) @@ -91,13 +66,49 @@ class NetworkAdapterSelection(Screen,HelpableScreen): }) self.list = [] - self["list"] = InterfaceList(self.list) + self["list"] = List(self.list) self.updateList() if len(self.adapters) == 1: self.onFirstExecBegin.append(self.okbuttonClick) self.onClose.append(self.cleanup) + def buildInterfaceList(self,iface,name,default,active ): + divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) + defaultpng = None + activepng = None + description = None + interfacepng = None + + if iface in iNetwork.lan_interfaces: + if active is True: + interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wired-active.png")) + elif active is False: + interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wired-inactive.png")) + else: + interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wired.png")) + elif iface in iNetwork.wlan_interfaces: + if active is True: + interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wireless-active.png")) + elif active is False: + interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wireless-inactive.png")) + else: + interfacepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/network_wireless.png")) + + num_configured_if = len(iNetwork.getConfiguredAdapters()) + if num_configured_if >= 2: + if default is True: + defaultpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue.png")) + elif default is False: + defaultpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/buttons/button_blue_off.png")) + if active is True: + activepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_on.png")) + elif active is False: + activepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/lock_error.png")) + + description = iNetwork.getFriendlyAdapterDescription(iface) + + return((iface, name, description, interfacepng, defaultpng, activepng, divpng)) def updateList(self): self.list = [] @@ -122,7 +133,7 @@ class NetworkAdapterSelection(Screen,HelpableScreen): default_gw = result if len(self.adapters) == 0: # no interface available => display only eth0 - self.list.append(InterfaceEntryComponent("eth0",iNetwork.getFriendlyAdapterName('eth0'),True,True )) + self.list.append(self.buildInterfaceList("eth0",iNetwork.getFriendlyAdapterName('eth0'),True,True )) else: for x in self.adapters: if x[1] == default_gw: @@ -133,11 +144,11 @@ class NetworkAdapterSelection(Screen,HelpableScreen): active_int = True else: active_int = False - self.list.append(InterfaceEntryComponent(index = x[1],name = _(x[0]),default=default_int,active=active_int )) + self.list.append(self.buildInterfaceList(x[1],_(x[0]),default_int,active_int )) if os_path.exists(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkWizard/networkwizard.xml")): self["key_blue"].setText(_("NetworkWizard")) - self["list"].l.setList(self.list) + self["list"].setList(self.list) def setDefaultInterface(self): selection = self["list"].getCurrent() @@ -253,7 +264,7 @@ class NameserverSetup(Screen, ConfigListScreen, HelpableScreen): self.list = [] ConfigListScreen.__init__(self, self.list) self.createSetup() - + def createConfig(self): self.nameservers = iNetwork.getNameserverList() self.nameserverEntries = [ NoSave(ConfigIP(default=nameserver)) for nameserver in self.nameservers] @@ -412,7 +423,7 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): self.wsconfig = None self.default = None - if self.iface == "wlan0" or self.iface == "ath0" : + if self.iface in iNetwork.wlan_interfaces: from Plugins.SystemPlugins.WirelessLan.Wlan import wpaSupplicant,Wlan self.w = Wlan(self.iface) self.ws = wpaSupplicant() @@ -535,7 +546,7 @@ class AdapterSetup(Screen, ConfigListScreen, HelpableScreen): self.createSetup() if self["config"].getCurrent() == self.gatewayEntry: self.createSetup() - if self.iface == "wlan0" or self.iface == "ath0" : + if self.iface in iNetwork.wlan_interfaces: if self["config"].getCurrent() == self.wlanSSID: self.createSetup() if self["config"].getCurrent() == self.encryptionEnabled: @@ -731,7 +742,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): def ok(self): self.cleanup() if self["menulist"].getCurrent()[1] == 'edit': - if self.iface == 'wlan0' or self.iface == 'ath0': + if self.iface in iNetwork.wlan_interfaces: try: from Plugins.SystemPlugins.WirelessLan.plugin import WlanScan from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless @@ -817,7 +828,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): if self["menulist"].getCurrent()[1] == 'dns': self["description"].setText(_("Edit the Nameserver configuration of your Dreambox.\n" ) + self.oktext ) if self["menulist"].getCurrent()[1] == 'scanwlan': - self["description"].setText(_("Scan your network for wireless Access Points and connect to them using your selected wireless device.\n" ) + self.oktext ) + self["description"].setText(_("Scan your network for wireless access points and connect to them using your selected wireless device.\n" ) + self.oktext ) if self["menulist"].getCurrent()[1] == 'wlanstatus': self["description"].setText(_("Shows the state of your wireless LAN connection.\n" ) + self.oktext ) if self["menulist"].getCurrent()[1] == 'lanrestart': @@ -834,7 +845,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): self["IF"].setText(iNetwork.getFriendlyAdapterName(self.iface)) self["Statustext"].setText(_("Link:")) - if self.iface == 'wlan0' or self.iface == 'ath0': + if self.iface in iNetwork.wlan_interfaces: try: from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus except: @@ -884,7 +895,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): def AdapterSetupClosed(self, *ret): if ret is not None and len(ret): - if ret[0] == 'ok' and (self.iface == 'wlan0' or self.iface == 'ath0') and iNetwork.getAdapterAttribute(self.iface, "up") is True: + if ret[0] == 'ok' and (self.iface in iNetwork.wlan_interfaces) and iNetwork.getAdapterAttribute(self.iface, "up") is True: try: from Plugins.SystemPlugins.WirelessLan.plugin import WlanStatus from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless @@ -1263,6 +1274,7 @@ class NetworkAdapterTest(Screen): self.nextStepTimer.stop() def layoutFinished(self): + self.setTitle(_("Network test: ") + iNetwork.getFriendlyAdapterName(self.iface) ) self["shortcutsyellow"].setEnabled(False) self["AdapterInfo_OK"].hide() self["NetworkInfo_Check"].hide() @@ -1282,7 +1294,7 @@ class NetworkAdapterTest(Screen): self["AdapterInfo_Text"] = MultiColorLabel(_("Show Info")) self["AdapterInfo_OK"] = Pixmap() - if self.iface == 'wlan0' or self.iface == 'ath0': + if self.iface in iNetwork.wlan_interfaces: self["Networktext"] = MultiColorLabel(_("Wireless Network")) else: self["Networktext"] = MultiColorLabel(_("Local Network")) @@ -1321,7 +1333,7 @@ class NetworkAdapterTest(Screen): self["InfoText"] = Label() def getLinkState(self,iface): - if iface == 'wlan0' or iface == 'ath0': + if iface in iNetwork.wlan_interfaces: try: from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status except: -- cgit v1.2.3 From 85e468fa62411c066f23d64de384711aa2b35fa8 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 7 May 2010 12:49:48 +0200 Subject: mytest.py: load bouquets before parental control init and remove strange hack in parental control this fixes bug #532 --- lib/python/Components/ParentalControl.py | 11 +---------- mytest.py | 6 ++++-- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ParentalControl.py b/lib/python/Components/ParentalControl.py index 9942bca7..63b5ccfb 100644 --- a/lib/python/Components/ParentalControl.py +++ b/lib/python/Components/ParentalControl.py @@ -55,11 +55,10 @@ def InitParentalControl(): class ParentalControl: def __init__(self): #Do not call open on init, because bouquets are not ready at that moment -# self.open() + self.open() self.serviceLevel = {} #Instead: Use Flags to see, if we already initialized config and called open self.configInitialized = False - self.filesOpened = False #This is the timer that is used to see, if the time for caching the pin is over #Of course we could also work without a timer and compare the times every #time we call isServicePlayable. But this might probably slow down zapping, @@ -89,9 +88,6 @@ class ParentalControl: def isServicePlayable(self, ref, callback): if not config.ParentalControl.configured.value or not config.ParentalControl.servicepinactive.value: return True - #Check if we already read the whitelists and blacklists. If not: call open - if self.filesOpened == False: - self.open() #Check if configuration has already been read or if the significant values have changed. #If true: read the configuration if self.configInitialized == False or self.storeServicePin != config.ParentalControl.storeservicepin.value or self.storeServicePinCancel != config.ParentalControl.storeservicepincancel.value: @@ -153,8 +149,6 @@ class ParentalControl: def getProtectionType(self, service): #New method used in ParentalControlList: This method does not only return #if a service is protected or not, it also returns, why (whitelist or blacklist, service or bouquet) - if self.filesOpened == False: - self.open() sImage = "" if (config.ParentalControl.type.value == LIST_WHITELIST): if self.whitelist.has_key(service): @@ -319,14 +313,11 @@ class ParentalControl: def save(self): # we need to open the files in case we havent's read them yet - if not self.filesOpened: - self.open() self.saveListToFile(LIST_BLACKLIST) self.saveListToFile(LIST_WHITELIST) def open(self): self.openListFromFile(LIST_BLACKLIST) self.openListFromFile(LIST_WHITELIST) - self.filesOpened = True parentalControl = ParentalControl() diff --git a/mytest.py b/mytest.py index 4b687e05..a3cfb5a2 100755 --- a/mytest.py +++ b/mytest.py @@ -30,6 +30,9 @@ from Screens.SimpleSummary import SimpleSummary from sys import stdout, exc_info +profile("Bouquets") +eDVBDB.getInstance().reloadBouquets() + profile("ParentalControl") from Components.ParentalControl import InitParentalControl InitParentalControl() @@ -45,8 +48,7 @@ from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, from Components.config import config, configfile, ConfigText, ConfigYesNo, ConfigInteger, NoSave InitFallbackFiles() -profile("ReloadProfiles") -eDVBDB.getInstance().reloadBouquets() +profile("config.misc") config.misc.radiopic = ConfigText(default = resolveFilename(SCOPE_CURRENT_SKIN, "radio.mvi")) config.misc.isNextRecordTimerAfterEventActionAuto = ConfigYesNo(default=False) -- cgit v1.2.3 From bea4946ae09bcab368696c50031e29c635017585 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Wed, 12 May 2010 16:03:30 +0200 Subject: RecordTimer.py,RecordingConfig.py,setup.xml: *add possibility to change the default recording filename composition in expert mode. This allows now to have shorter recording filenames (Date-Name) or longer (DateTime-Channel-Name-Shortdescription) beside the default. This fixes #345 --- RecordTimer.py | 8 ++++++++ data/setup.xml | 1 + lib/python/Components/RecordingConfig.py | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) mode change 100644 => 100755 RecordTimer.py mode change 100644 => 100755 data/setup.xml mode change 100644 => 100755 lib/python/Components/RecordingConfig.py (limited to 'lib/python/Components') diff --git a/RecordTimer.py b/RecordTimer.py old mode 100644 new mode 100755 index f670417a..04c3ff12 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -129,6 +129,7 @@ class RecordTimerEntry(timer.TimerEntry, object): def calculateFilename(self): service_name = self.service_ref.getServiceName() begin_date = strftime("%Y%m%d %H%M", localtime(self.begin)) + begin_shortdate = strftime("%Y%m%d", localtime(self.begin)) print "begin_date: ", begin_date print "service_name: ", service_name @@ -138,6 +139,13 @@ class RecordTimerEntry(timer.TimerEntry, object): filename = begin_date + " - " + service_name if self.name: filename += " - " + self.name + if config.usage.setup_level.index >= 2: # expert+ + if config.recording.filename_composition.value == "short": + filename = begin_shortdate + " - " + self.name + elif config.recording.filename_composition.value == "long": + filename = begin_date + " - " + service_name + " - " + self.name + " - " + self.description + else: + filename += " - " + self.name # standard if config.recording.ascii_filenames.value: filename = ASCIItranslit.legacyEncode(filename) diff --git a/data/setup.xml b/data/setup.xml old mode 100644 new mode 100755 index 705eaf33..f5dea734 --- a/data/setup.xml +++ b/data/setup.xml @@ -72,6 +72,7 @@ config.usage.pip_zero_button config.usage.alternatives_priority config.recording.ascii_filenames + config.recording.filename_composition config.usage.hdd_standby diff --git a/lib/python/Components/RecordingConfig.py b/lib/python/Components/RecordingConfig.py old mode 100644 new mode 100755 index fe9284d9..40dfb2ca --- a/lib/python/Components/RecordingConfig.py +++ b/lib/python/Components/RecordingConfig.py @@ -1,4 +1,4 @@ -from config import ConfigNumber, ConfigYesNo, ConfigSubsection, config +from config import ConfigNumber, ConfigYesNo, ConfigSubsection, ConfigSelection, config def InitRecordingConfig(): config.recording = ConfigSubsection(); @@ -8,3 +8,7 @@ def InitRecordingConfig(): config.recording.margin_after = ConfigNumber(default=0) config.recording.debug = ConfigYesNo(default = False) config.recording.ascii_filenames = ConfigYesNo(default = False) + config.recording.filename_composition = ConfigSelection(default = "standard", choices = [ + ("standard", _("standard")), + ("short", _("Short filenames")), + ("long", _("Long filenames")) ] ) \ No newline at end of file -- cgit v1.2.3 From c95ebd0688c39d4fa6e22e85d84fe7d80e3da013 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 8 Jun 2010 14:28:29 +0200 Subject: update unicable stuff (by adenin) --- data/Makefile.am | 3 +- data/unicable.xml | 172 ++++++++++++++++++++++++++++++++++ lib/dvb/frontend.cpp | 91 +++++++++--------- lib/dvb/frontend.h | 8 +- lib/dvb/idvb.h | 5 +- lib/dvb/sec.cpp | 82 +++++++++++++--- lib/dvb/sec.h | 13 ++- lib/python/Components/NimManager.py | 182 ++++++++++++++++++++++++------------ lib/python/Components/config.py | 3 +- lib/python/Screens/Satconfig.py | 15 ++- 10 files changed, 444 insertions(+), 130 deletions(-) create mode 100644 data/unicable.xml (limited to 'lib/python/Components') diff --git a/data/Makefile.am b/data/Makefile.am index 67f2ad25..fcc29a8d 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -14,4 +14,5 @@ dist_pkgdata_DATA = \ skin_default.xml \ skin.xml \ startwizard.xml \ - tutorialwizard.xml + tutorialwizard.xml \ + unicable.xml diff --git a/data/unicable.xml b/data/unicable.xml new file mode 100644 index 00000000..33951d7f --- /dev/null +++ b/data/unicable.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index bc3a88da..bd8f0028 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -582,7 +582,7 @@ int eDVBFrontend::openFrontend() return 0; } -int eDVBFrontend::closeFrontend(bool force) +int eDVBFrontend::closeFrontend(bool force, bool no_delayed) { if (!force && m_data[CUR_VOLTAGE] != -1 && m_data[CUR_VOLTAGE] != iDVBFrontend::voltageOff) { @@ -605,11 +605,34 @@ int eDVBFrontend::closeFrontend(bool force) eDebugNoSimulate("close frontend %d", m_dvbid); if (m_data[SATCR] != -1) { - turnOffSatCR(m_data[SATCR]); + if (!no_delayed) + { + m_sec->prepareTurnOffSatCR(*this, m_data[SATCR]); + m_tuneTimer->start(0, true); + if(!m_tuneTimer->isActive()) + { + int timeout=0; + eDebug("[turnOffSatCR] no mainloop"); + while(true) + { + timeout = tuneLoopInt(); + if (timeout == -1) + break; + usleep(timeout*1000); // blockierendes wait.. eTimer gibts ja nicht mehr + } + } + else + eDebug("[turnOffSatCR] running mainloop"); + return 0; + } + else + m_data[ROTOR_CMD] = -1; } + setTone(iDVBFrontend::toneOff); setVoltage(iDVBFrontend::voltageOff); m_tuneTimer->stop(); + if (m_sec && !m_simulate) m_sec->setRotorMoving(m_slotid, false); if (!::close(m_fd)) @@ -1486,9 +1509,14 @@ bool eDVBFrontend::setSecSequencePos(int steps) return true; } -void eDVBFrontend::tuneLoop() // called by m_tuneTimer +void eDVBFrontend::tuneLoop() +{ + tuneLoopInt(); +} + +int eDVBFrontend::tuneLoopInt() // called by m_tuneTimer { - int delay=0; + int delay=-1; eDVBFrontend *sec_fe = this; eDVBRegisteredFrontend *regFE = 0; long tmp = m_data[LINKED_PREV_PTR]; @@ -1518,6 +1546,7 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer { long *sec_fe_data = sec_fe->m_data; // eDebugNoSimulate("tuneLoop %d\n", m_sec_sequence.current()->cmd); + delay = 0; switch (m_sec_sequence.current()->cmd) { case eSecCommand::SLEEP: @@ -1844,6 +1873,13 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer ++m_sec_sequence.current(); break; } + case eSecCommand::DELAYED_CLOSE_FRONTEND: + { + eDebugNoSimulate("[SEC] delayed close frontend"); + closeFrontend(false, true); + ++m_sec_sequence.current(); + break; + } default: eDebugNoSimulate("[SEC] unhandled sec command %d", ++m_sec_sequence.current()->cmd); @@ -1856,6 +1892,7 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer regFE->dec_use(); if (m_simulate && m_sec_sequence.current() != m_sec_sequence.end()) tuneLoop(); + return delay; } void eDVBFrontend::setFrontend(bool recvEvents) @@ -2591,9 +2628,12 @@ RESULT eDVBFrontend::setSEC(iDVBSatelliteEquipmentControl *sec) return 0; } -RESULT eDVBFrontend::setSecSequence(const eSecCommandList &list) +RESULT eDVBFrontend::setSecSequence(eSecCommandList &list) { - m_sec_sequence = list; + if (m_data[SATCR] != -1 && m_sec_sequence.current() != m_sec_sequence.end()) + m_sec_sequence.push_back(list); + else + m_sec_sequence = list; return 0; } @@ -2670,42 +2710,3 @@ arg_error: "eDVBFrontend::setSlotInfo must get a tuple with first param slotid, second param slot description and third param enabled boolean"); return false; } - -RESULT eDVBFrontend::turnOffSatCR(int satcr) -{ - eSecCommandList sec_sequence; - // check if voltage is disabled - eSecCommand::pair compare; - compare.steps = +9; //nothing to do - compare.voltage = iDVBFrontend::voltageOff; - sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50 ) ); - - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage18_5) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) ); - - eDVBDiseqcCommand diseqc; - memset(diseqc.data, 0, MAX_DISEQC_LENGTH); - diseqc.len = 5; - diseqc.data[0] = 0xE0; - diseqc.data[1] = 0x10; - diseqc.data[2] = 0x5A; - diseqc.data[3] = satcr << 5; - diseqc.data[4] = 0x00; - - sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50+20+14*diseqc.len) ); - sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) ); - setSecSequence(sec_sequence); - return 0; -} - -RESULT eDVBFrontend::ScanSatCR() -{ - setFrontend(); - usleep(20000); - setTone(iDVBFrontend::toneOff); - return 0; -} diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h index bc31755c..bef4a18f 100644 --- a/lib/dvb/frontend.h +++ b/lib/dvb/frontend.h @@ -110,6 +110,7 @@ private: void feEvent(int); void timeout(); void tuneLoop(); // called by m_tuneTimer + int tuneLoopInt(); void setFrontend(bool recvEvents=true); bool setSecSequencePos(int steps); static int PriorityOrder; @@ -130,7 +131,7 @@ public: RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc); RESULT sendToneburst(int burst); RESULT setSEC(iDVBSatelliteEquipmentControl *sec); - RESULT setSecSequence(const eSecCommandList &list); + RESULT setSecSequence(eSecCommandList &list); RESULT getData(int num, long &data); RESULT setData(int num, long val); @@ -148,12 +149,9 @@ public: void reopenFrontend(); int openFrontend(); - int closeFrontend(bool force=false); + int closeFrontend(bool force=false, bool no_delayed=false); const char *getDescription() const { return m_description; } bool is_simulate() const { return m_simulate; } - - RESULT turnOffSatCR(int satcr); - RESULT ScanSatCR(); }; #endif // SWIG diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index 996d7909..f1217a6a 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -459,7 +459,7 @@ class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject public: virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0; virtual RESULT tune(const iDVBFrontendParameters &where)=0; - virtual int closeFrontend(bool force = false)=0; + virtual int closeFrontend(bool force = false, bool no_delayed = false)=0; virtual void reopenFrontend()=0; #ifndef SWIG virtual RESULT connectStateChange(const Slot1 &stateChange, ePtr &connection)=0; @@ -471,7 +471,7 @@ public: virtual RESULT sendToneburst(int burst)=0; #ifndef SWIG virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0; - virtual RESULT setSecSequence(const eSecCommandList &list)=0; + virtual RESULT setSecSequence(eSecCommandList &list)=0; #endif virtual int readFrontendData(int type)=0; virtual void getFrontendStatus(SWIG_PYOBJECT(ePyObject) dest)=0; @@ -491,6 +491,7 @@ class iDVBSatelliteEquipmentControl: public iObject { public: virtual RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int timeout)=0; + virtual void prepareTurnOffSatCR(iDVBFrontend &frontend, int satcr)=0; virtual int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *fe, int frontend_id, int *highest_score_lnb=0)=0; virtual void setRotorMoving(int slotid, bool)=0; }; diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 0e3e7e0a..58fc5e39 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -108,6 +108,9 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite { bool rotor=false; eDVBSatelliteLNBParameters &lnb_param = m_lnbs[idx]; + bool is_unicable = lnb_param.SatCR_idx != -1; + bool is_unicable_position_switch = lnb_param.SatCR_positions > 1; + if ( lnb_param.m_slot_mask & slot_id ) // lnb for correct tuner? { int ret = 0; @@ -163,7 +166,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite eSecDebugNoSimulate("ret1 %d", ret); - if (linked_in_use) + if (linked_in_use && !is_unicable) { // compare tuner data if ( (csw != linked_csw) || @@ -176,7 +179,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite ret += 15; eSecDebugNoSimulate("ret2 %d", ret); } - else if (satpos_depends_ptr != -1) + else if ((satpos_depends_ptr != -1) && !(is_unicable && is_unicable_position_switch)) { eSecDebugNoSimulate("satpos depends"); eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend*) satpos_depends_ptr; @@ -209,7 +212,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite eSecDebugNoSimulate("ret5 %d", ret); - if (ret) + if (ret && lnb_param.SatCR_idx != -1) { int lof = sat.frequency > lnb_param.m_lof_threshold ? lnb_param.m_lof_hi : lnb_param.m_lof_lo; @@ -375,8 +378,8 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA { // calc Frequency local = abs(sat.frequency - - ((lof - (lof % 1000)) + ((lof % 1000)>500 ? 1000 : 0)) ); //TODO für den Mist mal ein Macro schreiben - parm.FREQUENCY = (local - (local % 125)) + ((local % 125)>62 ? 125 : 0); + - lof); + parm.FREQUENCY = ((((local * 2) / 125) + 1) / 2) * 125; frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - parm.FREQUENCY); if ( voltage_mode == eDVBSatelliteSwitchParameters::_14V @@ -396,20 +399,21 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA } else { - unsigned int tmp = abs(sat.frequency - - ((lof - (lof % 1000)) + ((lof % 1000)>500 ? 1000 : 0)) ) + int tmp1 = abs(sat.frequency + -lof) + lnb_param.SatCRvco - 1400000 + lnb_param.guard_offset; - parm.FREQUENCY = (lnb_param.SatCRvco - (tmp % 4000))+((tmp%4000)>2000?4000:0)+lnb_param.guard_offset; - lnb_param.UnicableTuningWord = (((tmp / 4000)+((tmp%4000)>2000?1:0)) + int tmp2 = ((((tmp1 * 2) / 4000) + 1) / 2) * 4000; + parm.FREQUENCY = lnb_param.SatCRvco - (tmp1-tmp2) + lnb_param.guard_offset; + lnb_param.UnicableTuningWord = ((tmp2 / 4000) | ((band & 1) ? 0x400 : 0) //HighLow | ((band & 2) ? 0x800 : 0) //VertHor | ((lnb_param.LNBNum & 1) ? 0 : 0x1000) //Umschaltung LNB1 LNB2 | (lnb_param.SatCR_idx << 13)); //Adresse des SatCR eDebug("[prepare] UnicableTuningWord %#04x",lnb_param.UnicableTuningWord); eDebug("[prepare] guard_offset %d",lnb_param.guard_offset); - frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - ((lnb_param.UnicableTuningWord & 0x3FF) *4000 + 1400000 - lnb_param.SatCRvco + lof)); + frontend.setData(eDVBFrontend::FREQ_OFFSET, (lnb_param.UnicableTuningWord & 0x3FF) *4000 + 1400000 + lof - (2 * (lnb_param.SatCRvco - (tmp1-tmp2))) ); } if (diseqc_mode >= eDVBSatelliteDiseqcParameters::V1_0) @@ -743,10 +747,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA diseqc.data[3] = RotorCmd; diseqc.data[4] = 0x00; } - if(lnb_param.SatCR_idx == -1) +// if(lnb_param.SatCR_idx == -1) { int mrt = m_params[MOTOR_RUNNING_TIMEOUT]; // in seconds! - if ( rotor_param.m_inputpower_parameters.m_use ) + if ( rotor_param.m_inputpower_parameters.m_use || lnb_param.SatCR_idx == -1) { // use measure rotor input power to detect rotor state bool turn_fast = need_turn_fast(rotor_param.m_inputpower_parameters.m_turning_speed); eSecCommand::rotor cmd; @@ -950,6 +954,40 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA return -1; } +void eDVBSatelliteEquipmentControl::prepareTurnOffSatCR(iDVBFrontend &frontend, int satcr) +{ + eSecCommandList sec_sequence; + + // check if voltage is disabled + eSecCommand::pair compare; + compare.steps = +9; //only close frontend + compare.voltage = iDVBFrontend::voltageOff; + + sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS]) ); + + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage18_5) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS]) ); + + eDVBDiseqcCommand diseqc; + memset(diseqc.data, 0, MAX_DISEQC_LENGTH); + diseqc.len = 5; + diseqc.data[0] = 0xE0; + diseqc.data[1] = 0x10; + diseqc.data[2] = 0x5A; + diseqc.data[3] = satcr << 5; + diseqc.data[4] = 0x00; + + sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_LAST_DISEQC_CMD]) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) ); + sec_sequence.push_back( eSecCommand(eSecCommand::DELAYED_CLOSE_FRONTEND) ); + + frontend.setSecSequence(sec_sequence); +} + RESULT eDVBSatelliteEquipmentControl::clear() { eSecDebug("eDVBSatelliteEquipmentControl::clear()"); @@ -1254,6 +1292,26 @@ RESULT eDVBSatelliteEquipmentControl::setLNBSatCRvco(int SatCRvco) return -ENOENT; return 0; } + +RESULT eDVBSatelliteEquipmentControl::setLNBSatCRpositions(int SatCR_positions) +{ + eSecDebug("eDVBSatelliteEquipmentControl::setLNBSatCRpositions(%d)", SatCR_positions); + if(SatCR_positions < 1 || SatCR_positions > 2) + return -EPERM; + if ( currentLNBValid() ) + m_lnbs[m_lnbidx].SatCR_positions = SatCR_positions; + else + return -ENOENT; + return 0; +} + +RESULT eDVBSatelliteEquipmentControl::getLNBSatCRpositions() +{ + if ( currentLNBValid() ) + return m_lnbs[m_lnbidx].SatCR_positions; + return -ENOENT; +} + RESULT eDVBSatelliteEquipmentControl::getLNBSatCR() { if ( currentLNBValid() ) diff --git a/lib/dvb/sec.h b/lib/dvb/sec.h index c50aee4d..b38671d2 100644 --- a/lib/dvb/sec.h +++ b/lib/dvb/sec.h @@ -25,7 +25,8 @@ public: IF_TONE_GOTO, IF_NOT_TONE_GOTO, START_TUNE_TIMEOUT, SET_ROTOR_MOVING, - SET_ROTOR_STOPPED + SET_ROTOR_STOPPED, + DELAYED_CLOSE_FRONTEND }; int cmd; struct rotor @@ -103,6 +104,11 @@ public: { secSequence.push_back(cmd); } + void push_back(eSecCommandList &list) + { + ASSERT(*this != list); + secSequence.splice(end(), list.secSequence); + } void clear() { secSequence.clear(); @@ -252,6 +258,7 @@ public: #define MAX_SATCR 8 #define MAX_LNBNUM 32 + int SatCR_positions; int SatCR_idx; unsigned int SatCRvco; unsigned int UnicableTuningWord; @@ -311,6 +318,7 @@ public: #ifndef SWIG eDVBSatelliteEquipmentControl(eSmartPtrList &avail_frontends, eSmartPtrList &avail_simulate_frontends); RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int tunetimeout); + void prepareTurnOffSatCR(iDVBFrontend &frontend, int satcr); // used for unicable int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *, int frontend_id, int *highest_score_lnb=0); bool currentLNBValid() { return m_lnbidx > -1 && m_lnbidx < (int)(sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters)); } #endif @@ -346,9 +354,10 @@ public: /* Unicable Specific Parameters */ RESULT setLNBSatCR(int SatCR_idx); RESULT setLNBSatCRvco(int SatCRvco); -// RESULT checkGuardOffset(const eDVBFrontendParametersSatellite &sat); + RESULT setLNBSatCRpositions(int SatCR_positions); RESULT getLNBSatCR(); RESULT getLNBSatCRvco(); + RESULT getLNBSatCRpositions(); /* Satellite Specific Parameters */ RESULT addSatellite(int orbital_position); RESULT setVoltageMode(int mode); diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index c68e9404..663ec16d 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -16,6 +16,9 @@ from time import localtime, mktime from datetime import datetime from Tools.BoundFunction import boundFunction +from Tools import Directories +import xml.etree.cElementTree + def getConfigSatlist(orbpos, satlist): default_orbpos = None for x in satlist: @@ -234,6 +237,20 @@ class SecConfigure: print "sec config completed" def updateAdvanced(self, sec, slotid): + try: + if config.Nims[slotid].advanced.unicableconnected is not None: + if config.Nims[slotid].advanced.unicableconnected.value == True: + config.Nims[slotid].advanced.unicableconnectedTo.save_forced = True + self.linkNIMs(sec, slotid, int(config.Nims[slotid].advanced.unicableconnectedTo.value)) + connto = self.getRoot(slotid, int(config.Nims[slotid].advanced.unicableconnectedTo.value)) + if not self.linked.has_key(connto): + self.linked[connto] = [] + self.linked[connto].append(slotid) + else: + config.Nims[slotid].advanced.unicableconnectedTo.save_forced = False + except: + pass + lnbSat = {} for x in range(1,37): lnbSat[x] = [] @@ -276,24 +293,40 @@ class SecConfigure: sec.setLNBLOFH(10600000) sec.setLNBThreshold(11700000) elif currLnb.lof.value == "unicable": - sec.setLNBLOFL(9750000) - sec.setLNBLOFH(10600000) - sec.setLNBThreshold(11700000) if currLnb.unicable.value == "unicable_user": +#TODO satpositions for satcruser + sec.setLNBLOFL(currLnb.lofl.value * 1000) + sec.setLNBLOFH(currLnb.lofh.value * 1000) + sec.setLNBThreshold(currLnb.threshold.value * 1000) sec.setLNBSatCR(currLnb.satcruser.index) sec.setLNBSatCRvco(currLnb.satcrvcouser[currLnb.satcruser.index].value*1000) + sec.setLNBSatCRpositions(1) #HACK elif currLnb.unicable.value == "unicable_matrix": manufacturer_name = currLnb.unicableMatrixManufacturer.value manufacturer = currLnb.unicableMatrix[manufacturer_name] product_name = manufacturer.product.value sec.setLNBSatCR(manufacturer.scr[product_name].index) sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) + sec.setLNBSatCRpositions(manufacturer.positions[product_name][0].value) + sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000) + sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000) + sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000) + currLnb.unicableMatrixManufacturer.save_forced = True + manufacturer.product.save_forced = True + manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True elif currLnb.unicable.value == "unicable_lnb": manufacturer_name = currLnb.unicableLnbManufacturer.value manufacturer = currLnb.unicableLnb[manufacturer_name] product_name = manufacturer.product.value sec.setLNBSatCR(manufacturer.scr[product_name].index) sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) + sec.setLNBSatCRpositions(manufacturer.positions[product_name][0].value) + sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000) + sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000) + sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000) + currLnb.unicableLnbManufacturer.save_forced = True + manufacturer.product.save_forced = True + manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True elif currLnb.lof.value == "c_band": sec.setLNBLOFL(5150000) sec.setLNBLOFH(5150000) @@ -988,55 +1021,57 @@ def InitNimManager(nimmgr): lnb_choices_default = "universal_lnb" - unicablelnbproducts = { - "Humax": {"150 SCR":("1210","1420","1680","2040")}, - "Inverto": {"IDLP-40UNIQD+S":("1680","1420","2040","1210")}, - "Kathrein": {"UAS481":("1400","1516","1632","1748")}, - "Kreiling": {"KR1440":("1680","1420","2040","1210")}, - "Radix": {"Unicable LNB":("1680","1420","2040","1210")}, - "Wisi": {"OC 05":("1210","1420","1680","2040")}} + unicablelnbproducts = {} + unicablematrixproducts = {} + doc = xml.etree.cElementTree.parse("/usr/share/enigma2/unicable.xml") + root = doc.getroot() + + entry = root.find("lnb") + for manufacturer in entry.getchildren(): + m={} + for product in manufacturer.getchildren(): + scr=[] + lscr=("scr1","scr2","scr3","scr4","scr5","scr6","scr7","scr8") + for i in range(len(lscr)): + scr.append(product.get(lscr[i],"0")) + for i in range(len(lscr)): + if scr[len(lscr)-i-1] == "0": + scr.pop() + else: + break; + lof=[] + lof.append(product.get("positions","1")) + lof.append(product.get("lofl","9750")) + lof.append(product.get("lofh","10600")) + lof.append(product.get("threshold","11700")) + scr.append(tuple(lof)) + m.update({product.get("name"):tuple(scr)}) + unicablelnbproducts.update({manufacturer.get("name"):m}) + + entry = root.find("matrix") + for manufacturer in entry.getchildren(): + m={} + for product in manufacturer.getchildren(): + scr=[] + lscr=("scr1","scr2","scr3","scr4","scr5","scr6","scr7","scr8") + for i in range(len(lscr)): + scr.append(product.get(lscr[i],"0")) + for i in range(len(lscr)): + if scr[len(lscr)-i-1] == "0": + scr.pop() + else: + break; + lof=[] + lof.append(product.get("positions","1")) + lof.append(product.get("lofl","9750")) + lof.append(product.get("lofh","10600")) + lof.append(product.get("threshold","11700")) + scr.append(tuple(lof)) + m.update({product.get("name"):tuple(scr)}) + unicablematrixproducts.update({manufacturer.get("name"):m}) + UnicableLnbManufacturers = unicablelnbproducts.keys() UnicableLnbManufacturers.sort() - - unicablematrixproducts = { - "Ankaro": { - "UCS 51440":("1400","1632","1284","1516"), - "UCS 51820":("1400","1632","1284","1516","1864","2096","1748","1980"), - "UCS 51840":("1400","1632","1284","1516","1864","2096","1748","1980"), - "UCS 52240":("1400","1632"), - "UCS 52420":("1400","1632","1284","1516"), - "UCS 52440":("1400","1632","1284","1516"), - "UCS 91440":("1400","1632","1284","1516"), - "UCS 91820":("1400","1632","1284","1516","1864","2096","1748","1980"), - "UCS 91840":("1400","1632","1284","1516","1864","2096","1748","1980"), - "UCS 92240":("1400","1632"), - "UCS 92420":("1400","1632","1284","1516"), - "UCS 92440":("1400","1632","1284","1516")}, - "DCT Delta": { - "SUM518":("1284","1400","1516","1632","1748","1864","1980","2096"), - "SUM918":("1284","1400","1516","1632","1748","1864","1980","2096"), - "SUM928":("1284","1400","1516","1632","1748","1864","1980","2096")}, - "Inverto": { - "IDLP-UST11O-CUO1O-8PP":("1076","1178","1280","1382","1484","1586","1688","1790")}, - "Kathrein": { - "EXR501":("1400","1516","1632","1748"), - "EXR551":("1400","1516","1632","1748"), - "EXR552":("1400","1516")}, - "ROTEK": { - "EKL2/1":("1400","1516"), - "EKL2/1E":("0","0","1632","1748")}, - "Smart": { - "DPA 51":("1284","1400","1516","1632","1748","1864","1980","2096")}, - "Technisat": { - "TechniRouter 5/1x8 G":("1284","1400","1516","1632","1748","1864","1980","2096"), - "TechniRouter 5/1x8 K":("1284","1400","1516","1632","1748","1864","1980","2096"), - "TechniRouter 5/2x4 G":("1284","1400","1516","1632"), - "TechniRouter 5/2x4 K":("1284","1400","1516","1632")}, - "Telstar": { - "SCR 5/1x8 G":("1284","1400","1516","1632","1748","1864","1980","2096"), - "SCR 5/1x8 K":("1284","1400","1516","1632","1748","1864","1980","2096"), - "SCR 5/2x4 G":("1284","1400","1516","1632"), - "SCR 5/2x4 K":("1284","1400","1516","1632")}} UnicableMatrixManufacturers = unicablematrixproducts.keys() UnicableMatrixManufacturers.sort() @@ -1117,7 +1152,7 @@ def InitNimManager(nimmgr): scrlist = [] vcolist = unicablematrixproducts[y][z] tmp.vco[z] = ConfigSubList() - for cnt in range(1,1+len(vcolist)): + for cnt in range(1,1+len(vcolist)-1): vcofreq = int(vcolist[cnt-1]) if vcofreq == 0: scrlist.append(("%d" %cnt,"SCR %d " %cnt +_("not used"))) @@ -1137,29 +1172,54 @@ def InitNimManager(nimmgr): tmp.product = ConfigSelection(choices = products, default = products[0]) tmp.scr = ConfigSubDict() tmp.vco = ConfigSubDict() + tmp.lofl = ConfigSubDict() + tmp.lofh = ConfigSubDict() + tmp.loft = ConfigSubDict() + tmp.positions = ConfigSubDict() for z in products: scrlist = [] vcolist = unicablelnbproducts[y][z] tmp.vco[z] = ConfigSubList() - for cnt in range(1,1+len(vcolist)): + for cnt in range(1,1+len(vcolist)-1): scrlist.append(("%d" %cnt,"SCR %d" %cnt)) vcofreq = int(vcolist[cnt-1]) tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq))) tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) + + positions = int(vcolist[len(vcolist)-1][0]) + tmp.positions[z] = ConfigSubList() + tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) + + lofl = vcolist[len(vcolist)-1][1] + tmp.lofl[z] = ConfigSubList() + tmp.lofl[z].append(ConfigInteger(default=lofl, limits = (lofl, lofl))) + + lofh = int(vcolist[len(vcolist)-1][2]) + tmp.lofh[z] = ConfigSubList() + tmp.lofh[z].append(ConfigInteger(default=lofh, limits = (lofh, lofh))) + + loft = int(vcolist[len(vcolist)-1][3]) + tmp.loft[z] = ConfigSubList() + tmp.loft[z].append(ConfigInteger(default=loft, limits = (loft, loft))) + section.unicableLnb[y] = tmp - + +#TODO satpositions for satcruser section.satcruser = ConfigSelection(advanced_lnb_satcruser_choices, default="1") tmp = ConfigSubList() - tmp.append(ConfigInteger(default=1284, limits = (0, 9999))) - tmp.append(ConfigInteger(default=1400, limits = (0, 9999))) - tmp.append(ConfigInteger(default=1516, limits = (0, 9999))) - tmp.append(ConfigInteger(default=1632, limits = (0, 9999))) - tmp.append(ConfigInteger(default=1748, limits = (0, 9999))) - tmp.append(ConfigInteger(default=1864, limits = (0, 9999))) - tmp.append(ConfigInteger(default=1980, limits = (0, 9999))) - tmp.append(ConfigInteger(default=2096, limits = (0, 9999))) + tmp.append(ConfigInteger(default=1284, limits = (950, 2150))) + tmp.append(ConfigInteger(default=1400, limits = (950, 2150))) + tmp.append(ConfigInteger(default=1516, limits = (950, 2150))) + tmp.append(ConfigInteger(default=1632, limits = (950, 2150))) + tmp.append(ConfigInteger(default=1748, limits = (950, 2150))) + tmp.append(ConfigInteger(default=1864, limits = (950, 2150))) + tmp.append(ConfigInteger(default=1980, limits = (950, 2150))) + tmp.append(ConfigInteger(default=2096, limits = (950, 2150))) section.satcrvcouser = tmp + nim.advanced.unicableconnected = ConfigYesNo(default=False) + nim.advanced.unicableconnectedTo = ConfigSelection([(str(id), nimmgr.getNimDescription(id)) for id in nimmgr.getNimListOfType("DVB-S") if id != x]) + def configDiSEqCModeChanged(configElement): section = configElement.section if configElement.value == "1_2" and isinstance(section.longitude, ConfigNothing): diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 471b59ec..d7506e31 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -29,6 +29,7 @@ from time import localtime, strftime class ConfigElement(object): def __init__(self): self.saved_value = None + self.save_forced = False self.last_value = None self.save_disabled = False self.__notifiers = None @@ -83,7 +84,7 @@ class ConfigElement(object): # you need to override this if str(self.value) doesn't work def save(self): - if self.save_disabled or self.value == self.default: + if self.save_disabled or (self.value == self.default and not self.save_forced): self.saved_value = None else: self.saved_value = self.tostring(self.value) diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 749c09db..44f4251a 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -95,6 +95,7 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.advancedType = None self.advancedManufacturer = None self.advancedSCR = None + self.advancedConnected = None if self.nim.isMultiType(): multiType = self.nimConfig.multiType @@ -205,7 +206,7 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): checkList = (self.configMode, self.diseqcModeEntry, self.advancedSatsEntry, \ self.advancedLnbsEntry, self.advancedDiseqcMode, self.advancedUsalsEntry, \ self.advancedLof, self.advancedPowerMeasurement, self.turningSpeed, \ - self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, \ + self.advancedType, self.advancedSCR, self.advancedManufacturer, self.advancedUnicable, self.advancedConnected, \ self.uncommittedDiseqcCommand, self.cableScanType, self.multiType) if self["config"].getCurrent() == self.multiType: from Components.NimManager import InitNimManager @@ -285,6 +286,18 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): self.list.append(self.advancedType) self.list.append(self.advancedSCR) self.list.append(getConfigListEntry(_("Frequency"), manufacturer.vco[product_name][manufacturer.scr[product_name].index])) + + choices = [] + connectable = nimmanager.canConnectTo(self.slotid) + for id in connectable: + choices.append((str(id), nimmanager.getNimDescription(id))) + if len(choices): + self.advancedConnected = getConfigListEntry(_("connected"), self.nimConfig.advanced.unicableconnected) + self.list.append(self.advancedConnected) + if self.nimConfig.advanced.unicableconnected.value == True: + self.nimConfig.advanced.unicableconnectedTo.setChoices(choices) + self.list.append(getConfigListEntry(_("Connected to"),self.nimConfig.advanced.unicableconnectedTo)) + else: #kein Unicable self.list.append(getConfigListEntry(_("Voltage mode"), Sat.voltage)) self.list.append(getConfigListEntry(_("Increased voltage"), currLnb.increased_voltage)) -- cgit v1.2.3 From eb97f3d6d7b924d53994729a296f94c5b0c168c6 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 8 Jun 2010 19:49:22 +0200 Subject: NimManager.py: add missing conversion to int --- lib/python/Components/NimManager.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 663ec16d..9520f972 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -1040,10 +1040,10 @@ def InitNimManager(nimmgr): else: break; lof=[] - lof.append(product.get("positions","1")) - lof.append(product.get("lofl","9750")) - lof.append(product.get("lofh","10600")) - lof.append(product.get("threshold","11700")) + lof.append(int(product.get("positions",1))) + lof.append(int(product.get("lofl",9750))) + lof.append(int(product.get("lofh",10600))) + lof.append(int(product.get("threshold",11700))) scr.append(tuple(lof)) m.update({product.get("name"):tuple(scr)}) unicablelnbproducts.update({manufacturer.get("name"):m}) @@ -1062,10 +1062,10 @@ def InitNimManager(nimmgr): else: break; lof=[] - lof.append(product.get("positions","1")) - lof.append(product.get("lofl","9750")) - lof.append(product.get("lofh","10600")) - lof.append(product.get("threshold","11700")) + lof.append(int(product.get("positions",1))) + lof.append(int(product.get("lofl",9750))) + lof.append(int(product.get("lofh",10600))) + lof.append(int(product.get("threshold",11700))) scr.append(tuple(lof)) m.update({product.get("name"):tuple(scr)}) unicablematrixproducts.update({manufacturer.get("name"):m}) -- cgit v1.2.3 From ca082734334ea28bc248e619223fbc02f9fc2705 Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Wed, 9 Jun 2010 02:32:29 +0200 Subject: fix subtitle configlist crash --- lib/python/Components/ConfigList.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py index 418a1b67..ffbc69af 100755 --- a/lib/python/Components/ConfigList.py +++ b/lib/python/Components/ConfigList.py @@ -61,12 +61,13 @@ class ConfigList(HTMLComponent, GUIComponent, object): GUI_WIDGET = eListbox def selectionChanged(self): - if self.current: + if isinstance(self.current,tuple) and len(self.current) == 2: self.current[1].onDeselect(self.session) self.current = self.getCurrent() - if self.current: + if isinstance(self.current,tuple) and len(self.current) == 2: self.current[1].onSelect(self.session) - + else: + return for x in self.onSelectionChanged: x() @@ -75,11 +76,11 @@ class ConfigList(HTMLComponent, GUIComponent, object): instance.setContent(self.l) def preWidgetRemove(self, instance): - if self.current: + if isinstance(self.current,tuple) and len(self.current) == 2: self.current[1].onDeselect(self.session) instance.selectionChanged.get().remove(self.selectionChanged) instance.setContent(None) - + def setList(self, l): self.timer.stop() self.__list = l -- cgit v1.2.3 From 7d841169e08113d2fa20de0605147117c6ed86f0 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 9 Jun 2010 14:18:29 +0200 Subject: fix crash when unicable matrix is selected, cleanup code --- lib/python/Components/NimManager.py | 124 +++++++++++++++--------------------- 1 file changed, 52 insertions(+), 72 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 9520f972..2deb2bf7 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -293,17 +293,9 @@ class SecConfigure: sec.setLNBLOFH(10600000) sec.setLNBThreshold(11700000) elif currLnb.lof.value == "unicable": - if currLnb.unicable.value == "unicable_user": -#TODO satpositions for satcruser - sec.setLNBLOFL(currLnb.lofl.value * 1000) - sec.setLNBLOFH(currLnb.lofh.value * 1000) - sec.setLNBThreshold(currLnb.threshold.value * 1000) - sec.setLNBSatCR(currLnb.satcruser.index) - sec.setLNBSatCRvco(currLnb.satcrvcouser[currLnb.satcruser.index].value*1000) - sec.setLNBSatCRpositions(1) #HACK - elif currLnb.unicable.value == "unicable_matrix": - manufacturer_name = currLnb.unicableMatrixManufacturer.value - manufacturer = currLnb.unicableMatrix[manufacturer_name] + def setupUnicable(configManufacturer, ProductDict): + manufacturer_name = configManufacturer.value + manufacturer = ProductDict[manufacturer_name] product_name = manufacturer.product.value sec.setLNBSatCR(manufacturer.scr[product_name].index) sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) @@ -311,22 +303,22 @@ class SecConfigure: sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000) sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000) sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000) - currLnb.unicableMatrixManufacturer.save_forced = True + configManufacturer.save_forced = True manufacturer.product.save_forced = True manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True + + if currLnb.unicable.value == "unicable_user": +#TODO satpositions for satcruser + sec.setLNBLOFL(currLnb.lofl.value * 1000) + sec.setLNBLOFH(currLnb.lofh.value * 1000) + sec.setLNBThreshold(currLnb.threshold.value * 1000) + sec.setLNBSatCR(currLnb.satcruser.index) + sec.setLNBSatCRvco(currLnb.satcrvcouser[currLnb.satcruser.index].value*1000) + sec.setLNBSatCRpositions(1) #HACK + elif currLnb.unicable.value == "unicable_matrix": + setupUnicable(currLnb.unicableMatrixManufacturer, currLnb.unicableMatrix) elif currLnb.unicable.value == "unicable_lnb": - manufacturer_name = currLnb.unicableLnbManufacturer.value - manufacturer = currLnb.unicableLnb[manufacturer_name] - product_name = manufacturer.product.value - sec.setLNBSatCR(manufacturer.scr[product_name].index) - sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) - sec.setLNBSatCRpositions(manufacturer.positions[product_name][0].value) - sec.setLNBLOFL(manufacturer.lofl[product_name][0].value * 1000) - sec.setLNBLOFH(manufacturer.lofh[product_name][0].value * 1000) - sec.setLNBThreshold(manufacturer.loft[product_name][0].value * 1000) - currLnb.unicableLnbManufacturer.save_forced = True - manufacturer.product.save_forced = True - manufacturer.vco[product_name][manufacturer.scr[product_name].index].save_forced = True + setupUnicable(currLnb.unicableLnbManufacturer, currLnb.unicableLnb) elif currLnb.lof.value == "c_band": sec.setLNBLOFL(5150000) sec.setLNBLOFH(5150000) @@ -1138,72 +1130,60 @@ def InitNimManager(nimmgr): else: section.unicable = ConfigSelection(choices = {"unicable_user": _("User defined")}, default = "unicable_user") - if lnb < 3: - section.unicableMatrix = ConfigSubDict() - section.unicableMatrixManufacturer = ConfigSelection(choices = UnicableMatrixManufacturers, default = UnicableMatrixManufacturers[0]) - for y in unicablematrixproducts: - products = unicablematrixproducts[y].keys() + def fillUnicableConf(sectionDict, unicableproducts, vco_null_check): + for y in unicableproducts: + products = unicableproducts[y].keys() products.sort() tmp = ConfigSubsection() tmp.product = ConfigSelection(choices = products, default = products[0]) tmp.scr = ConfigSubDict() tmp.vco = ConfigSubDict() + tmp.lofl = ConfigSubDict() + tmp.lofh = ConfigSubDict() + tmp.loft = ConfigSubDict() + tmp.positions = ConfigSubDict() for z in products: scrlist = [] - vcolist = unicablematrixproducts[y][z] + vcolist = unicableproducts[y][z] tmp.vco[z] = ConfigSubList() for cnt in range(1,1+len(vcolist)-1): vcofreq = int(vcolist[cnt-1]) - if vcofreq == 0: + if vcofreq == 0 and vco_null_check: scrlist.append(("%d" %cnt,"SCR %d " %cnt +_("not used"))) else: scrlist.append(("%d" %cnt,"SCR %d" %cnt)) tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq))) - tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) - section.unicableMatrix[y] = tmp + tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) + + positions = int(vcolist[len(vcolist)-1][0]) + tmp.positions[z] = ConfigSubList() + tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) + + lofl = vcolist[len(vcolist)-1][1] + tmp.lofl[z] = ConfigSubList() + tmp.lofl[z].append(ConfigInteger(default=lofl, limits = (lofl, lofl))) + + lofh = int(vcolist[len(vcolist)-1][2]) + tmp.lofh[z] = ConfigSubList() + tmp.lofh[z].append(ConfigInteger(default=lofh, limits = (lofh, lofh))) + + loft = int(vcolist[len(vcolist)-1][3]) + tmp.loft[z] = ConfigSubList() + tmp.loft[z].append(ConfigInteger(default=loft, limits = (loft, loft))) + sectionDict[y] = tmp + + if lnb < 3: + print "MATRIX" + section.unicableMatrix = ConfigSubDict() + section.unicableMatrixManufacturer = ConfigSelection(UnicableMatrixManufacturers, UnicableMatrixManufacturers[0]) + fillUnicableConf(section.unicableMatrix, unicablematrixproducts, True) if lnb < 2: + print "LNB" section.unicableLnb = ConfigSubDict() section.unicableLnbManufacturer = ConfigSelection(UnicableLnbManufacturers, UnicableLnbManufacturers[0]) - for y in unicablelnbproducts: - products = unicablelnbproducts[y].keys() - products.sort() - tmp = ConfigSubsection() - tmp.product = ConfigSelection(choices = products, default = products[0]) - tmp.scr = ConfigSubDict() - tmp.vco = ConfigSubDict() - tmp.lofl = ConfigSubDict() - tmp.lofh = ConfigSubDict() - tmp.loft = ConfigSubDict() - tmp.positions = ConfigSubDict() - for z in products: - scrlist = [] - vcolist = unicablelnbproducts[y][z] - tmp.vco[z] = ConfigSubList() - for cnt in range(1,1+len(vcolist)-1): - scrlist.append(("%d" %cnt,"SCR %d" %cnt)) - vcofreq = int(vcolist[cnt-1]) - tmp.vco[z].append(ConfigInteger(default=vcofreq, limits = (vcofreq, vcofreq))) - tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) - - positions = int(vcolist[len(vcolist)-1][0]) - tmp.positions[z] = ConfigSubList() - tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) - - lofl = vcolist[len(vcolist)-1][1] - tmp.lofl[z] = ConfigSubList() - tmp.lofl[z].append(ConfigInteger(default=lofl, limits = (lofl, lofl))) - - lofh = int(vcolist[len(vcolist)-1][2]) - tmp.lofh[z] = ConfigSubList() - tmp.lofh[z].append(ConfigInteger(default=lofh, limits = (lofh, lofh))) - - loft = int(vcolist[len(vcolist)-1][3]) - tmp.loft[z] = ConfigSubList() - tmp.loft[z].append(ConfigInteger(default=loft, limits = (loft, loft))) - - section.unicableLnb[y] = tmp - + fillUnicableConf(section.unicableLnb, unicablelnbproducts, False) + #TODO satpositions for satcruser section.satcruser = ConfigSelection(advanced_lnb_satcruser_choices, default="1") tmp = ConfigSubList() -- cgit v1.2.3 From f7f442a1d0845e7dfd923c1d783eb612357f3e94 Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Fri, 11 Jun 2010 23:05:36 +0200 Subject: don't crash on empty configlist lines --- lib/python/Components/ConfigList.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py index ffbc69af..5a02c38d 100755 --- a/lib/python/Components/ConfigList.py +++ b/lib/python/Components/ConfigList.py @@ -88,7 +88,7 @@ class ConfigList(HTMLComponent, GUIComponent, object): if l is not None: for x in l: - assert isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement" + assert isinstance(x, ConfigElement), "entry in ConfigList " + str(x) + " must be a ConfigElement" def getList(self): return self.__list -- cgit v1.2.3 From 7c42f86e02b3ab79a8d4366d2b74e01e490e46f1 Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Mon, 14 Jun 2010 12:59:12 +0200 Subject: fix-fix configlist assertion (add #188) --- lib/python/Components/ConfigList.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ConfigList.py b/lib/python/Components/ConfigList.py index 5a02c38d..24f917f7 100755 --- a/lib/python/Components/ConfigList.py +++ b/lib/python/Components/ConfigList.py @@ -88,7 +88,7 @@ class ConfigList(HTMLComponent, GUIComponent, object): if l is not None: for x in l: - assert isinstance(x, ConfigElement), "entry in ConfigList " + str(x) + " must be a ConfigElement" + assert len(x) < 2 or isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement" def getList(self): return self.__list -- cgit v1.2.3 From baf0a59fa2538724a343aac0082b55d0ac591120 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 28 Jun 2010 18:27:26 +0200 Subject: add support for /proc/stb/frontend/X/lnb_sense --- lib/dvb/frontend.cpp | 8 +++++--- lib/python/Components/NimManager.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 0081e324..fc2d7ec5 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1458,9 +1458,11 @@ int eDVBFrontend::readInputpower() return 0; int power=m_slotid; // this is needed for read inputpower from the correct tuner ! char proc_name[64]; - sprintf(proc_name, "/proc/stb/fp/lnb_sense%d", m_slotid); - FILE *f=fopen(proc_name, "r"); - if (f) + char proc_name2[64]; + sprintf(proc_name, "/proc/stb/frontend/%d/lnb_sense", m_slotid); + sprintf(proc_name2, "/proc/stb/fp/lnb_sense%d", m_slotid); + FILE *f; + if ((f=fopen(proc_name, "r")) || (f=fopen(proc_name2, "r"))) { if (fscanf(f, "%d", &power) != 1) eDebug("read %s failed!! (%m)", proc_name); diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 2deb2bf7..805be4df 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -1208,7 +1208,7 @@ def InitNimManager(nimmgr): section.latitude = ConfigFloat(default = [50,767], limits = [(0,359),(0,999)]) section.latitudeOrientation = ConfigSelection(latitude_orientation_choices, "north") section.powerMeasurement = ConfigYesNo(default=True) - section.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm8000" and 15 or 50, limits=(0, 100)) + section.powerThreshold = ConfigInteger(default=hw.get_device_name() == "dm7025" and 50 or 15, limits=(0, 100)) section.turningSpeed = ConfigSelection(turning_speed_choices, "fast") section.fastTurningBegin = ConfigDateTime(default=advanced_lnb_fast_turning_btime, formatstring = _("%H:%M"), increment = 600) section.fastTurningEnd = ConfigDateTime(default=advanced_lnb_fast_turning_etime, formatstring = _("%H:%M"), increment = 600) -- cgit v1.2.3 From 1d8bd795e00ace3dde10b2ad5986a0593bc2c234 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 22 Jul 2010 19:37:35 +0200 Subject: fixes bug #556 - fixes adding timers from inside the movie player: the .ts service was added as channel - fixes a small bug in ConfigSelection to allow empty strings inside the ChoicesList --- RecordTimer.py | 5 ++++- ServiceReference.py | 6 ++++++ lib/python/Components/config.py | 2 +- lib/python/Screens/TimerEntry.py | 22 +++++++++++++++++++--- 4 files changed, 30 insertions(+), 5 deletions(-) (limited to 'lib/python/Components') diff --git a/RecordTimer.py b/RecordTimer.py index 1608caaf..def75684 100755 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -102,7 +102,10 @@ class RecordTimerEntry(timer.TimerEntry, object): assert isinstance(serviceref, ServiceReference) - self.service_ref = serviceref + if serviceref.getType() == eServiceReference.idDVB and serviceref.getPath() == "": + self.service_ref = serviceref + else: + self.service_ref = ServiceReference(None) self.eit = eit self.dontSave = False self.name = name diff --git a/ServiceReference.py b/ServiceReference.py index 11e28786..5d11ae77 100644 --- a/ServiceReference.py +++ b/ServiceReference.py @@ -20,3 +20,9 @@ class ServiceReference(eServiceReference): def list(self): return self.serviceHandler.list(self.ref) + + def getType(self): + return self.ref.type + + def getPath(self): + return self.ref.getPath() diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index d7506e31..08dd3745 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -179,7 +179,7 @@ class choicesList(object): # XXX: we might want a better name for this def __list__(self): if self.type == choicesList.LIST_TYPE_LIST: - ret = [not isinstance(x, tuple) and x or x[0] for x in self.choices] + ret = [not isinstance(x, tuple) and x or len(x) > 0 and x[0] or len(x) == 0 and x for x in self.choices] else: ret = self.choices.keys() return ret or [""] diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py index 64fa9f19..62faf9bf 100644 --- a/lib/python/Screens/TimerEntry.py +++ b/lib/python/Screens/TimerEntry.py @@ -13,8 +13,9 @@ from Components.UsageConfig import defaultMoviePath from Screens.MovieSelection import getPreferredTagEditor from Screens.LocationBox import MovieLocationBox from Screens.ChoiceBox import ChoiceBox +from Screens.MessageBox import MessageBox from RecordTimer import AFTEREVENT -from enigma import eEPGCache +from enigma import eEPGCache, eServiceReference from time import localtime, mktime, time, strftime from datetime import datetime @@ -245,7 +246,7 @@ class TimerEntry(Screen, ConfigListScreen): self.timerentry_service_ref = ServiceReference(args[0]) self.timerentry_service.setCurrentText(self.timerentry_service_ref.getServiceName()) self["config"].invalidate(self.channelEntry) - + def getTimestamp(self, date, mytime): d = localtime(date) dt = datetime(d.tm_year, d.tm_mon, d.tm_mday, mytime[0], mytime[1]) @@ -264,7 +265,22 @@ class TimerEntry(Screen, ConfigListScreen): end += 86400 return begin, end - def keyGo(self): + def selectChannelSelector(self, *args): + self.session.openWithCallback( + self.finishedChannelSelectionCorrection, + ChannelSelection.SimpleChannelSelection, + _("Select channel to record from") + ) + + def finishedChannelSelectionCorrection(self, *args): + if args: + self.finishedChannelSelection(*args) + self.keyGo() + + def keyGo(self, result = None): + if self.timerentry_service_ref.getType() != eServiceReference.idDVB or self.timerentry_service_ref.getPath() != "": + self.session.openWithCallback(self.selectChannelSelector, MessageBox, _("You didn't select a channel to record from."), MessageBox.TYPE_ERROR) + return self.timer.name = self.timerentry_name.value self.timer.description = self.timerentry_description.value self.timer.justplay = self.timerentry_justplay.value == "zap" -- cgit v1.2.3 From fcb00fd6aecf823bafd8455c921c5a4b23a96e95 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Sat, 24 Jul 2010 12:33:58 +0200 Subject: refs bug #460 swap bflag and eflag (begin and end flag for timer sanity check) old version: bflag = 1, eflag = -1 that lead to the sort function sorting timers with begin=end wrong: self.nrep_eventlist.extend([(self.newtimer.begin,self.bflag,-1),(self.newtimer.end,self.eflag,-1)]) resulted in (end, eflag) before (begin, bflag) and in a conflict with zapping timers with end=begin (no end time) --- lib/python/Components/TimerSanityCheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/TimerSanityCheck.py b/lib/python/Components/TimerSanityCheck.py index 8f48d1ec..b472a19e 100644 --- a/lib/python/Components/TimerSanityCheck.py +++ b/lib/python/Components/TimerSanityCheck.py @@ -12,8 +12,8 @@ class TimerSanityCheck: self.simultimer = [] self.rep_eventlist = [] self.nrep_eventlist = [] - self.bflag = 1 - self.eflag = -1 + self.bflag = -1 + self.eflag = 1 def check(self, ext_timer=1): print "check" -- cgit v1.2.3 From 6be1855d457d28e25917a29f710f2401519d7160 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Sat, 24 Jul 2010 23:14:58 +0200 Subject: Enigma2-Network: update Wlan plugin to support new python-wifi. some fixes and cleanups. refs #558 --- lib/python/Components/About.py | 11 ++ lib/python/Components/Network.py | 54 ++++--- .../SystemPlugins/NetworkWizard/NetworkWizard.py | 2 +- .../Plugins/SystemPlugins/WirelessLan/Wlan.py | 179 ++++++++++----------- .../Plugins/SystemPlugins/WirelessLan/plugin.py | 73 ++++++++- lib/python/Screens/NetworkSetup.py | 68 +++++--- 6 files changed, 251 insertions(+), 136 deletions(-) mode change 100644 => 100755 lib/python/Components/About.py (limited to 'lib/python/Components') diff --git a/lib/python/Components/About.py b/lib/python/Components/About.py old mode 100644 new mode 100755 index 8e332e33..6b322c9d --- a/lib/python/Components/About.py +++ b/lib/python/Components/About.py @@ -1,5 +1,6 @@ from Tools.Directories import resolveFilename, SCOPE_SYSETC from enigma import getEnigmaVersionString +from os import popen class About: def __init__(self): @@ -43,4 +44,14 @@ class About: def getEnigmaVersionString(self): return getEnigmaVersionString() + def getKernelVersionString(self): + try: + result = popen("uname -r","r").read().strip("\n").split('-') + kernel_version = result[0] + return kernel_version + except: + pass + + return "unknown" + about = About() diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index e8a3d459..e980cb8c 100755 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -4,6 +4,7 @@ from socket import * from enigma import eConsoleAppContainer from Components.Console import Console from Components.PluginComponent import plugins +from Components.About import about from Plugins.Plugin import PluginDescriptor class Network: @@ -349,8 +350,10 @@ class Network: return _("Zydas")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") elif os_path.realpath(driverdir).endswith('rt73'): return _("Ralink")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") + elif os_path.realpath(driverdir).endswith('rt73usb'): + return _("Ralink")+ " " + str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") else: - return _("Unknown network adapter.") + return str(os_path.basename(os_path.realpath(driverdir))) + " " + _("WLAN adapter.") else: return _("Unknown network adapter.") @@ -606,24 +609,39 @@ class Network: if callback is not None: callback(True) - def detectWlanModule(self): + def detectWlanModule(self, iface = None): self.wlanmodule = None - rt73_dir = "/sys/bus/usb/drivers/rt73/" - zd1211b_dir = "/sys/bus/usb/drivers/zd1211b/" - madwifi_dir = "/sys/bus/pci/drivers/ath_pci/" - if os_path.exists(madwifi_dir): - files = listdir(madwifi_dir) - if len(files) >= 1: - self.wlanmodule = 'madwifi' - if os_path.exists(rt73_dir): - rtfiles = listdir(rt73_dir) - if len(rtfiles) == 2 or len(rtfiles) == 5: - self.wlanmodule = 'ralink' - if os_path.exists(zd1211b_dir): - zdfiles = listdir(zd1211b_dir) - if len(zdfiles) == 1 or len(zdfiles) == 5: - self.wlanmodule = 'zydas' - return self.wlanmodule + classdir = "/sys/class/net/" + iface + "/device/" + driverdir = "/sys/class/net/" + iface + "/device/driver/" + if os_path.exists(classdir): + classfiles = listdir(classdir) + driver_found = False + nl80211_found = False + for x in classfiles: + if x == 'driver': + driver_found = True + if x.startswith('ieee80211:'): + nl80211_found = True + + if driver_found and nl80211_found: + #print about.getKernelVersionString() + self.wlanmodule = "nl80211" + else: + if driver_found and not nl80211_found: + driverfiles = listdir(driverdir) + if os_path.realpath(driverdir).endswith('ath_pci'): + if len(driverfiles) >= 1: + self.wlanmodule = 'madwifi' + if os_path.realpath(driverdir).endswith('rt73'): + if len(driverfiles) == 2 or len(driverfiles) == 5: + self.wlanmodule = 'ralink' + if os_path.realpath(driverdir).endswith('zd1211b'): + if len(driverfiles) == 1 or len(driverfiles) == 5: + self.wlanmodule = 'zydas' + if self.wlanmodule is None: + self.wlanmodule = "wext" + print 'Using "%s" as wpa-supplicant driver' % (self.wlanmodule) + return self.wlanmodule def calc_netmask(self,nmask): from struct import pack, unpack diff --git a/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py b/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py index a8b34acd..d7e83072 100755 --- a/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py +++ b/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py @@ -257,7 +257,7 @@ class NetworkWizard(WizardLanguage, Rc): text1 = _("Your Dreambox is now ready to use.\n\nYour internet connection is working now.\n\n") text2 = _('Accesspoint:') + "\t" + str(status[self.selectedInterface]["acesspoint"]) + "\n" text3 = _('SSID:') + "\t" + str(status[self.selectedInterface]["essid"]) + "\n" - text4 = _('Link Quality:') + "\t" + str(status[self.selectedInterface]["quality"])+"%" + "\n" + text4 = _('Link Quality:') + "\t" + str(status[self.selectedInterface]["quality"])+ "\n" text5 = _('Signal Strength:') + "\t" + str(status[self.selectedInterface]["signal"]) + "\n" text6 = _('Bitrate:') + "\t" + str(status[self.selectedInterface]["bitrate"]) + "\n" text7 = _('Encryption:') + " " + str(status[self.selectedInterface]["encryption"]) + "\n" diff --git a/lib/python/Plugins/SystemPlugins/WirelessLan/Wlan.py b/lib/python/Plugins/SystemPlugins/WirelessLan/Wlan.py index 1c1471ce..baefd435 100755 --- a/lib/python/Plugins/SystemPlugins/WirelessLan/Wlan.py +++ b/lib/python/Plugins/SystemPlugins/WirelessLan/Wlan.py @@ -1,7 +1,3 @@ -#from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER -#from Components.MultiContent import MultiContentEntryText -#from Components.GUIComponent import GUIComponent -#from Components.HTMLComponent import HTMLComponent from Components.config import config, ConfigYesNo, NoSave, ConfigSubsection, ConfigText, ConfigSelection, ConfigPassword from Components.Console import Console @@ -10,7 +6,8 @@ from string import maketrans, strip import sys import types from re import compile as re_compile, search as re_search -from iwlibs import getNICnames, Wireless, Iwfreq +from pythonwifi.iwlibs import getNICnames, Wireless, Iwfreq, getWNICnames +from pythonwifi import flags as wififlags list = [] list.append("WEP") @@ -65,38 +62,42 @@ class Wlan: print "self.iface im iwconfigFinished",self.iface callback = extra_args data = { 'essid': False, 'frequency': False, 'acesspoint': False, 'bitrate': False, 'encryption': False, 'quality': False, 'signal': False } - #print "result im iwconfigFinished",result for line in result.splitlines(): - #print "line",line line = line.strip() if "ESSID" in line: if "off/any" in line: ssid = _("No Connection") else: - tmpssid=(line[line.index('ESSID')+7:len(line)-1]) - if tmpssid == '': - ssid = _("Hidden networkname") - elif tmpssid ==' ': - ssid = _("Hidden networkname") + if "Nickname" in line: + tmpssid=(line[line.index('ESSID')+7:line.index('" Nickname')]) + if tmpssid == '': + ssid = _("Hidden networkname") + elif tmpssid ==' ': + ssid = _("Hidden networkname") + else: + ssid = tmpssid else: - ssid = tmpssid - #print "SSID->",ssid + tmpssid=(line[line.index('ESSID')+7:len(line)-1]) + if tmpssid == '': + ssid = _("Hidden networkname") + elif tmpssid ==' ': + ssid = _("Hidden networkname") + else: + ssid = tmpssid + if ssid is not None: data['essid'] = ssid if 'Frequency' in line: frequency = line[line.index('Frequency')+10 :line.index(' GHz')] - #print "Frequency",frequency if frequency is not None: data['frequency'] = frequency if "Access Point" in line: ap=line[line.index('Access Point')+14:len(line)-1] - #print "AP",ap if ap is not None: data['acesspoint'] = ap if "Bit Rate" in line: br = line[line.index('Bit Rate')+9 :line.index(' Mb/s')] - #print "Bitrate",br if br is not None: data['bitrate'] = br if 'Encryption key' in line: @@ -104,7 +105,6 @@ class Wlan: enc = _("Disabled") else: enc = line[line.index('Encryption key')+15 :line.index(' Security')] - #print "Encryption key",enc if enc is not None: data['encryption'] = _("Enabled") if 'Quality' in line: @@ -112,12 +112,10 @@ class Wlan: qual = line[line.index('Quality')+8:line.index('/100')] else: qual = line[line.index('Quality')+8:line.index('Sig')] - #print "Quality",qual if qual is not None: data['quality'] = qual if 'Signal level' in line: - signal = line[line.index('Signal level')+14 :line.index(' dBm')] - #print "Signal level",signal + signal = line[line.index('Signal level')+13 :line.index(' dBm')] if signal is not None: data['signal'] = signal @@ -130,7 +128,6 @@ class Wlan: callback(True,self.wlaniface) def getAdapterAttribute(self, attribute): - print "im getAdapterAttribute" if self.wlaniface.has_key(self.iface): print "self.wlaniface.has_key",self.iface if self.wlaniface[self.iface].has_key(attribute): @@ -142,13 +139,17 @@ class Wlan: def getWirelessInterfaces(self): - iwifaces = None - try: - iwifaces = getNICnames() - except: - print "[Wlan.py] No Wireless Networkcards could be found" - - return iwifaces + device = re_compile('[a-z]{2,}[0-9]*:') + ifnames = [] + + fp = open('/proc/net/wireless', 'r') + for line in fp: + try: + # append matching pattern, without the trailing colon + ifnames.append(device.search(line).group()[:-1]) + except AttributeError: + pass + return ifnames def getNetworkList(self): @@ -156,8 +157,8 @@ class Wlan: ifobj = Wireless(self.iface) # a Wireless NIC Object #Association mappings - stats, quality, discard, missed_beacon = ifobj.getStatistics() - snr = quality.signallevel - quality.noiselevel + #stats, quality, discard, missed_beacon = ifobj.getStatistics() + #snr = quality.signallevel - quality.noiselevel try: scanresults = ifobj.scan() @@ -167,55 +168,47 @@ class Wlan: if scanresults is not None: aps = {} + (num_channels, frequencies) = ifobj.getChannelInfo() + index = 1 for result in scanresults: - bssid = result.bssid - - encryption = map(lambda x: hex(ord(x)), result.encode) - - if encryption[-1] == "0x8": + + if result.encode.flags & wififlags.IW_ENCODE_DISABLED > 0: + encryption = False + elif result.encode.flags & wififlags.IW_ENCODE_NOKEY > 0: encryption = True else: - encryption = False - + encryption = None + + signal = str(result.quality.siglevel-0x100) + " dBm" + quality = "%s/%s" % (result.quality.quality,ifobj.getQualityMax().quality) + extra = [] for element in result.custom: element = element.encode() extra.append( strip(self.asciify(element)) ) - - if result.quality.sl is 0 and len(extra) > 0: - begin = extra[0].find('SignalStrength=')+15 - - done = False - end = begin+1 - - while not done: - if extra[0][begin:end].isdigit(): - end += 1 - else: - done = True - end -= 1 - - signal = extra[0][begin:end] - #print "[Wlan.py] signal is:" + str(signal) + for element in extra: + print element + if 'SignalStrength' in element: + signal = element[element.index('SignalStrength')+15:element.index(',L')] + if 'LinkQuality' in element: + quality = element[element.index('LinkQuality')+12:len(element)] - else: - signal = str(result.quality.sl) - aps[bssid] = { 'active' : True, 'bssid': result.bssid, - 'channel': result.frequency.getChannel(result.frequency.getFrequency()), + 'channel': frequencies.index(ifobj._formatFrequency(result.frequency.getFrequency())) + 1, 'encrypted': encryption, 'essid': strip(self.asciify(result.essid)), 'iface': self.iface, - 'maxrate' : result.rate[-1], - 'noise' : result.quality.getNoiselevel(), - 'quality' : str(result.quality.quality), - 'signal' : signal, + 'maxrate' : ifobj._formatBitrate(result.rate[-1][-1]), + 'noise' : '',#result.quality.nlevel-0x100, + 'quality' : str(quality), + 'signal' : str(signal), 'custom' : extra, } - print aps[bssid] + #print "GOT APS ENTRY:",aps[bssid] + index = index + 1 return aps @@ -226,12 +219,11 @@ class Wlan: self.channel = str(fq.getChannel(str(ifobj.getFrequency()[0:-3]))) except: self.channel = 0 - #print ifobj.getStatistics() status = { - 'BSSID': str(ifobj.getAPaddr()), + 'BSSID': str(ifobj.getAPaddr()), #ifobj.getStatistics() 'ESSID': str(ifobj.getEssid()), - 'quality': str(ifobj.getStatistics()[1].quality), - 'signal': str(ifobj.getStatistics()[1].sl), + 'quality': "%s/%s" % (ifobj.getStatistics()[1].quality,ifobj.getQualityMax().quality), + 'signal': str(ifobj.getStatistics()[1].siglevel-0x100) + " dBm", 'bitrate': str(ifobj.getBitrate()), 'channel': str(self.channel), #'channel': str(fq.getChannel(str(ifobj.getFrequency()[0:-3]))), @@ -326,7 +318,6 @@ class wpaSupplicant: essid = split[1][1:-1] elif split[0] == 'proto': - print "split[1]",split[1] config.plugins.wlan.encryption.enabled.value = True if split[1] == "WPA" : mode = 'WPA' @@ -354,12 +345,9 @@ class wpaSupplicant: else: config.plugins.wlan.encryption.wepkeytype.value = 'HEX' config.plugins.wlan.encryption.psk.value = split[1] - print "[Wlan.py] Got Encryption: WEP - keytype is: "+config.plugins.wlan.encryption.wepkeytype.value - print "[Wlan.py] Got Encryption: WEP - key0 is: "+config.plugins.wlan.encryption.psk.value elif split[0] == 'psk': config.plugins.wlan.encryption.psk.value = split[1][1:-1] - print "[Wlan.py] Got PSK: "+split[1][1:-1] else: pass @@ -436,24 +424,30 @@ class Status: if "off/any" in line: ssid = _("No Connection") else: - tmpssid=(line[line.index('ESSID')+7:len(line)-1]) - if tmpssid == '': - ssid = _("Hidden networkname") - elif tmpssid ==' ': - ssid = _("Hidden networkname") + if "Nickname" in line: + tmpssid=(line[line.index('ESSID')+7:line.index('" Nickname')]) + if tmpssid == '': + ssid = _("Hidden networkname") + elif tmpssid ==' ': + ssid = _("Hidden networkname") + else: + ssid = tmpssid else: - ssid = tmpssid - #print "SSID->",ssid + tmpssid=(line[line.index('ESSID')+7:len(line)-1]) + if tmpssid == '': + ssid = _("Hidden networkname") + elif tmpssid ==' ': + ssid = _("Hidden networkname") + else: + ssid = tmpssid if ssid is not None: data['essid'] = ssid if 'Frequency' in line: frequency = line[line.index('Frequency')+10 :line.index(' GHz')] - #print "Frequency",frequency if frequency is not None: data['frequency'] = frequency if "Access Point" in line: ap=line[line.index('Access Point')+14:len(line)] - #print "AP",ap if ap is not None: data['acesspoint'] = ap if ap == "Not-Associated": @@ -467,7 +461,6 @@ class Status: br += " Mb/s" else: br = line[line.index('Bit Rate')+9 :line.index(' Mb/s')] + " Mb/s" - #print "Bitrate",br if br is not None: data['bitrate'] = br if 'Encryption key' in line: @@ -480,28 +473,30 @@ class Status: enc = line[line.index('Encryption key')+15 :line.index(' Security')] if enc is not None: enc = _("Enabled") - #print "Encryption key",enc if enc is not None: data['encryption'] = enc if 'Quality' in line: if "/100" in line: - qual = line[line.index('Quality')+8:line.index('/100')] + #qual = line[line.index('Quality')+8:line.index('/100')] + qual = line[line.index('Quality')+8:line.index(' Signal')] else: qual = line[line.index('Quality')+8:line.index('Sig')] - #print "Quality",qual if qual is not None: data['quality'] = qual if 'Signal level' in line: if "dBm" in line: - signal = line[line.index('Signal level')+14 :line.index(' dBm')] + signal = line[line.index('Signal level')+13 :line.index(' dBm')] signal += " dBm" elif "/100" in line: - signal = line[line.index('Signal level')+13:line.index('/100 Noise')] - signal += "%" + if "Noise" in line: + signal = line[line.index('Signal level')+13:line.index(' Noise')] + else: + signal = line[line.index('Signal level')+13:len(line)] else: - signal = line[line.index('Signal level')+13:line.index(' Noise')] - signal += "%" - #print "Signal level",signal + if "Noise" in line: + signal = line[line.index('Signal level')+13:line.index(' Noise')] + else: + signal = line[line.index('Signal level')+13:len(line)] if signal is not None: data['signal'] = signal @@ -515,12 +510,10 @@ class Status: callback(True,self.wlaniface) def getAdapterAttribute(self, iface, attribute): - print "im getAdapterAttribute" self.iface = iface if self.wlaniface.has_key(self.iface): - print "self.wlaniface.has_key",self.iface if self.wlaniface[self.iface].has_key(attribute): return self.wlaniface[self.iface][attribute] return None -iStatus = Status() \ No newline at end of file +iStatus = Status() diff --git a/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py b/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py index 2df5814c..28ee363e 100755 --- a/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py +++ b/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py @@ -1,4 +1,4 @@ -from enigma import eTimer +from enigma import eTimer, eTPM from Screens.Screen import Screen from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap,MultiPixmap @@ -14,7 +14,9 @@ from Plugins.Plugin import PluginDescriptor from os import system, path as os_path, listdir from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE from Tools.LoadPixmap import LoadPixmap +from Tools.HardwareInfo import HardwareInfo from Wlan import Wlan, wpaSupplicant, iStatus +import sha plugin_path = "/usr/lib/enigma2/python/Plugins/SystemPlugins/WirelessLan" @@ -122,7 +124,7 @@ class WlanStatus(Screen): if status is not None: self["BSSID"].setText(status[self.iface]["acesspoint"]) self["ESSID"].setText(status[self.iface]["essid"]) - self["quality"].setText(status[self.iface]["quality"]+"%") + self["quality"].setText(status[self.iface]["quality"]) self["signal"].setText(status[self.iface]["signal"]) self["bitrate"].setText(status[self.iface]["bitrate"]) self["enc"].setText(status[self.iface]["encryption"]) @@ -373,6 +375,45 @@ class WlanScan(Screen): return self.WlanList +def bin2long(s): + return reduce( lambda x,y:(x<<8L)+y, map(ord, s)) + +def long2bin(l): + res = "" + for byte in range(128): + res += chr((l >> (1024 - (byte + 1) * 8)) & 0xff) + return res + +def rsa_pub1024(src, mod): + return long2bin(pow(bin2long(src), 65537, bin2long(mod))) + +def decrypt_block(src, mod): + if len(src) != 128 and len(src) != 202: + return None + dest = rsa_pub1024(src[:128], mod) + hash = sha.new(dest[1:107]) + if len(src) == 202: + hash.update(src[131:192]) + result = hash.digest() + if result == dest[107:127]: + return dest + return None + +def validate_cert(cert, key): + buf = decrypt_block(cert[8:], key) + if buf is None: + return None + return buf[36:107] + cert[139:196] + +def read_random(): + try: + fd = open("/dev/urandom", "r") + buf = fd.read(8) + fd.close() + return buf + except: + return None + def WlanStatusScreenMain(session, iface): session.open(WlanStatus, iface) @@ -387,8 +428,32 @@ def callFunction(iface): def configStrings(iface): - driver = iNetwork.detectWlanModule() - print "Found WLAN-Driver:",driver + hardware_info = HardwareInfo() + if hardware_info.device_name != "dm7025": + rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?'] + etpm = eTPM() + l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT) + if l2cert is None: + return + l2key = validate_cert(l2cert, rootkey) + if l2key is None: + return + l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) + if l3cert is None: + print "better run the genuine dreambox plugin" + return + l3key = validate_cert(l3cert, l2key) + if l3key is None: + return + rnd = read_random() + if rnd is None: + return + val = etpm.challenge(rnd) + result = decrypt_block(val, l3key) + if hardware_info.device_name == "dm7025" or result[80:88] == rnd: + driver = iNetwork.detectWlanModule(iface) + else: + driver = 'dreambox' if driver in ('ralink', 'zydas'): return " pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -D"+driver+"\n post-down wpa_cli terminate" else: diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py index 2e33ac3b..de2fa993 100755 --- a/lib/python/Screens/NetworkSetup.py +++ b/lib/python/Screens/NetworkSetup.py @@ -745,14 +745,21 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): if self.iface in iNetwork.wlan_interfaces: try: from Plugins.SystemPlugins.WirelessLan.plugin import WlanScan - from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless + from pythonwifi.iwlibs import Wireless except ImportError: self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 ) else: ifobj = Wireless(self.iface) # a Wireless NIC Object - self.wlanresponse = ifobj.getStatistics() - if self.wlanresponse[0] != 19: # Wlan Interface found. - self.session.openWithCallback(self.AdapterSetupClosed, AdapterSetup,self.iface) + try: + self.wlanresponse = ifobj.getAPaddr() + except IOError: + self.wlanresponse = ifobj.getStatistics() + if self.wlanresponse: + if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported' + self.session.openWithCallback(self.AdapterSetupClosed, AdapterSetup,self.iface) + else: + # Display Wlan not available Message + self.showErrorMessage() else: # Display Wlan not available Message self.showErrorMessage() @@ -765,28 +772,42 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): if self["menulist"].getCurrent()[1] == 'scanwlan': try: from Plugins.SystemPlugins.WirelessLan.plugin import WlanScan - from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless + from pythonwifi.iwlibs import Wireless except ImportError: self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 ) else: ifobj = Wireless(self.iface) # a Wireless NIC Object - self.wlanresponse = ifobj.getStatistics() - if self.wlanresponse[0] != 19: - self.session.openWithCallback(self.WlanScanClosed, WlanScan, self.iface) + try: + self.wlanresponse = ifobj.getAPaddr() + except IOError: + self.wlanresponse = ifobj.getStatistics() + if self.wlanresponse: + if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported' + self.session.openWithCallback(self.WlanScanClosed, WlanScan, self.iface) + else: + # Display Wlan not available Message + self.showErrorMessage() else: # Display Wlan not available Message self.showErrorMessage() if self["menulist"].getCurrent()[1] == 'wlanstatus': try: from Plugins.SystemPlugins.WirelessLan.plugin import WlanStatus - from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless + from pythonwifi.iwlibs import Wireless except ImportError: self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 ) else: ifobj = Wireless(self.iface) # a Wireless NIC Object - self.wlanresponse = ifobj.getStatistics() - if self.wlanresponse[0] != 19: - self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface) + try: + self.wlanresponse = ifobj.getAPaddr() + except IOError: + self.wlanresponse = ifobj.getStatistics() + if self.wlanresponse: + if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported' + self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface) + else: + # Display Wlan not available Message + self.showErrorMessage() else: # Display Wlan not available Message self.showErrorMessage() @@ -898,14 +919,21 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): if ret[0] == 'ok' and (self.iface in iNetwork.wlan_interfaces) and iNetwork.getAdapterAttribute(self.iface, "up") is True: try: from Plugins.SystemPlugins.WirelessLan.plugin import WlanStatus - from Plugins.SystemPlugins.WirelessLan.iwlibs import Wireless + from pythonwifi.iwlibs import Wireless except ImportError: self.session.open(MessageBox, _("The wireless LAN plugin is not installed!\nPlease install it."), type = MessageBox.TYPE_INFO,timeout = 10 ) else: ifobj = Wireless(self.iface) # a Wireless NIC Object - self.wlanresponse = ifobj.getStatistics() - if self.wlanresponse[0] != 19: - self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface) + try: + self.wlanresponse = ifobj.getAPaddr() + except IOError: + self.wlanresponse = ifobj.getStatistics() + if self.wlanresponse: + if self.wlanresponse[0] not in (19,95): # 19 = 'No such device', 95 = 'Operation not supported' + self.session.openWithCallback(self.WlanStatusClosed, WlanStatus,self.iface) + else: + # Display Wlan not available Message + self.showErrorMessage() else: # Display Wlan not available Message self.showErrorMessage() @@ -916,7 +944,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): def WlanStatusClosed(self, *ret): if ret is not None and len(ret): - from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status + from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus iStatus.stopWlanConsole() self.updateStatusbar() @@ -924,7 +952,7 @@ class AdapterSetupConfiguration(Screen, HelpableScreen): if ret[0] is not None: self.session.openWithCallback(self.AdapterSetupClosed, AdapterSetup, self.iface,ret[0],ret[1]) else: - from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status + from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus iStatus.stopWlanConsole() self.updateStatusbar() @@ -1335,7 +1363,7 @@ class NetworkAdapterTest(Screen): def getLinkState(self,iface): if iface in iNetwork.wlan_interfaces: try: - from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status + from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus except: self["Network"].setForegroundColorNum(1) self["Network"].setText(_("disconnected")) @@ -1417,7 +1445,7 @@ class NetworkAdapterTest(Screen): iNetwork.stopLinkStateConsole() iNetwork.stopDNSConsole() try: - from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus,Status + from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus except ImportError: pass else: -- cgit v1.2.3 From ba702c42bfa54324396f2ef9c61d0bbe4a8a135b Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 5 Aug 2010 11:06:49 +0200 Subject: lib/python/Components/VolumeControl.py: make the VolumeControl instance global accessible and add a singleton check --- lib/python/Components/VolumeControl.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/VolumeControl.py b/lib/python/Components/VolumeControl.py index 19fb90d7..eef74d0e 100644 --- a/lib/python/Components/VolumeControl.py +++ b/lib/python/Components/VolumeControl.py @@ -5,6 +5,8 @@ from Screens.Mute import Mute from GlobalActions import globalActionMap from config import config, ConfigSubsection, ConfigInteger +instance = None + profile("VolumeControl") #TODO .. move this to a own .py file class VolumeControl: @@ -12,10 +14,14 @@ class VolumeControl: a corresponding dialog""" def __init__(self, session): global globalActionMap + global instance globalActionMap.actions["volumeUp"]=self.volUp globalActionMap.actions["volumeDown"]=self.volDown globalActionMap.actions["volumeMute"]=self.volMute + assert not instance, "only one VolumeControl instance is allowed!" + instance = self + config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default = 100, limits = (0, 100)) -- cgit v1.2.3 From 83ca71426637db994d49662a00f1388ba6394dca Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 5 Aug 2010 11:15:00 +0200 Subject: lib/python/Components/VolumeControl.py: move instance to class --- lib/python/Components/VolumeControl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/VolumeControl.py b/lib/python/Components/VolumeControl.py index eef74d0e..38102926 100644 --- a/lib/python/Components/VolumeControl.py +++ b/lib/python/Components/VolumeControl.py @@ -5,22 +5,20 @@ from Screens.Mute import Mute from GlobalActions import globalActionMap from config import config, ConfigSubsection, ConfigInteger -instance = None - profile("VolumeControl") #TODO .. move this to a own .py file class VolumeControl: + instance = None """Volume control, handles volUp, volDown, volMute actions and display a corresponding dialog""" def __init__(self, session): global globalActionMap - global instance globalActionMap.actions["volumeUp"]=self.volUp globalActionMap.actions["volumeDown"]=self.volDown globalActionMap.actions["volumeMute"]=self.volMute - assert not instance, "only one VolumeControl instance is allowed!" - instance = self + assert not VolumeControl.instance, "only one VolumeControl instance is allowed!" + VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default = 100, limits = (0, 100)) -- cgit v1.2.3 From fbb3e9c9bcbd783d3236d0ff3109b2be7fa24177 Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Fri, 13 Aug 2010 22:00:08 +0200 Subject: show "nothing connected" instead of empty filelist with only mountpoints shown --- lib/python/Components/FileList.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index 841a2fe5..1d71514b 100755 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -196,6 +196,9 @@ class FileList(MenuList): if (self.matchingPattern is None) or re_compile(self.matchingPattern).search(path): self.list.append(FileEntryComponent(name = name, absolute = x , isDir = False)) + if self.showMountpoints and len(self.list) == 0: + self.list.append(FileEntryComponent(name = _("nothing connected"), absolute = None, isDir = False)) + self.l.setList(self.list) if select is not None: -- cgit v1.2.3 From 892a18f6926fa4711d17a2e0442b293467e8963c Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Tue, 17 Aug 2010 20:52:48 +0200 Subject: JobView/HTTPProgressDownloader/NFIFlash correctly handle cancelling downloads --- lib/python/Components/Task.py | 5 +-- .../Plugins/SystemPlugins/NFIFlash/downloader.py | 50 ++++++++++++++++------ lib/python/Screens/TaskView.py | 2 +- 3 files changed, 41 insertions(+), 16 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index 2e4e757d..3a755405 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -64,11 +64,10 @@ class Job(object): def runNext(self): if self.current_task == len(self.tasks): if len(self.resident_tasks) == 0: - cb = self.callback - self.callback = None self.status = self.FINISHED self.state_changed() - cb(self, None, []) + self.callback(self, None, []) + self.callback = None else: print "still waiting for %d resident task(s) %s to finish" % (len(self.resident_tasks), str(self.resident_tasks)) else: diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py index e0bad848..8768021c 100644 --- a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py @@ -78,7 +78,9 @@ class ImageDownloadTask(Task): self.error_message = "" self.last_recvbytes = 0 self.error_message = None - + self.download = None + self.aborted = False + def run(self, callback): self.callback = callback self.download = downloadWithProgress(self.url,self.path) @@ -86,23 +88,30 @@ class ImageDownloadTask(Task): self.download.start().addCallback(self.download_finished).addErrback(self.download_failed) print "[ImageDownloadTask] downloading", self.url, "to", self.path + def abort(self): + print "[ImageDownloadTask] aborting", self.url + if self.download: + self.download.stop() + self.aborted = True + def download_progress(self, recvbytes, totalbytes): #print "[update_progress] recvbytes=%d, totalbytes=%d" % (recvbytes, totalbytes) if ( recvbytes - self.last_recvbytes ) > 10000: # anti-flicker self.progress = int(100*(float(recvbytes)/float(totalbytes))) self.name = _("Downloading") + ' ' + "%d of %d kBytes" % (recvbytes/1024, totalbytes/1024) self.last_recvbytes = recvbytes - + def download_failed(self, failure_instance=None, error_message=""): self.error_message = error_message if error_message == "" and failure_instance is not None: self.error_message = failure_instance.getErrorMessage() - print "[download_failed]", self.error_message Task.processFinished(self, 1) - + def download_finished(self, string=""): - print "[download_finished]", string - Task.processFinished(self, 0) + if self.aborted: + self.finish(aborted = True) + else: + Task.processFinished(self, 0) class StickWizardJob(Job): def __init__(self, path): @@ -423,7 +432,10 @@ class NFIDownload(Screen): def go(self): self.onShown.remove(self.go) - self["menu"].index = 0 + self.umountCallback = self.getMD5 + self.umount() + + def getMD5(self): url = "http://www.dreamboxupdate.com/download/opendreambox/dreambox-nfiflasher-%s-md5sums" % self.box client.getPage(url).addCallback(self.md5sums_finished).addErrback(self.feed_failed) @@ -578,7 +590,7 @@ class NFIDownload(Screen): def StickWizardCB(self, ret=None): print "[StickWizardCB]", ret - print job_manager.active_jobs, job_manager.failed_jobs, job_manager.job_classes, job_manager.in_background, job_manager.active_job +# print job_manager.active_jobs, job_manager.failed_jobs, job_manager.job_classes, job_manager.in_background, job_manager.active_job if len(job_manager.failed_jobs) == 0: self.session.open(MessageBox, _("The USB stick was prepared to be bootable.\nNow you can download an NFI image file!"), type = MessageBox.TYPE_INFO) if len(self.feedlists[ALLIMAGES]) == 0: @@ -586,15 +598,17 @@ class NFIDownload(Screen): else: self.setMenu() else: - self.checkUSBStick() + self.umountCallback = self.checkUSBStick + self.umount() def ImageDownloadCB(self, ret): print "[ImageDownloadCB]", ret - print job_manager.active_jobs, job_manager.failed_jobs, job_manager.job_classes, job_manager.in_background, job_manager.active_job +# print job_manager.active_jobs, job_manager.failed_jobs, job_manager.job_classes, job_manager.in_background, job_manager.active_job if len(job_manager.failed_jobs) == 0: self.session.open(MessageBox, _("To update your Dreambox firmware, please follow these steps:\n1) Turn off your box with the rear power switch and plug in the bootable USB stick.\n2) Turn mains back on and hold the DOWN button on the front panel pressed for 10 seconds.\n3) Wait for bootup and follow instructions of the wizard."), type = MessageBox.TYPE_INFO) else: - self.branch = START + self.umountCallback = self.keyRed + self.umount() def getFeed(self): self.feedDownloader15 = feedDownloader(self.feed_base, self.box, OE_vers="1.5") @@ -655,7 +669,7 @@ class NFIDownload(Screen): First, you need to prepare a USB stick so that it is bootable. In the next step, an NFI image file can be downloaded from the update server and saved on the USB stick. If you already have a prepared bootable USB stick, please insert it now. Otherwise plug in a USB stick with a minimum size of 64 MB!""") - self.session.openWithCallback(self.wizardDeviceBrowserClosed, DeviceBrowser, None, message, showDirectories=True, showMountpoints=True, inhibitMounts=["/","/autofs/sr0/","/autofs/sda1/","/media/hdd/","/media/net/","/media/usb/","/media/dvd/"]) + self.session.openWithCallback(self.wizardDeviceBrowserClosed, DeviceBrowser, None, message, showDirectories=True, showMountpoints=True, inhibitMounts=["/","/autofs/sr0/","/autofs/sda1/","/media/hdd/","/media/net/",self.usbmountpoint,"/media/dvd/"]) def wizardDeviceBrowserClosed(self, path): print "[wizardDeviceBrowserClosed]", path @@ -740,6 +754,18 @@ If you already have a prepared bootable USB stick, please insert it now. Otherwi print "check failed! calling", repr(self.md5_failback) self.md5_failback() + def umount(self): + cmd = "umount " + self.usbmountpoint + print "[umount]", cmd + self.container.setCWD('/') + self.container.appClosed.append(self.umountFinished) + self.container.execute(cmd) + + def umountFinished(self, retval): + print "[umountFinished]", str(retval) + self.container.appClosed.remove(self.umountFinished) + self.umountCallback() + def main(session, **kwargs): session.open(NFIDownload,"/home/root") diff --git a/lib/python/Screens/TaskView.py b/lib/python/Screens/TaskView.py index 633aae0d..78648602 100644 --- a/lib/python/Screens/TaskView.py +++ b/lib/python/Screens/TaskView.py @@ -118,7 +118,7 @@ class JobView(InfoBarNotifications, Screen, ConfigListScreen): if self.settings.afterEvent.getValue() == "nothing": return elif self.settings.afterEvent.getValue() == "close": - self.abort() + self.close(False) from Screens.MessageBox import MessageBox if self.settings.afterEvent.getValue() == "deepstandby": if not Screens.Standby.inTryQuitMainloop: -- cgit v1.2.3 From 4ad194a2c8742b4ce5906a7d816c2542f7397085 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Thu, 26 Aug 2010 08:34:43 +0200 Subject: Enigma2: add possibility to configure input device delay and repeat settings. fixes #69 --- data/menu.xml | 3 +- data/skin_default/icons/Makefile.am | 8 + .../icons/input_keyboard-configured.png | Bin 0 -> 2700 bytes data/skin_default/icons/input_keyboard.png | Bin 0 -> 2520 bytes data/skin_default/icons/input_mouse-configured.png | Bin 0 -> 2785 bytes data/skin_default/icons/input_mouse.png | Bin 0 -> 2512 bytes data/skin_default/icons/input_rcnew-configured.png | Bin 0 -> 2809 bytes data/skin_default/icons/input_rcnew.png | Bin 0 -> 2570 bytes data/skin_default/icons/input_rcold-configured.png | Bin 0 -> 2796 bytes data/skin_default/icons/input_rcold.png | Bin 0 -> 2598 bytes lib/python/Components/InputDevice.py | 225 +++++++++++++++-- lib/python/Screens/InputDeviceSetup.py | 280 +++++++++++++++++++++ lib/python/Screens/Makefile.am | 3 +- 13 files changed, 494 insertions(+), 25 deletions(-) create mode 100644 data/skin_default/icons/input_keyboard-configured.png create mode 100644 data/skin_default/icons/input_keyboard.png create mode 100644 data/skin_default/icons/input_mouse-configured.png create mode 100644 data/skin_default/icons/input_mouse.png create mode 100644 data/skin_default/icons/input_rcnew-configured.png create mode 100644 data/skin_default/icons/input_rcnew.png create mode 100644 data/skin_default/icons/input_rcold-configured.png create mode 100644 data/skin_default/icons/input_rcold.png mode change 100644 => 100755 lib/python/Components/InputDevice.py create mode 100755 lib/python/Screens/InputDeviceSetup.py (limited to 'lib/python/Components') diff --git a/data/menu.xml b/data/menu.xml index 0d874718..6e103542 100755 --- a/data/menu.xml +++ b/data/menu.xml @@ -61,8 +61,9 @@ - + + + {"template": [ + MultiContentEntryPixmapAlphaTest(pos = (2, 8), size = (54, 54), png = 2), # index 3 is the interface pixmap + MultiContentEntryText(pos = (65, 6), size = (450, 54), font=0, flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, text = 1), # index 1 is the interfacename + ], + "fonts": [gFont("Regular", 28),gFont("Regular", 20)], + "itemHeight": 70 + } + + + + + + """ + + + def __init__(self, session): + Screen.__init__(self, session) + HelpableScreen.__init__(self) + + self.edittext = _("Press OK to edit the settings.") + + self["key_red"] = StaticText(_("Close")) + self["key_green"] = StaticText(_("Select")) + self["key_yellow"] = StaticText("") + self["key_blue"] = StaticText("") + self["introduction"] = StaticText(self.edittext) + + self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()] + print "[InputDeviceSelection] found devices :->", len(self.devices),self.devices + + self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", + { + "cancel": (self.close, _("Exit input device selection.")), + "ok": (self.okbuttonClick, _("Select input device.")), + }, -2) + + self["ColorActions"] = HelpableActionMap(self, "ColorActions", + { + "red": (self.close, _("Exit input device selection.")), + "green": (self.okbuttonClick, _("Select input device.")), + }, -2) + + self.currentIndex = 0 + self.list = [] + self["list"] = List(self.list) + self.updateList() + self.onLayoutFinish.append(self.layoutFinished) + self.onClose.append(self.cleanup) + + def layoutFinished(self): + self.setTitle(_("Select input device")) + + def cleanup(self): + self.currentIndex = 0 + + def buildInterfaceList(self,device,description,type ): + divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) + activepng = None + devicepng = None + enabled = iInputDevices.getDeviceAttribute(device, 'enabled') + + if type == 'remote': + if config.misc.rcused.value == 0: + if enabled: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_rcnew-configured.png")) + else: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_rcnew.png")) + else: + if enabled: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_rcold-configured.png")) + else: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_rcold.png")) + elif type == 'keyboard': + if enabled: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_keyboard-configured.png")) + else: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_keyboard.png")) + elif type == 'mouse': + if enabled: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_mouse-configured.png")) + else: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_mouse.png")) + else: + devicepng = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/input_rcnew.png")) + return((device, description, devicepng, divpng)) + + def updateList(self): + self.list = [] + for x in self.devices: + dev_type = iInputDevices.getDeviceAttribute(x[1], 'type') + self.list.append(self.buildInterfaceList(x[1],_(x[0]), dev_type )) + self["list"].setList(self.list) + self["list"].setIndex(self.currentIndex) + + def okbuttonClick(self): + selection = self["list"].getCurrent() + self.currentIndex = self["list"].getIndex() + if selection is not None: + self.session.openWithCallback(self.DeviceSetupClosed, InputDeviceSetup, selection[0]) + + def DeviceSetupClosed(self, *ret): + self.updateList() + + +class InputDeviceSetup(Screen, ConfigListScreen): + + skin = """ + + + + + + + + + + + + + """ + + def __init__(self, session, device): + Screen.__init__(self, session) + self.inputDevice = device + iInputDevices.currentDevice = self.inputDevice + self.onChangedEntry = [ ] + self.setup_title = _("Input device setup") + self.isStepSlider = None + self.enableEntry = None + self.repeatEntry = None + self.delayEntry = None + self.nameEntry = None + self.enableConfigEntry = None + + self.list = [ ] + ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry) + + self["actions"] = ActionMap(["SetupActions"], + { + "cancel": self.keyCancel, + "save": self.apply, + }, -2) + + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("OK")) + self["key_yellow"] = StaticText() + self["key_blue"] = StaticText() + self["introduction"] = StaticText() + + self.createSetup() + self.onLayoutFinish.append(self.layoutFinished) + self.onClose.append(self.cleanup) + + def layoutFinished(self): + self.setTitle(self.setup_title) + + def cleanup(self): + iInputDevices.currentDevice = "" + + def createSetup(self): + self.list = [ ] + cmd = "self.enableEntry = getConfigListEntry(_('"'Change repeat and delay settings?'"'), config.inputDevices." + self.inputDevice + ".enabled)" + exec (cmd) + cmd = "self.repeatEntry = getConfigListEntry(_('"'Interval between keys when repeating:'"'), config.inputDevices." + self.inputDevice + ".repeat)" + exec (cmd) + cmd = "self.delayEntry = getConfigListEntry(_('"'Delay before key repeat starts:'"'), config.inputDevices." + self.inputDevice + ".delay)" + exec (cmd) + cmd = "self.nameEntry = getConfigListEntry(_('"'Devicename:'"'), config.inputDevices." + self.inputDevice + ".name)" + exec (cmd) + if self.enableEntry: + if isinstance(self.enableEntry[1], ConfigYesNo): + self.enableConfigEntry = self.enableEntry[1] + + self.list.append(self.enableEntry) + if self.enableConfigEntry: + if self.enableConfigEntry.value is True: + self.list.append(self.repeatEntry) + self.list.append(self.delayEntry) + else: + self.repeatEntry[1].setValue(self.repeatEntry[1].default) + self["config"].invalidate(self.repeatEntry) + self.delayEntry[1].setValue(self.delayEntry[1].default) + self["config"].invalidate(self.delayEntry) + self.nameEntry[1].setValue(self.nameEntry[1].default) + self["config"].invalidate(self.nameEntry) + + self["config"].list = self.list + self["config"].l.setSeperation(400) + self["config"].l.setList(self.list) + if not self.selectionChanged in self["config"].onSelectionChanged: + self["config"].onSelectionChanged.append(self.selectionChanged) + self.selectionChanged() + + def selectionChanged(self): + if self["config"].getCurrent() == self.enableEntry: + self["introduction"].setText(_("Current device: ") + str(iInputDevices.getDeviceAttribute(self.inputDevice, 'name')) ) + else: + self["introduction"].setText(_("Current value: ") + self.getCurrentValue() + _(" ms")) + + def newConfig(self): + current = self["config"].getCurrent() + if current: + if current == self.enableEntry: + self.createSetup() + + def keyLeft(self): + ConfigListScreen.keyLeft(self) + self.newConfig() + + def keyRight(self): + ConfigListScreen.keyRight(self) + self.newConfig() + + def confirm(self, confirmed): + if not confirmed: + print "not confirmed" + return + else: + self.nameEntry[1].setValue(iInputDevices.getDeviceAttribute(self.inputDevice, 'name')) + cmd = "config.inputDevices." + self.inputDevice + ".name.save()" + exec (cmd) + self.keySave() + + def apply(self): + self.session.openWithCallback(self.confirm, MessageBox, _("Use this input device settings?"), MessageBox.TYPE_YESNO, timeout = 20, default = True) + + def cancelConfirm(self, result): + if not result: + return + for x in self["config"].list: + x[1].cancel() + self.close() + + def keyCancel(self): + if self["config"].isChanged(): + self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?"), MessageBox.TYPE_YESNO, timeout = 20, default = True) + else: + self.close() + # for summary: + def changedEntry(self): + for x in self.onChangedEntry: + x() + self.selectionChanged() + + def getCurrentEntry(self): + return self["config"].getCurrent()[0] + + def getCurrentValue(self): + return str(self["config"].getCurrent()[1].value) + + def createSummary(self): + from Screens.Setup import SetupSummary + return SetupSummary diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index 5cec5127..69600f01 100755 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -14,5 +14,6 @@ install_PYTHON = \ SubtitleDisplay.py SubservicesQuickzap.py ParentalControlSetup.py NumericalTextInputHelpDialog.py \ SleepTimerEdit.py Ipkg.py RdsDisplay.py Globals.py DefaultWizard.py \ SessionGlobals.py LocationBox.py WizardLanguage.py TaskView.py Rc.py VirtualKeyBoard.py \ - TextBox.py FactoryReset.py RecordPaths.py UnhandledKey.py ServiceStopScreen.py + TextBox.py FactoryReset.py RecordPaths.py UnhandledKey.py ServiceStopScreen.py \ + InputDeviceSetup.py -- cgit v1.2.3 From ceaa41889d0e8959393b8c0fce601707b9494b73 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Tue, 21 Sep 2010 21:29:48 +0200 Subject: Enigma2-meta: rework plugin meta files and prepare for inclusion into enigma2 translation. Meta.xml files are now only in english and translation is now easy possible for all languages over enigma2 translation project. This also reduces consumed space inside flash memory. Add missing TempFanControl plugin meta and LICENSE. DreamInfohandler.py,SoftwareManager: follow meta xml changes. fixes #578 --- Makefile.am | 8 +- configure.ac | 1 + lib/python/Components/DreamInfoHandler.py | 86 ++++++---------------- .../CutListEditor/meta/plugin_cutlisteditor.xml | 13 +--- .../Extensions/DVDBurn/meta/plugin_dvdburn.xml | 17 ++--- .../Extensions/DVDPlayer/meta/plugin_dvdplayer.xml | 13 +--- .../GraphMultiEPG/meta/plugin_graphmultiepg.xml | 13 +--- .../MediaPlayer/meta/plugin_mediaplayer.xml | 13 +--- .../MediaScanner/meta/plugin_mediascanner.xml | 14 +--- .../PicturePlayer/meta/plugin_pictureplayer.xml | 13 +--- .../Extensions/SocketMMI/meta/plugin_socketmmi.xml | 11 +-- .../TuxboxPlugins/meta/plugin_tuxboxplugins.xml | 11 +-- .../CleanupWizard/meta/plugin_cleanupwizard.xml | 18 +---- .../meta/plugin_commoninterfaceassignment.xml | 23 ++---- .../meta/plugin_crashlogautosubmit.xml | 17 +---- .../meta/plugin_defaultservicesscanner.xml | 16 +--- .../DiseqcTester/meta/plugin_diseqctester.xml | 16 +--- .../meta/plugin_frontprocessorupgrade.xml | 14 +--- .../SystemPlugins/Hotplug/meta/plugin_hotplug.xml | 15 +--- .../NFIFlash/meta/plugin_nfiflash.xml | 18 +---- .../NetworkWizard/meta/plugin_networkwizard.xml | 16 +--- .../meta/plugin_positionersetup.xml | 17 +---- .../meta/plugin_satelliteequipmentcontrol.xml | 16 +--- .../Satfinder/meta/plugin_satfinder.xml | 18 +---- .../SkinSelector/meta/plugin_skinselector.xml | 15 +--- .../SystemPlugins/SoftwareManager/SoftwareTools.py | 2 +- .../meta/plugin_softwaremanager.xml | 18 +---- .../SystemPlugins/SoftwareManager/plugin.py | 39 ++++------ .../Plugins/SystemPlugins/TempFanControl/LICENSE | 12 +++ .../SystemPlugins/TempFanControl/Makefile.am | 4 + .../SystemPlugins/TempFanControl/meta/Makefile.am | 3 + .../TempFanControl/meta/plugin_tempfancontrol.xml | 18 +++++ .../meta/plugin_videoenhancement.xml | 14 +--- .../VideoTune/meta/plugin_videotune.xml | 13 +--- .../Videomode/meta/plugin_videomode.xml | 14 +--- .../WirelessLan/meta/plugin_wirelesslan.xml | 12 +-- tools/genmetaindex.py | 12 ++- 37 files changed, 173 insertions(+), 420 deletions(-) mode change 100644 => 100755 lib/python/Plugins/Extensions/SocketMMI/meta/plugin_socketmmi.xml mode change 100644 => 100755 lib/python/Plugins/Extensions/TuxboxPlugins/meta/plugin_tuxboxplugins.xml mode change 100644 => 100755 lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/meta/plugin_frontprocessorupgrade.xml mode change 100644 => 100755 lib/python/Plugins/SystemPlugins/Hotplug/meta/plugin_hotplug.xml create mode 100755 lib/python/Plugins/SystemPlugins/TempFanControl/LICENSE mode change 100644 => 100755 lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am create mode 100755 lib/python/Plugins/SystemPlugins/TempFanControl/meta/Makefile.am create mode 100755 lib/python/Plugins/SystemPlugins/TempFanControl/meta/plugin_tempfancontrol.xml (limited to 'lib/python/Components') diff --git a/Makefile.am b/Makefile.am index c517d9c5..bc1770b7 100755 --- a/Makefile.am +++ b/Makefile.am @@ -7,12 +7,8 @@ install_PYTHON = \ keyids.py keymapparser.py mytest.py skin.py timer.py tools.py GlobalActions.py \ e2reactor.py -LANGS := $(shell cat $(srcdir)/po/LINGUAS) - install-exec-hook: - for lang in $(LANGS); do \ - $(PYTHON) $(srcdir)/tools/genmetaindex.py $$lang $(DESTDIR)$(datadir)/meta/plugin_*.xml > $(DESTDIR)$(datadir)/meta/index-enigma2_$$lang.xml; \ - done + $(PYTHON) $(srcdir)/tools/genmetaindex.py $(DESTDIR)$(datadir)/meta/plugin_*.xml > $(DESTDIR)$(datadir)/meta/index-enigma2.xml uninstall-hook: - $(RM) $(DESTDIR)$(datadir)/meta/index-enigma2_*.xml + $(RM) $(DESTDIR)$(datadir)/meta/index-enigma2.xml diff --git a/configure.ac b/configure.ac index 05c3a8eb..35fad779 100755 --- a/configure.ac +++ b/configure.ac @@ -159,6 +159,7 @@ lib/python/Plugins/SystemPlugins/Hotplug/Makefile lib/python/Plugins/SystemPlugins/Hotplug/meta/Makefile lib/python/Plugins/SystemPlugins/Makefile lib/python/Plugins/SystemPlugins/TempFanControl/Makefile +lib/python/Plugins/SystemPlugins/TempFanControl/meta/Makefile lib/python/Plugins/SystemPlugins/NetworkWizard/Makefile lib/python/Plugins/SystemPlugins/NetworkWizard/meta/Makefile lib/python/Plugins/SystemPlugins/NFIFlash/Makefile diff --git a/lib/python/Components/DreamInfoHandler.py b/lib/python/Components/DreamInfoHandler.py index 85e2b533..dd140cbb 100755 --- a/lib/python/Components/DreamInfoHandler.py +++ b/lib/python/Components/DreamInfoHandler.py @@ -16,7 +16,7 @@ class InfoHandlerParseError(Exception): return repr(self.value) class InfoHandler(xml.sax.ContentHandler): - def __init__(self, prerequisiteMet, directory, language = None): + def __init__(self, prerequisiteMet, directory): self.attributes = {} self.directory = directory self.list = [] @@ -26,9 +26,6 @@ class InfoHandler(xml.sax.ContentHandler): self.validFileTypes = ["skin", "config", "services", "favourites", "package"] self.prerequisitesMet = prerequisiteMet self.data = "" - self.language = language - self.translatedPackageInfos = {} - self.foundTranslation = None def printError(self, error): print "Error in defaults xml files:", error @@ -52,15 +49,6 @@ class InfoHandler(xml.sax.ContentHandler): if name == "info": self.foundTranslation = None self.data = "" - if not attrs.has_key("language"): - print "info tag with no language attribute" - else: - if attrs["language"] == 'en': # read default translations - self.foundTranslation = False - self.data = "" - elif attrs["language"] == self.language: - self.foundTranslation = True - self.data = "" if name == "files": if attrs.has_key("type"): @@ -91,20 +79,17 @@ class InfoHandler(xml.sax.ContentHandler): if attrs.has_key("details"): self.attributes["details"] = str(attrs["details"]) if attrs.has_key("name"): - self.attributes["name"] = str(attrs["name"].encode("utf-8")) + self.attributes["name"] = str(attrs["name"]) if attrs.has_key("packagename"): - self.attributes["packagename"] = str(attrs["packagename"].encode("utf-8")) + self.attributes["packagename"] = str(attrs["packagename"]) if attrs.has_key("packagetype"): - self.attributes["packagetype"] = str(attrs["packagetype"].encode("utf-8")) + self.attributes["packagetype"] = str(attrs["packagetype"]) if attrs.has_key("shortdescription"): - self.attributes["shortdescription"] = str(attrs["shortdescription"].encode("utf-8")) + self.attributes["shortdescription"] = str(attrs["shortdescription"]) if name == "screenshot": if attrs.has_key("src"): - if self.foundTranslation is False: - self.attributes["screenshot"] = str(attrs["src"]) - elif self.foundTranslation is True: - self.translatedPackageInfos["screenshot"] = str(attrs["src"]) + self.attributes["screenshot"] = str(attrs["src"]) def endElement(self, name): #print "endElement", name @@ -124,7 +109,7 @@ class InfoHandler(xml.sax.ContentHandler): self.attributes[self.filetype].append({ "name": str(self.fileattrs["name"]), "directory": directory }) if name in ( "default", "package" ): - self.list.append({"attributes": self.attributes, 'prerequisites': self.globalprerequisites ,"translation": self.translatedPackageInfos}) + self.list.append({"attributes": self.attributes, 'prerequisites': self.globalprerequisites}) self.attributes = {} self.globalprerequisites = {} @@ -133,30 +118,13 @@ class InfoHandler(xml.sax.ContentHandler): self.attributes["author"] = str(data) if self.elements[-1] == "name": self.attributes["name"] = str(data) - if self.foundTranslation is False: - if self.elements[-1] == "author": - self.attributes["author"] = str(data) - if self.elements[-1] == "name": - self.attributes["name"] = str(data) - if self.elements[-1] == "packagename": - self.attributes["packagename"] = str(data.encode("utf-8")) - if self.elements[-1] == "shortdescription": - self.attributes["shortdescription"] = str(data.encode("utf-8")) - if self.elements[-1] == "description": - self.data += data.strip() - self.attributes["description"] = str(self.data.encode("utf-8")) - elif self.foundTranslation is True: - if self.elements[-1] == "author": - self.translatedPackageInfos["author"] = str(data) - if self.elements[-1] == "name": - self.translatedPackageInfos["name"] = str(data) - if self.elements[-1] == "description": - self.data += data.strip() - self.translatedPackageInfos["description"] = str(self.data.encode("utf-8")) - if self.elements[-1] == "name": - self.translatedPackageInfos["name"] = str(data.encode("utf-8")) - if self.elements[-1] == "shortdescription": - self.translatedPackageInfos["shortdescription"] = str(data.encode("utf-8")) + if self.elements[-1] == "packagename": + self.attributes["packagename"] = str(data) + if self.elements[-1] == "shortdescription": + self.attributes["shortdescription"] = str(data) + if self.elements[-1] == "description": + self.data += data + self.attributes["description"] = str(self.data) #print "characters", data @@ -166,13 +134,12 @@ class DreamInfoHandler: STATUS_ERROR = 2 STATUS_INIT = 4 - def __init__(self, statusCallback, blocking = False, neededTag = None, neededFlag = None, language = None): + def __init__(self, statusCallback, blocking = False, neededTag = None, neededFlag = None): self.hardware_info = HardwareInfo() self.directory = "/" self.neededTag = neededTag self.neededFlag = neededFlag - self.language = language # caution: blocking should only be used, if further execution in enigma2 depends on the outcome of # the installer! @@ -203,8 +170,8 @@ class DreamInfoHandler: #print handler.list def readIndex(self, directory, file): - print "Reading .xml meta index file", file - handler = InfoHandler(self.prerequisiteMet, directory, self.language) + print "Reading .xml meta index file", directory, file + handler = InfoHandler(self.prerequisiteMet, directory) try: xml.sax.parse(file, handler) for entry in handler.list: @@ -216,7 +183,7 @@ class DreamInfoHandler: def readDetails(self, directory, file): self.packageDetails = [] print "Reading .xml meta details file", file - handler = InfoHandler(self.prerequisiteMet, directory, self.language) + handler = InfoHandler(self.prerequisiteMet, directory) try: xml.sax.parse(file, handler) for entry in handler.list: @@ -225,7 +192,6 @@ class DreamInfoHandler: print "file", file, "ignored due to errors in the file" #print handler.list - # prerequisites = True: give only packages matching the prerequisites def fillPackagesList(self, prerequisites = True): self.packageslist = [] @@ -254,20 +220,14 @@ class DreamInfoHandler: self.directory = [self.directory] for indexfile in os.listdir(self.directory[0]): - if indexfile.startswith("index"): - if indexfile.endswith("_en.xml"): #we first catch all english indexfiles - indexfileList.append(os.path.splitext(indexfile)[0][:-3]) - + if indexfile.startswith("index-"): + if indexfile.endswith(".xml"): + indexfileList.append(indexfile) if len(indexfileList): for file in indexfileList: neededFile = self.directory[0] + "/" + file - if self.language is not None: - if os.path.exists(neededFile + '_' + self.language + '.xml' ): - #print "translated index file found",neededFile + '_' + self.language + '.xml' - self.readIndex(self.directory[0] + "/", neededFile + '_' + self.language + '.xml') - else: - #print "reading original index file" - self.readIndex(self.directory[0] + "/", neededFile + '_en.xml') + if os.path.isfile(neededFile): + self.readIndex(self.directory[0] + "/" , neededFile) if prerequisites: for package in self.packagesIndexlist[:]: diff --git a/lib/python/Plugins/Extensions/CutListEditor/meta/plugin_cutlisteditor.xml b/lib/python/Plugins/Extensions/CutListEditor/meta/plugin_cutlisteditor.xml index 1431caf4..7132ba02 100755 --- a/lib/python/Plugins/Extensions/CutListEditor/meta/plugin_cutlisteditor.xml +++ b/lib/python/Plugins/Extensions/CutListEditor/meta/plugin_cutlisteditor.xml @@ -2,23 +2,14 @@ - + Dream Multimedia CutListEditor enigma2-plugin-extensions-cutlisteditor - CutListEditor allows you to edit your movies. + CutListEditor allows you to edit your movies CutListEditor allows you to edit your movies.\nSeek to the start of the stuff you want to cut away. Press OK, select 'start cut'.\nThen seek to the end, press OK, select 'end cut'. That's it. - - Dream Multimedia - Schnitteditor - enigma2-plugin-extensions-cutlisteditor - Mit dem Schnitteditor können Sie Ihre Aufnahmen schneiden. - Mit dem Schnitteditor können Sie Ihre Aufnahmen schneiden.\nSpulen Sie zum Anfang des zu schneidenden Teils der Aufnahme. Drücken Sie dann OK und wählen Sie: 'start cut'.\nDann spulen Sie zum Ende, drücken OK und wählen 'end cut'. Das ist alles. - - - diff --git a/lib/python/Plugins/Extensions/DVDBurn/meta/plugin_dvdburn.xml b/lib/python/Plugins/Extensions/DVDBurn/meta/plugin_dvdburn.xml index 647d1cfd..c1e202a9 100755 --- a/lib/python/Plugins/Extensions/DVDBurn/meta/plugin_dvdburn.xml +++ b/lib/python/Plugins/Extensions/DVDBurn/meta/plugin_dvdburn.xml @@ -3,22 +3,17 @@ - + Dream Multimedia DVDBurn enigma2-plugin-extensions-dvdburn - With DVDBurn you can burn your recordings to a dvd. - With DVDBurn you can burn your recordings to a dvd.\nArchive all your favorite movies to recordable dvds with menus if wanted. + Burn your recordings to DVD + With DVDBurn you can make compilations of records from your Dreambox hard drive.\n + Optionally you can add customizable menus. You can record the compilation to a standard-compliant DVD that can be played on conventinal DVD players.\n + HDTV recordings can only be burned in proprietary dreambox format. - - Dream Multimedia - DVDBurn - enigma2-plugin-extensions-dvdburn - Mit DVDBurn brennen Sie ihre Aufnahmen auf DVD. - Mit DVDBurn brennen Sie ihre Aufnahmen auf DVD.\nArchivieren Sie Ihre Liblingsfilme auf DVD mit Menus wenn Sie es wünschen. - - + diff --git a/lib/python/Plugins/Extensions/DVDPlayer/meta/plugin_dvdplayer.xml b/lib/python/Plugins/Extensions/DVDPlayer/meta/plugin_dvdplayer.xml index 1353f7d2..6fc5a6f1 100755 --- a/lib/python/Plugins/Extensions/DVDPlayer/meta/plugin_dvdplayer.xml +++ b/lib/python/Plugins/Extensions/DVDPlayer/meta/plugin_dvdplayer.xml @@ -2,23 +2,14 @@ - + Dream Multimedia DVDPlayer enigma2-plugin-extensions-dvdplayer - DVDPlayer plays your DVDs on your Dreambox. + DVDPlayer plays your DVDs on your Dreambox DVDPlayer plays your DVDs on your Dreambox.\nWith the DVDPlayer you can play your DVDs on your Dreambox from a DVD or even from an iso file or video_ts folder on your harddisc or network. - - Dream Multimedia - DVDPlayer - enigma2-plugin-extensions-dvdplayer - Spielen Sie Ihre DVDs mit dem DVDPlayer auf Ihrer Dreambox ab. - Spielen Sie Ihre DVDs mit dem DVDPlayer auf Ihrer Dreambox ab.\nMit dem DVDPlayer können Sie Ihre DVDs auf Ihrer Dreambox abspielen. Dabei ist es egal ob Sie von DVD, iso-Datei oder sogar direkt von einer video_ts Ordnerstruktur von Ihrer Festplatte oder dem Netzwerk abspielen. - - - diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/meta/plugin_graphmultiepg.xml b/lib/python/Plugins/Extensions/GraphMultiEPG/meta/plugin_graphmultiepg.xml index 3e2a3f6e..d3a2edf8 100755 --- a/lib/python/Plugins/Extensions/GraphMultiEPG/meta/plugin_graphmultiepg.xml +++ b/lib/python/Plugins/Extensions/GraphMultiEPG/meta/plugin_graphmultiepg.xml @@ -3,23 +3,14 @@ - + Dream Multimedia GraphMultiEPG enigma2-plugin-extensions-graphmultiepg - GraphMultiEPG shows a graphical timeline EPG. + GraphMultiEPG shows a graphical timeline EPG GraphMultiEPG shows a graphical timeline EPG.\nShows a nice overview of all running und upcoming tv shows. - - Dream Multimedia - GraphMultiEPG - enigma2-plugin-extensions-graphmultiepg - Zeigt ein grafisches Zeitlinien-EPG. - Zeigt ein grafisches Zeitlinien-EPG.\nZeigt eine grafische Übersicht aller laufenden und kommenden Sendungen. - - - diff --git a/lib/python/Plugins/Extensions/MediaPlayer/meta/plugin_mediaplayer.xml b/lib/python/Plugins/Extensions/MediaPlayer/meta/plugin_mediaplayer.xml index 2f9f22bf..ffbb8e89 100755 --- a/lib/python/Plugins/Extensions/MediaPlayer/meta/plugin_mediaplayer.xml +++ b/lib/python/Plugins/Extensions/MediaPlayer/meta/plugin_mediaplayer.xml @@ -2,23 +2,14 @@ - + Dream Multimedia MediaPlayer enigma2-plugin-extensions-mediaplayer - Mediaplayer plays your favorite music and videos. + Plays your favorite music and videos Mediaplayer plays your favorite music and videos.\nPlay all your favorite music and video files, organize them in playlists, view cover and album information. - - Dream Multimedia - MediaPlayer - enigma2-plugin-extensions-mediaplayer - Mediaplayer spielt Ihre Musik und Videos. - Mediaplayer spielt Ihre Musik und Videos.\nSie können all Ihre Musik- und Videodateien abspielen, in Playlisten organisieren, Cover und Albuminformationen abrufen. - - - diff --git a/lib/python/Plugins/Extensions/MediaScanner/meta/plugin_mediascanner.xml b/lib/python/Plugins/Extensions/MediaScanner/meta/plugin_mediascanner.xml index eced924f..eb9de1b6 100755 --- a/lib/python/Plugins/Extensions/MediaScanner/meta/plugin_mediascanner.xml +++ b/lib/python/Plugins/Extensions/MediaScanner/meta/plugin_mediascanner.xml @@ -1,25 +1,15 @@ - - + Dream Multimedia MediaScanner enigma2-plugin-extensions-mediascanner - MediaScanner scans devices for playable media files. + Scan devices for playable media files MediaScanner scans devices for playable media files and displays a menu with possible actions like viewing pictures or playing movies. - - Dream Multimedia - MediaScanner - enigma2-plugin-extensions-mediascanner - MediaScanner durchsucht Geräte nach Mediendateien. - MediaScanner durchsucht Geräte nach Mediendateien und bietet Ihnen die dazu passenden Aktionen an wie z.B. Bilder betrachten oder Videos abspielen. - - - diff --git a/lib/python/Plugins/Extensions/PicturePlayer/meta/plugin_pictureplayer.xml b/lib/python/Plugins/Extensions/PicturePlayer/meta/plugin_pictureplayer.xml index faff9785..16e2ec90 100755 --- a/lib/python/Plugins/Extensions/PicturePlayer/meta/plugin_pictureplayer.xml +++ b/lib/python/Plugins/Extensions/PicturePlayer/meta/plugin_pictureplayer.xml @@ -2,23 +2,14 @@ - + Dream Multimedia PicturePlayer enigma2-plugin-extensions-pictureplayer - PicturePlayer displays your photos on the TV. + Display your photos on the TV The PicturePlayer displays your photos on the TV.\nYou can view them as thumbnails or slideshow. - - Dream Multimedia - Bildbetrachter - enigma2-plugin-extensions-pictureplayer - Der Bildbetrachter zeigt Ihre Bilder auf dem Fernseher an. - Der Bildbetrachter zeigt Ihre Bilder auf dem Fernseher an.\nSie können sich Ihre Bilder als Thumbnails, einzeln oder als Slideshow anzeigen lassen. - - - diff --git a/lib/python/Plugins/Extensions/SocketMMI/meta/plugin_socketmmi.xml b/lib/python/Plugins/Extensions/SocketMMI/meta/plugin_socketmmi.xml old mode 100644 new mode 100755 index acf8374d..3eaf8fc5 --- a/lib/python/Plugins/Extensions/SocketMMI/meta/plugin_socketmmi.xml +++ b/lib/python/Plugins/Extensions/SocketMMI/meta/plugin_socketmmi.xml @@ -2,20 +2,13 @@ - + Dream Multimedia SocketMMI enigma2-plugin-extensions-socketmmi - Python frontend for /tmp/mmi.socket. + Frontend for /tmp/mmi.socket Python frontend for /tmp/mmi.socket. - - Dream Multimedia - SocketMMI - enigma2-plugin-extensions-socketmmi - Python frontend für /tmp/mmi.socket. - Python frontend für /tmp/mmi.socket. - diff --git a/lib/python/Plugins/Extensions/TuxboxPlugins/meta/plugin_tuxboxplugins.xml b/lib/python/Plugins/Extensions/TuxboxPlugins/meta/plugin_tuxboxplugins.xml old mode 100644 new mode 100755 index 734c48f1..7ca10826 --- a/lib/python/Plugins/Extensions/TuxboxPlugins/meta/plugin_tuxboxplugins.xml +++ b/lib/python/Plugins/Extensions/TuxboxPlugins/meta/plugin_tuxboxplugins.xml @@ -2,20 +2,13 @@ - + Dream Multimedia TuxboxPlugins TuxboxPlugins - Allows the execution of TuxboxPlugins. + Execute TuxboxPlugins Allows the execution of TuxboxPlugins. - - Dream Multimedia - TuxboxPlugins - enigma2-plugin-extensions-tuxboxplugins - Erlaubt das Ausführen von TuxboxPlugins. - Erlaubt das Ausführen von TuxboxPlugins. - diff --git a/lib/python/Plugins/SystemPlugins/CleanupWizard/meta/plugin_cleanupwizard.xml b/lib/python/Plugins/SystemPlugins/CleanupWizard/meta/plugin_cleanupwizard.xml index 99add3d3..d0781af4 100755 --- a/lib/python/Plugins/SystemPlugins/CleanupWizard/meta/plugin_cleanupwizard.xml +++ b/lib/python/Plugins/SystemPlugins/CleanupWizard/meta/plugin_cleanupwizard.xml @@ -2,26 +2,16 @@ - + Dream Multimedia CleanupWizard enigma2-plugin-systemplugins-cleanupwizard Automatically informs you on low internal memory - The CleanupWizard informs you when your internal free memory of your dreambox has droppen under 2MB. - You can use this wizard to remove some extensions. - + The CleanupWizard informs you when the internal free memory of your dreambox has dropped below a definable threshold. + You can use this wizard to remove some plugins. - - Dream Multimedia - CleanupWizard - enigma2-plugin-systemplugins-cleanupwizard - Informiert Sie automatisch wenn der interne Speicher Ihrer Dreambox voll wird. - Der CleanupWizard informiert Sie, wenn der interne freie Speicher Ihrer Dreambox unter 2MB fällt. - Sie können dann einige Erweiterungen deinstallieren um wieder Platz zu schaffen. - - - + diff --git a/lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/meta/plugin_commoninterfaceassignment.xml b/lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/meta/plugin_commoninterfaceassignment.xml index 9abc5986..f34f0a3c 100755 --- a/lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/meta/plugin_commoninterfaceassignment.xml +++ b/lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/meta/plugin_commoninterfaceassignment.xml @@ -4,28 +4,17 @@ - + Dream Multimedia CommonInterfaceAssignment enigma2-plugin-systemplugins-commoninterfaceassignment - Assigning providers/services/caids to a dedicated CI module - With the CommonInterfaceAssignment extension it is possible to use different CI modules - in your Dreambox and assign to each of them dedicated providers/services or caids.\n - So it is then possible to watch a scrambled service while recording another one. - - - - - Dream Multimedia - CommonInterfaceAssignment - enigma2-plugin-systemplugins-commoninterfaceassignment - Zuweisen von Providern/Services/CAIDs an ein CI Modul - Mit der CommonInterfaceAssignment Erweiterung ist es möglich jedem CI Modul bestimmte Provider/Services/CAIDs zuzuweisen.\n - So ist es möglich mit einem CI einen Sender aufzunehmen\n - und mit einem anderen einen Sender zu schauen. - + Assigning providers/services/caids to a CI module + With the CommonInterfaceAssignment plugin it is possible to use different + CI modules in your Dreambox and assign dedicated providers/services or caids to each of them.\n + This allows watching a scrambled service while recording another one. + diff --git a/lib/python/Plugins/SystemPlugins/CrashlogAutoSubmit/meta/plugin_crashlogautosubmit.xml b/lib/python/Plugins/SystemPlugins/CrashlogAutoSubmit/meta/plugin_crashlogautosubmit.xml index a118ed7f..3140b15f 100755 --- a/lib/python/Plugins/SystemPlugins/CrashlogAutoSubmit/meta/plugin_crashlogautosubmit.xml +++ b/lib/python/Plugins/SystemPlugins/CrashlogAutoSubmit/meta/plugin_crashlogautosubmit.xml @@ -2,26 +2,17 @@ - + Dream Multimedia CrashlogAutoSubmit enigma2-plugin-systemplugins-crashlogautosubmit Automatically send crashlogs to Dream Multimedia - With the CrashlogAutoSubmit extension it is possible to automatically send crashlogs - found on your Harddrive to Dream Multimedia + With the CrashlogAutoSubmit plugin it is possible to automatically + mail crashlogs found on your hard drive to Dream Multimedia. - - Dream Multimedia - CrashlogAutoSubmit - enigma2-plugin-systemplugins-crashlogautosubmit - Automatisches versenden von Crashlogs an Dream Multimedia - Mit dem CrashlogAutoSubmit Plugin ist es möglich auf Ihrer Festplatte - gefundene Crashlogs automatisch an Dream Multimedia zu versenden. - - - + diff --git a/lib/python/Plugins/SystemPlugins/DefaultServicesScanner/meta/plugin_defaultservicesscanner.xml b/lib/python/Plugins/SystemPlugins/DefaultServicesScanner/meta/plugin_defaultservicesscanner.xml index 41d41ed6..74b7886f 100755 --- a/lib/python/Plugins/SystemPlugins/DefaultServicesScanner/meta/plugin_defaultservicesscanner.xml +++ b/lib/python/Plugins/SystemPlugins/DefaultServicesScanner/meta/plugin_defaultservicesscanner.xml @@ -1,26 +1,18 @@ - + Dream Multimedia DefaultServicesScanner enigma2-plugin-systemplugins-defaultservicesscanner - Scans default lamedbs sorted by satellite with a connected dish positioner. - With the DefaultServicesScanner extension you can scan default lamedbs sorted by satellite with a connected dish positioner. - - - - - Dream Multimedia - DefaultServicesScanner - enigma2-plugin-systemplugins-defaultservicesscanner - Standard Sendersuche nach Satellit mit einem Rotor. - Mit der DefaultServicesScanner Erweiterung können Sie eine standard Sendersuche nach Satellit mit einem angeschlossenen Rotor durchführen. + Scans default lamedbs sorted by satellite + With the DefaultServicesScanner plugin you can scan default lamedbs sorted by satellite with a connected dish positioner. + diff --git a/lib/python/Plugins/SystemPlugins/DiseqcTester/meta/plugin_diseqctester.xml b/lib/python/Plugins/SystemPlugins/DiseqcTester/meta/plugin_diseqctester.xml index 33808b3e..567618b2 100755 --- a/lib/python/Plugins/SystemPlugins/DiseqcTester/meta/plugin_diseqctester.xml +++ b/lib/python/Plugins/SystemPlugins/DiseqcTester/meta/plugin_diseqctester.xml @@ -3,24 +3,16 @@ - + Dream Multimedia DiseqcTester enigma2-plugin-systemplugins-diseqctester - Test your Diseqc equipment. - With the DiseqcTester extension you can test your satellite equipment for Diseqc compatibility and errors. + Test your DiSEqC equipment + With the DiseqcTester plugin you can test your satellite equipment for DiSEqC compatibility and errors. - - Dream Multimedia - DiseqcTester - enigma2-plugin-systemplugins-diseqctester - Testet Ihr Diseqc Equipment. - Mit der DiseqcTester Erweiterung können Sie Ihr Satelliten-Equipment nach Diseqc-Kompatibilität und Fehlern überprüfen. - - - + diff --git a/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/meta/plugin_frontprocessorupgrade.xml b/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/meta/plugin_frontprocessorupgrade.xml old mode 100644 new mode 100755 index 1763f67f..7b6fdca7 --- a/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/meta/plugin_frontprocessorupgrade.xml +++ b/lib/python/Plugins/SystemPlugins/FrontprocessorUpgrade/meta/plugin_frontprocessorupgrade.xml @@ -3,24 +3,16 @@ - + Dream Multimedia FrontprocessorUpgrade enigma2-plugin-systemplugins-frontprocessorupgrade internal - Internal firmware updater. + Internal firmware updater This system tool is internally used to program the hardware with firmware updates. - - Dream Multimedia - FrontprocessorUpgrade - enigma2-plugin-systemplugins-frontprocessorupgrade - internal - Interner Firmware-Upgrader. - Dieses Systemtool wird intern benutzt um Firmware-Upgrades für die Hardware aufzuspielen. - - + diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/meta/plugin_hotplug.xml b/lib/python/Plugins/SystemPlugins/Hotplug/meta/plugin_hotplug.xml old mode 100644 new mode 100755 index 6c2824ca..610dfee6 --- a/lib/python/Plugins/SystemPlugins/Hotplug/meta/plugin_hotplug.xml +++ b/lib/python/Plugins/SystemPlugins/Hotplug/meta/plugin_hotplug.xml @@ -2,22 +2,15 @@ - + Dream Multimedia Hotplug enigma2-plugin-systemplugins-hotplug - Hotplugging for removeable devices. - The Hotplug extension notifies your system of newly added or removed devices. - - - - Dream Multimedia - Hotplug - enigma2-plugin-systemplugins-hotplug - Hotplugging für entfernbare Geräte. - Mit der Hotplug-Erweiterung wird Ihr System über neu angeschlossene oder entfernte Geräte informiert. + Hotplugging for removeable devices + The Hotplug plugin notifies your system of newly added or removed devices. + diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/meta/plugin_nfiflash.xml b/lib/python/Plugins/SystemPlugins/NFIFlash/meta/plugin_nfiflash.xml index c81f4ca5..f93f5c5a 100755 --- a/lib/python/Plugins/SystemPlugins/NFIFlash/meta/plugin_nfiflash.xml +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/meta/plugin_nfiflash.xml @@ -2,28 +2,18 @@ - - + Dream Multimedia NFIFlash enigma2-plugin-systemplugins-nfiflash - Restore your Dreambox with a USB stick. - With the NFIFlash extension it is possible to prepare a USB stick with an Dreambox image.\n + Restore your Dreambox with a USB stick + With the NFIFlash plugin it is possible to prepare a USB stick with an Dreambox image.\n It is then possible to flash your Dreambox with the image on that stick. - - Dream Multimedia - NFIFlash - enigma2-plugin-systemplugins-nfiflash - Wiederherstellen Ihrer Dreambox mittels USB-Stick. - Mit der NFIFlash Erweiterung können Sie ein Dreambox Image auf einen USB-Stick laden.\ - Mit diesem USB-Stick ist es dann möglich Ihre Dreambox zu flashen. - - - + diff --git a/lib/python/Plugins/SystemPlugins/NetworkWizard/meta/plugin_networkwizard.xml b/lib/python/Plugins/SystemPlugins/NetworkWizard/meta/plugin_networkwizard.xml index 4d3adcbd..423365f1 100755 --- a/lib/python/Plugins/SystemPlugins/NetworkWizard/meta/plugin_networkwizard.xml +++ b/lib/python/Plugins/SystemPlugins/NetworkWizard/meta/plugin_networkwizard.xml @@ -1,26 +1,18 @@ + - + Dream Multimedia NetworkWizard enigma2-plugin-systemplugins-networkwizard Step by step network configuration - With the NetworkWizard you can easy configure your network step by step. + With the NetworkWizard you can easily configure your network step by step. - - Dream Multimedia - NetzwerkWizard - enigma2-plugin-systemplugins-networkwizard - Schritt für Schritt Netzwerk konfiguration - Mit dem NetzwerkWizard können Sie Ihr Netzwerk konfigurieren. Sie werden Schritt - für Schritt durch die Konfiguration geleitet. - - - + diff --git a/lib/python/Plugins/SystemPlugins/PositionerSetup/meta/plugin_positionersetup.xml b/lib/python/Plugins/SystemPlugins/PositionerSetup/meta/plugin_positionersetup.xml index 2cb47c07..5e1db7ba 100755 --- a/lib/python/Plugins/SystemPlugins/PositionerSetup/meta/plugin_positionersetup.xml +++ b/lib/python/Plugins/SystemPlugins/PositionerSetup/meta/plugin_positionersetup.xml @@ -3,25 +3,16 @@ - + Dream Multimedia PositionerSetup enigma2-plugin-systemplugins-positionersetup - PositionerSetup helps you installing a motorized dish. - With the PositionerSetup extension it is easy to install and configure a motorized dish. - - - - - Dream Multimedia - PositionerSetup - enigma2-plugin-systemplugins-positionersetup - Unterstützt Sie beim installieren eines Rotors. - Die PositionerSetup Erweiterung unterstützt Sie beim einrichten - und konfigurieren einer motorgesteuerten Satellitenantenne. + PositionerSetup helps you installing a motorized dish + With the PositionerSetup plugin it is easy to install and configure a motorized dish. + diff --git a/lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/meta/plugin_satelliteequipmentcontrol.xml b/lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/meta/plugin_satelliteequipmentcontrol.xml index 4c0c7af7..904f9a2e 100755 --- a/lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/meta/plugin_satelliteequipmentcontrol.xml +++ b/lib/python/Plugins/SystemPlugins/SatelliteEquipmentControl/meta/plugin_satelliteequipmentcontrol.xml @@ -3,25 +3,17 @@ - + Dream Multimedia SatelliteEquipmentControl SatelliteEquipmentControl enigma2-plugin-systemplugins-satelliteequipmentcontrol - SatelliteEquipmentControl allows you to fine-tune DiSEqC-settings. - With the SatelliteEquipmentControl extension it is possible to fine-tune DiSEqC-settings. - - - - - Dream Multimedia - SatelliteEquipmentControl - enigma2-plugin-systemplugins-satelliteequipmentcontrol - Fein-Einstellungen für DiSEqC - Die SatelliteEquipmentControl-Erweiterung unterstützt Sie beim Feintuning der DiSEqC Einstellungen. + SatelliteEquipmentControl allows you to fine-tune DiSEqC-settings + With the SatelliteEquipmentControl plugin it is possible to fine-tune DiSEqC-settings. + diff --git a/lib/python/Plugins/SystemPlugins/Satfinder/meta/plugin_satfinder.xml b/lib/python/Plugins/SystemPlugins/Satfinder/meta/plugin_satfinder.xml index e9453deb..fe0c901e 100755 --- a/lib/python/Plugins/SystemPlugins/Satfinder/meta/plugin_satfinder.xml +++ b/lib/python/Plugins/SystemPlugins/Satfinder/meta/plugin_satfinder.xml @@ -1,28 +1,18 @@ - + - + Dream Multimedia Satfinder enigma2-plugin-systemplugins-satfinder - Satfinder helps you to align your dish. - The Satfinder extension helps you to align your dish.\n + Satfinder helps you to align your dish + The Satfinder plugin helps you to align your dish.\n It shows you informations about signal rate and errors. - - Dream Multimedia - Satfinder - enigma2-plugin-systemplugins-satfinder - Satfinder unterstützt Sie beim ausrichten ihrer Satellitenanlage. - Die Satfinder-Erweiterung unterstützt Sie beim Ausrichten ihrer Satellitenanlage.\n - Es zeigt Ihnen Daten wie Signalstärke und Fehlerrate an. - - - diff --git a/lib/python/Plugins/SystemPlugins/SkinSelector/meta/plugin_skinselector.xml b/lib/python/Plugins/SystemPlugins/SkinSelector/meta/plugin_skinselector.xml index 717f732b..73544a56 100755 --- a/lib/python/Plugins/SystemPlugins/SkinSelector/meta/plugin_skinselector.xml +++ b/lib/python/Plugins/SystemPlugins/SkinSelector/meta/plugin_skinselector.xml @@ -1,28 +1,19 @@ - + Dream Multimedia SkinSelector enigma2-plugin-systemplugins-skinselector - SkinSelector shows a menu with selectable skins. + SkinSelector shows a menu with selectable skins The SkinSelector shows a menu with selectable skins.\n It's now easy to change the look and feel of your Dreambox. - - Dream Multimedia - SkinSelector - enigma2-plugin-systemplugins-skinselector - Der SkinSelector zeigt Ihnen ein Menu mit auswählbaren Skins. - Die SkinSelector Erweiterung zeigt Ihnen ein Menu mit auswählbaren Skins.\n - Sie können nun einfach das Aussehen der grafischen Oberfläche Ihrer Dreambox verändern. - - - + diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py index a29a5e99..879bec16 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py @@ -69,7 +69,7 @@ class SoftwareTools(DreamInfoHandler): else: self.ImageVersion = 'Stable' self.language = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country" - DreamInfoHandler.__init__(self, self.statusCallback, blocking = False, neededTag = 'ALL_TAGS', neededFlag = self.ImageVersion, language = self.language) + DreamInfoHandler.__init__(self, self.statusCallback, blocking = False, neededTag = 'ALL_TAGS', neededFlag = self.ImageVersion) self.directory = resolveFilename(SCOPE_METADIR) self.hardware_info = HardwareInfo() self.list = List([]) diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/meta/plugin_softwaremanager.xml b/lib/python/Plugins/SystemPlugins/SoftwareManager/meta/plugin_softwaremanager.xml index cd425c33..4135a212 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/meta/plugin_softwaremanager.xml +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/meta/plugin_softwaremanager.xml @@ -3,27 +3,17 @@ - + Dream Multimedia SoftwareManager enigma2-plugin-systemplugins-softwaremanager - SoftwareManager manages your Dreambox software. + SoftwareManager manages your Dreambox software The SoftwareManager manages your Dreambox software.\n - It's easy to update your receiver's software, install or remove extensions or even backup and restore your system settings. + It's easy to update your receiver's software, install or remove plugins or even backup and restore your system settings. - - Dream Multimedia - SoftwareManager - enigma2-plugin-systemplugins-softwaremanager - Der SoftwareManager verwaltet Ihre Dreambox Software. - Der SoftwareManager verwaltet Ihre Dreambox Software.\n - Sie können nun einfach Ihre Dreambox-Software aktualisieren, neue Erweiterungen installieren oder entfernen, - oder ihre Einstellungen sichern und wiederherstellen. - - - + diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index 99837678..0cc57776 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -789,13 +789,13 @@ class PluginManager(Screen, DreamInfoHandler): status = "remove" else: status = "installed" - self.list.append(self.buildEntryComponent(name, details, description, packagename, status, selected = selectState)) + self.list.append(self.buildEntryComponent(name, _(details), _(description), packagename, status, selected = selectState)) else: if selectState == True: status = "install" else: status = "installable" - self.list.append(self.buildEntryComponent(name, details, description, packagename, status, selected = selectState)) + self.list.append(self.buildEntryComponent(name, _(details), _(description), packagename, status, selected = selectState)) if len(self.list): self.list.sort(key=lambda x: x[0]) self["list"].style = "default" @@ -1104,8 +1104,7 @@ class PluginDetails(Screen, DreamInfoHandler): self.skin_path = plugin_path self.language = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country" self.attributes = None - self.translatedAttributes = None - DreamInfoHandler.__init__(self, self.statusCallback, blocking = False, language = self.language) + DreamInfoHandler.__init__(self, self.statusCallback, blocking = False) self.directory = resolveFilename(SCOPE_METADIR) if packagedata: self.pluginname = packagedata[0] @@ -1143,8 +1142,6 @@ class PluginDetails(Screen, DreamInfoHandler): self.package = self.packageDetails[0] if self.package[0].has_key("attributes"): self.attributes = self.package[0]["attributes"] - if self.package[0].has_key("translation"): - self.translatedAttributes = self.package[0]["translation"] self.cmdList = [] self.oktext = _("\nAfter pressing OK, please wait!") @@ -1154,7 +1151,7 @@ class PluginDetails(Screen, DreamInfoHandler): self.onLayoutFinish.append(self.setInfos) def setWindowTitle(self): - self.setTitle(_("Details for extension: " + self.pluginname)) + self.setTitle(_("Details for plugin: ") + self.pluginname ) def exit(self): self.close(False) @@ -1169,34 +1166,26 @@ class PluginDetails(Screen, DreamInfoHandler): pass def setInfos(self): - if self.translatedAttributes.has_key("name"): - self.pluginname = self.translatedAttributes["name"] - elif self.attributes.has_key("name"): + if self.attributes.has_key("screenshot"): + self.loadThumbnail(self.attributes) + + if self.attributes.has_key("name"): self.pluginname = self.attributes["name"] else: self.pluginname = _("unknown") - if self.translatedAttributes.has_key("author"): - self.author = self.translatedAttributes["author"] - elif self.attributes.has_key("author"): + if self.attributes.has_key("author"): self.author = self.attributes["author"] else: self.author = _("unknown") - if self.translatedAttributes.has_key("description"): - self.description = self.translatedAttributes["description"] - elif self.attributes.has_key("description"): - self.description = self.attributes["description"] + if self.attributes.has_key("description"): + self.description = _(self.attributes["description"].replace("\\n", "\n")) else: self.description = _("No description available.") - if self.translatedAttributes.has_key("screenshot"): - self.loadThumbnail(self.translatedAttributes) - else: - self.loadThumbnail(self.attributes) - self["author"].setText(_("Author: ") + self.author) - self["detailtext"].setText(self.description.strip()) + self["detailtext"].setText(_(self.description)) if self.pluginstate in ('installable', 'install'): self["key_green"].setText(_("Install")) else: @@ -1206,6 +1195,10 @@ class PluginDetails(Screen, DreamInfoHandler): thumbnailUrl = None if entry.has_key("screenshot"): thumbnailUrl = entry["screenshot"] + if self.language == "de": + if thumbnailUrl[-7:] == "_en.jpg": + thumbnailUrl = thumbnailUrl[:-7] + "_de.jpg" + if thumbnailUrl is not None: self.thumbnail = "/tmp/" + thumbnailUrl.split('/')[-1] print "[PluginDetails] downloading screenshot " + thumbnailUrl + " to " + self.thumbnail diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/LICENSE b/lib/python/Plugins/SystemPlugins/TempFanControl/LICENSE new file mode 100755 index 00000000..99700593 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/LICENSE @@ -0,0 +1,12 @@ +This plugin is licensed under the Creative Commons +Attribution-NonCommercial-ShareAlike 3.0 Unported +License. To view a copy of this license, visit +http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative +Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + +Alternatively, this plugin may be distributed and executed on hardware which +is licensed by Dream Multimedia GmbH. + +This plugin is NOT free software. It is open source, you are allowed to +modify it (if you keep the license), but it may not be commercially +distributed other than under the conditions noted above. diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am b/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am old mode 100644 new mode 100755 index 78ff11c3..cfdeb654 --- a/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am @@ -1,5 +1,9 @@ installdir = $(LIBDIR)/enigma2/python/Plugins/SystemPlugins/TempFanControl +SUBDIRS = meta + install_PYTHON = \ __init__.py \ plugin.py + +dist_install_DATA = LICENSE \ No newline at end of file diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/meta/Makefile.am b/lib/python/Plugins/SystemPlugins/TempFanControl/meta/Makefile.am new file mode 100755 index 00000000..da7be245 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/meta/Makefile.am @@ -0,0 +1,3 @@ +installdir = $(datadir)/meta + +dist_install_DATA = plugin_tempfancontrol.xml diff --git a/lib/python/Plugins/SystemPlugins/TempFanControl/meta/plugin_tempfancontrol.xml b/lib/python/Plugins/SystemPlugins/TempFanControl/meta/plugin_tempfancontrol.xml new file mode 100755 index 00000000..a0bb5fa5 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/TempFanControl/meta/plugin_tempfancontrol.xml @@ -0,0 +1,18 @@ + + + + + + + + Dream Multimedia + TempFanControl + enigma2-plugin-systemplugins-tempfancontrol + Control your system fan + Control your internal system fan. + + + + + + diff --git a/lib/python/Plugins/SystemPlugins/VideoEnhancement/meta/plugin_videoenhancement.xml b/lib/python/Plugins/SystemPlugins/VideoEnhancement/meta/plugin_videoenhancement.xml index 208c7e0c..11b0c59f 100755 --- a/lib/python/Plugins/SystemPlugins/VideoEnhancement/meta/plugin_videoenhancement.xml +++ b/lib/python/Plugins/SystemPlugins/VideoEnhancement/meta/plugin_videoenhancement.xml @@ -6,22 +6,14 @@ - + Dream Multimedia VideoEnhancement enigma2-plugin-systemplugins-videoenhancement - VideoEnhancement provides advanced video enhancement settings. - The VideoEnhancement extension provides advanced video enhancement settings. + VideoEnhancement provides advanced video enhancement settings + The VideoEnhancement plugin provides advanced video enhancement settings. - - Dream Multimedia - Erweiterte A/V Einstellungen - enigma2-plugin-systemplugins-videoenhancement - Erweiterte A/V Einstellungen für Ihre Dreambox. - Erweiterte A/V Einstellungen für Ihre Dreambox. - - diff --git a/lib/python/Plugins/SystemPlugins/VideoTune/meta/plugin_videotune.xml b/lib/python/Plugins/SystemPlugins/VideoTune/meta/plugin_videotune.xml index c4609433..78b170ac 100755 --- a/lib/python/Plugins/SystemPlugins/VideoTune/meta/plugin_videotune.xml +++ b/lib/python/Plugins/SystemPlugins/VideoTune/meta/plugin_videotune.xml @@ -3,23 +3,14 @@ - + Dream Multimedia VideoTune enigma2-plugin-systemplugins-videotune - VideoTune helps fine-tuning your tv display. + VideoTune helps fine-tuning your tv display The VideoTune helps fine-tuning your tv display.\nYou can control brightness and contrast of your tv. - - Dream Multimedia - DE - VideoTune - DE - enigma2-plugin-systemplugins-videotune - VideoTune hilft beim fein-einstellen des Fernsehers. - VideoTune hilf beim fein-einstellen des Fernsehers.\nSie können Kontrast und Helligkeit fein-einstellen. - - - diff --git a/lib/python/Plugins/SystemPlugins/Videomode/meta/plugin_videomode.xml b/lib/python/Plugins/SystemPlugins/Videomode/meta/plugin_videomode.xml index fbb6e3f4..e16a7dc8 100755 --- a/lib/python/Plugins/SystemPlugins/Videomode/meta/plugin_videomode.xml +++ b/lib/python/Plugins/SystemPlugins/Videomode/meta/plugin_videomode.xml @@ -3,22 +3,14 @@ - + Dream Multimedia Videomode enigma2-plugin-systemplugins-videomode - Videomode provides advanced video modes. - The Videomode extension provides advanced video modes. + Videomode provides advanced video mode settings + The Videomode plugin provides advanced video mode settings. - - Dream Multimedia - Videomode - enigma2-plugin-systemplugins-videomode - Videomode bietet erweiterte Video Einstellungen. - Die Videomode-Erweiterung bietet erweiterte Video-Einstellungen. - - diff --git a/lib/python/Plugins/SystemPlugins/WirelessLan/meta/plugin_wirelesslan.xml b/lib/python/Plugins/SystemPlugins/WirelessLan/meta/plugin_wirelesslan.xml index 1f882b32..eca6c0f9 100755 --- a/lib/python/Plugins/SystemPlugins/WirelessLan/meta/plugin_wirelesslan.xml +++ b/lib/python/Plugins/SystemPlugins/WirelessLan/meta/plugin_wirelesslan.xml @@ -3,22 +3,14 @@ - + Dream Multimedia WirelessLan enigma2-plugin-systemplugins-wirelesslan Configure your WLAN network interface - The WirelessLan extensions helps you configuring your WLAN network interface. + The WirelessLan plugin helps you configuring your WLAN network interface. - - Dream Multimedia - WirelessLan - enigma2-plugin-systemplugins-wirelesslan - Konfigurieren Sie Ihr WLAN Netzwerk. - Die WirelessLan Erweiterung hilft Ihnen beim konfigurieren Ihres WLAN Netzwerkes.. - - diff --git a/tools/genmetaindex.py b/tools/genmetaindex.py index f7dc5b98..f42cefc2 100755 --- a/tools/genmetaindex.py +++ b/tools/genmetaindex.py @@ -1,25 +1,23 @@ -# usage: genmetaindex.py > index.xml +# usage: genmetaindex.py > index.xml import sys, os from xml.etree.ElementTree import ElementTree, Element -language = sys.argv[1] - root = Element("index") -for file in sys.argv[2:]: +for file in sys.argv[1:]: p = ElementTree() p.parse(file) package = Element("package") package.set("details", os.path.basename(file)) - # we need all prerequisuited + # we need all prerequisites package.append(p.find("prerequisites")) info = None - # we need some of the info, but only our locale + # we need some of the info, but not all for i in p.findall("info"): - if not info or i.get("language") == language: + if not info: info = i assert info -- cgit v1.2.3 From 02e81517baae9a339d8f1550c765e02bf550a484 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Wed, 22 Sep 2010 15:39:36 +0200 Subject: Components/DreamInfoHandler.py: ignore old meta-xml index files. refs #578 --- lib/python/Components/DreamInfoHandler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/DreamInfoHandler.py b/lib/python/Components/DreamInfoHandler.py index dd140cbb..40305671 100755 --- a/lib/python/Components/DreamInfoHandler.py +++ b/lib/python/Components/DreamInfoHandler.py @@ -222,6 +222,8 @@ class DreamInfoHandler: for indexfile in os.listdir(self.directory[0]): if indexfile.startswith("index-"): if indexfile.endswith(".xml"): + if indexfile[-7:-6] == "_": + continue indexfileList.append(indexfile) if len(indexfileList): for file in indexfileList: -- cgit v1.2.3 From 3a44514adf9e366316213ba027d3e8808bad6b0c Mon Sep 17 00:00:00 2001 From: acid-burn Date: Wed, 29 Sep 2010 09:28:40 +0200 Subject: DreamInfoHandler.py: strip data. refs #578 --- lib/python/Components/DreamInfoHandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/DreamInfoHandler.py b/lib/python/Components/DreamInfoHandler.py index 40305671..03d52157 100755 --- a/lib/python/Components/DreamInfoHandler.py +++ b/lib/python/Components/DreamInfoHandler.py @@ -123,7 +123,7 @@ class InfoHandler(xml.sax.ContentHandler): if self.elements[-1] == "shortdescription": self.attributes["shortdescription"] = str(data) if self.elements[-1] == "description": - self.data += data + self.data += data.strip() self.attributes["description"] = str(self.data) #print "characters", data -- cgit v1.2.3 From 970cdaf1f5137645fad5f1404d29fdd90127f5fb Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Sat, 2 Oct 2010 14:50:56 +0200 Subject: fixes bug #587 - use new internally connectable detection mechanism - display unsupported tuners --- data/skin_default.xml | 8 ++++---- lib/python/Components/NimManager.py | 28 +++++++++++++++++++++++----- lib/python/Screens/Satconfig.py | 4 +++- 3 files changed, 30 insertions(+), 10 deletions(-) (limited to 'lib/python/Components') diff --git a/data/skin_default.xml b/data/skin_default.xml index 8b26ce7e..f9fb09c1 100755 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -670,12 +670,12 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) - - + + {"template": [ - MultiContentEntryText(pos = (10, 5), size = (360, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name, - MultiContentEntryText(pos = (50, 30), size = (320, 50), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings, + MultiContentEntryText(pos = (10, 5), size = (440, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name, + MultiContentEntryText(pos = (50, 30), size = (400, 50), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings, ], "fonts": [gFont("Regular", 20), gFont("Regular", 15)], "itemHeight": 80 diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 805be4df..cb832e41 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -471,7 +471,7 @@ class SecConfigure: self.update() class NIM(object): - def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}): + def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None): self.slot = slot if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", None): @@ -483,8 +483,11 @@ class NIM(object): self.has_outputs = has_outputs self.internally_connectable = internally_connectable self.multi_type = multi_type + self.frontend_id = frontend_id def isCompatible(self, what): + if not self.isSupported(): + return False compatible = { None: (None,), "DVB-S": ("DVB-S", None), @@ -526,6 +529,9 @@ class NIM(object): def isMultiType(self): return (len(self.multi_type) > 0) + def isSupported(self): + return (self.frontend_id is not None) + # returns dict {: } def getMultiTypeList(self): return self.multi_type @@ -548,8 +554,10 @@ class NIM(object): if self.empty: nim_text += _("(empty)") + elif not self.isSupported(): + nim_text += self.description + " (" + _("not supported") + ")" else: - nim_text += self.description + " (" + self.friendly_type + ")" + nim_text += self.description + " (" + self.friendly_type + ")" return nim_text @@ -675,6 +683,9 @@ class NimManager: elif line.strip().startswith("Internally_Connectable:"): input = int(line.strip()[len("Internally_Connectable:") + 1:]) entries[current_slot]["internally_connectable"] = input + elif line.strip().startswith("Frontend_Device:"): + input = int(line.strip()[len("Frontend_Device:") + 1:]) + entries[current_slot]["frontend_device"] = input elif line.strip().startswith("Mode"): # "Mode 0: DVB-T" -> ["Mode 0", " DVB-T"] split = line.strip().split(":") @@ -688,17 +699,24 @@ class NimManager: entries[current_slot]["name"] = _("N/A") nimfile.close() + from os import path + for id, entry in entries.items(): if not (entry.has_key("name") and entry.has_key("type")): entry["name"] = _("N/A") entry["type"] = None if not (entry.has_key("has_outputs")): entry["has_outputs"] = True - if not (entry.has_key("internally_connectable")): - entry["internally_connectable"] = None + if entry.has_key("frontend_device"): # check if internally connectable + if path.exists("/proc/stb/frontend/%d/rf_switch" % entry["frontend_device"]): + entry["internally_connectable"] = entry["frontend_device"] - 1 + else: + entry["internally_connectable"] = None + else: + entry["frontend_device"] = entry["internally_connectable"] = None if not (entry.has_key("multi_type")): entry["multi_type"] = {} - self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"])) + self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"])) def hasNimType(self, chktype): for slot in self.nim_slots: diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 44f4251a..a5712dcd 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -489,7 +489,7 @@ class NimSelection(Screen): def okbuttonClick(self): nim = self["nimlist"].getCurrent() nim = nim and nim[3] - if nim is not None and not nim.empty: + if nim is not None and not nim.empty and nim.isSupported(): self.session.openWithCallback(self.updateList, self.resultclass, nim.slot) def showNim(self, nim): @@ -548,6 +548,8 @@ class NimSelection(Screen): text = _("enabled") if x.isMultiType(): text = _("Switchable tuner types:") + "(" + ','.join(x.getMultiTypeList().values()) + ")" + "\n" + text + if not x.isSupported(): + text = _("tuner is not supported") self.list.append((slotid, x.friendly_full_description, text, x)) self["nimlist"].setList(self.list) -- cgit v1.2.3 From 006e3497641164df7a413c8730d9b8914d67e2d8 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Sun, 3 Oct 2010 01:33:22 +0200 Subject: refs bug #587 internally linking is now done via /proc/stb/frontend/X/rf_switch instead of /proc/stb/tsmux and moved to the python part of enigma2 --- lib/dvb/sec.cpp | 24 ------------------------ lib/python/Components/NimManager.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 24 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index a8292c0c..d48d44e1 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -1004,19 +1004,6 @@ RESULT eDVBSatelliteEquipmentControl::clear() //reset some tuner configuration for (eSmartPtrList::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it) { - long tmp; - char c; - if (sscanf(it->m_frontend->getDescription(), "BCM450%c (internal)", &c) == 1 && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1) - { - FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w"); - if (!f || fwrite("B", 1, 1, f) != 1) - eDebug("set /proc/stb/tsmux/lnb_b_input to B failed!! (%m)"); - else - { - eDebug("set /proc/stb/tsmux/lnb_b_input to B OK"); - fclose(f); - } - } it->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, -1); it->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, -1); it->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, -1); @@ -1448,17 +1435,6 @@ RESULT eDVBSatelliteEquipmentControl::setTunerLinked(int tu1, int tu2) char c; p1->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, (long)p2); p2->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, (long)p1); - if (!strcmp(p1->m_frontend->getDescription(), p2->m_frontend->getDescription()) && sscanf(p1->m_frontend->getDescription(), "BCM450%c (internal)", &c) == 1) - { - FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w"); - if (!f || fwrite("A", 1, 1, f) != 1) - eDebug("set /proc/stb/tsmux/lnb_b_input to A failed!! (%m)"); - else - { - eDebug("set /proc/stb/tsmux/lnb_b_input to A OK"); - fclose(f); - } - } } p1=p2=NULL; diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index cb832e41..4d562b95 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -110,9 +110,16 @@ class SecConfigure: def setSatposDepends(self, sec, nim1, nim2): print "tuner", nim1, "depends on satpos of", nim2 sec.setTunerDepends(nim1, nim2) + + def linkInternally(self, slotid): + nim = self.NimManager.getNim(slotid) + if nim.internallyConnectableTo is not None: + nim.setInternalLink() def linkNIMs(self, sec, nim1, nim2): print "link tuner", nim1, "to tuner", nim2 + if nim2 == (nim1 - 1): + self.linkInternally(nim1) sec.setTunerLinked(nim1, nim2) def getRoot(self, slotid, connto): @@ -127,6 +134,9 @@ class SecConfigure: def update(self): sec = secClass.getInstance() self.configuredSatellites = set() + for slotid in self.NimManager.getNimListOfType("DVB-S"): + if self.NimManager.nimInternallyConnectableTo(slotid) is not None: + self.NimManager.nimRemoveInternalLink(slotid) sec.clear() ## this do unlinking NIMs too !! print "sec config cleared" @@ -526,6 +536,16 @@ class NIM(object): def internallyConnectableTo(self): return self.internally_connectable + def setInternalLink(self): + if self.internally_connectable is not None: + print "setting internal link on frontend id", self.frontend_id + open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("internal") + + def removeInternalLink(self): + if self.internally_connectable is not None: + print "removing internal link on frontend id", self.frontend_id + open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("external") + def isMultiType(self): return (len(self.multi_type) > 0) @@ -735,6 +755,9 @@ class NimManager: def getNimName(self, slotid): return self.nim_slots[slotid].description + + def getNim(self, slotid): + return self.nim_slots[slotid] def getNimListOfType(self, type, exception = -1): # returns a list of indexes for NIMs compatible to the given type, except for 'exception' @@ -765,6 +788,12 @@ class NimManager: def hasOutputs(self, slotid): return self.nim_slots[slotid].hasOutputs() + def nimInternallyConnectableTo(self, slotid): + return self.nim_slots[slotid].internallyConnectableTo() + + def nimRemoveInternalLink(self, slotid): + self.nim_slots[slotid].removeInternalLink() + def canConnectTo(self, slotid): slots = [] if self.nim_slots[slotid].internallyConnectableTo() is not None: -- cgit v1.2.3 From 4cf4560a3dfc1a18f4bc894e153dc501965f4b0f Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 11 Oct 2010 00:03:40 +0200 Subject: fix slotinfo assignment for new "unsupported tuner" handling refs bug #587 --- lib/dvb/dvb.cpp | 35 +++++++++++++++++++++-------------- lib/dvb/frontend.cpp | 14 ++++++++++---- lib/python/Components/NimManager.py | 2 +- 3 files changed, 32 insertions(+), 19 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index 40d44186..51629452 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -320,27 +320,34 @@ PyObject *eDVBResourceManager::setFrontendSlotInformations(ePyObject list) PyErr_SetString(PyExc_StandardError, "eDVBResourceManager::setFrontendSlotInformations argument should be a python list"); return NULL; } - if ((unsigned int)PyList_Size(list) != m_frontend.size()) + unsigned int assigned=0; + for (eSmartPtrList::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) { + int pos=0; + while (pos < PyList_Size(list)) { + ePyObject obj = PyList_GET_ITEM(list, pos++); + if (!i->m_frontend->setSlotInfo(obj)) + continue; + ++assigned; + break; + } + } + if (assigned != m_frontend.size()) { char blasel[256]; - sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations list size incorrect %d frontends avail, but %d entries in slotlist", - m_frontend.size(), PyList_Size(list)); + sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations .. assigned %d socket informations, but %d registered frontends!", + m_frontend.size(), assigned); PyErr_SetString(PyExc_StandardError, blasel); return NULL; } - int pos=0; - for (eSmartPtrList::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i) - { - ePyObject obj = PyList_GET_ITEM(list, pos++); - if (!i->m_frontend->setSlotInfo(obj)) - return NULL; - } - pos=0; for (eSmartPtrList::iterator i(m_simulate_frontend.begin()); i != m_simulate_frontend.end(); ++i) { - ePyObject obj = PyList_GET_ITEM(list, pos++); - if (!i->m_frontend->setSlotInfo(obj)) - return NULL; + int pos=0; + while (pos < PyList_Size(list)) { + ePyObject obj = PyList_GET_ITEM(list, pos++); + if (!i->m_frontend->setSlotInfo(obj)) + continue; + break; + } } Py_RETURN_NONE; } diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index abbb8d29..6f78197a 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -2700,17 +2700,23 @@ int eDVBFrontend::isCompatibleWith(ePtr &feparm) bool eDVBFrontend::setSlotInfo(ePyObject obj) { - ePyObject Id, Descr, Enabled, IsDVBS2; - if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 4) + ePyObject Id, Descr, Enabled, IsDVBS2, frontendId; + if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 5) goto arg_error; Id = PyTuple_GET_ITEM(obj, 0); Descr = PyTuple_GET_ITEM(obj, 1); Enabled = PyTuple_GET_ITEM(obj, 2); IsDVBS2 = PyTuple_GET_ITEM(obj, 3); - if (!PyInt_Check(Id) || !PyString_Check(Descr) || !PyBool_Check(Enabled) || !PyBool_Check(IsDVBS2)) + frontendId = PyTuple_GET_ITEM(obj, 4); + m_slotid = PyInt_AsLong(Id); + if (!PyInt_Check(Id) || !PyString_Check(Descr) || !PyBool_Check(Enabled) || !PyBool_Check(IsDVBS2) || !PyInt_Check(frontendId)) goto arg_error; strcpy(m_description, PyString_AS_STRING(Descr)); - m_slotid = PyInt_AsLong(Id); + if (PyInt_AsLong(frontendId) == -1 || PyInt_AsLong(frontendId) != m_dvbid) { +// eDebugNoSimulate("skip slotinfo for slotid %d, descr %s", +// m_slotid, m_description); + return false; + } m_enabled = Enabled == Py_True; // HACK.. the rotor workaround is neede for all NIMs with LNBP21 voltage regulator... m_need_rotor_workaround = !!strstr(m_description, "Alps BSBE1") || diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 4d562b95..7f041902 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -150,7 +150,7 @@ class SecConfigure: for slot in nim_slots: if slot.type is not None: - used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2"))) + used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2"), slot.frontend_id is None and -1 or slot.frontend_id)) eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots) for slot in nim_slots: -- cgit v1.2.3 From d21824019fe93603f1c05c7263ef7570aa60e135 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Mon, 11 Oct 2010 12:30:00 +0200 Subject: refs bug #587 set empty tuner slots to supported --- lib/python/Components/NimManager.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/python/Components') diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 7f041902..815cfe35 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -481,7 +481,7 @@ class SecConfigure: self.update() class NIM(object): - def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None): + def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None, is_empty = False): self.slot = slot if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", None): @@ -494,6 +494,7 @@ class NIM(object): self.internally_connectable = internally_connectable self.multi_type = multi_type self.frontend_id = frontend_id + self.__is_empty = is_empty def isCompatible(self, what): if not self.isSupported(): @@ -549,8 +550,12 @@ class NIM(object): def isMultiType(self): return (len(self.multi_type) > 0) + def isEmpty(self): + return self.__is_empty + + # empty tuners are supported! def isSupported(self): - return (self.frontend_id is not None) + return (self.frontend_id is not None) or self.__is_empty # returns dict {: } def getMultiTypeList(self): @@ -695,8 +700,10 @@ class NimManager: entries[current_slot] = {} elif line.strip().startswith("Type:"): entries[current_slot]["type"] = str(line.strip()[6:]) + entries[current_slot]["isempty"] = False elif line.strip().startswith("Name:"): entries[current_slot]["name"] = str(line.strip()[6:]) + entries[current_slot]["isempty"] = False elif line.strip().startswith("Has_Outputs:"): input = str(line.strip()[len("Has_Outputs:") + 1:]) entries[current_slot]["has_outputs"] = (input == "yes") @@ -717,6 +724,7 @@ class NimManager: elif line.strip().startswith("empty"): entries[current_slot]["type"] = None entries[current_slot]["name"] = _("N/A") + entries[current_slot]["isempty"] = True nimfile.close() from os import path @@ -736,7 +744,7 @@ class NimManager: entry["frontend_device"] = entry["internally_connectable"] = None if not (entry.has_key("multi_type")): entry["multi_type"] = {} - self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"])) + self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"], is_empty = entry["isempty"])) def hasNimType(self, chktype): for slot in self.nim_slots: -- cgit v1.2.3