From 3658d690debfd163a4f4bbd4b47163ce0b260413 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 4 Feb 2010 01:11:33 +0100 Subject: fixes bug #380 don't spawn countless "zap back to service" message boxes on removing >1 orbital positions --- lib/python/Screens/Satconfig.py | 3 +-- lib/python/Screens/ServiceStopScreen.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Screens/Satconfig.py b/lib/python/Screens/Satconfig.py index 62480b5f..156f7780 100644 --- a/lib/python/Screens/Satconfig.py +++ b/lib/python/Screens/Satconfig.py @@ -347,6 +347,7 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): new_configured_sats = nimmanager.getConfiguredSats() self.unconfed_sats = old_configured_sats - new_configured_sats self.satpos_to_remove = None + self.restoreService(_("Zap back to service before tuner setup?")) self.deleteConfirmed((None, "no")) def deleteConfirmed(self, confirmed): @@ -376,8 +377,6 @@ class NimSetup(Screen, ConfigListScreen, ServiceStopScreen): if confirmed[1] == "yestoall" or confirmed[1] == "notoall": self.deleteConfirmed(confirmed) break - if not self.satpos_to_remove: - self.restoreService(_("Zap back to service before tuner setup?")) def __init__(self, session, slotid): Screen.__init__(self, session) diff --git a/lib/python/Screens/ServiceStopScreen.py b/lib/python/Screens/ServiceStopScreen.py index 3b3dda88..7f0d26a5 100644 --- a/lib/python/Screens/ServiceStopScreen.py +++ b/lib/python/Screens/ServiceStopScreen.py @@ -13,6 +13,9 @@ class ServiceStopScreen: def stopService(self): self.oldref = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() + if self.session.pipshown: # try to disable pip + self.session.pipshown = False + del self.session.pip def __onClose(self): self.session.nav.playService(self.oldref) -- cgit v1.2.3 From ee4870b6452d5d100bd77fe52a0306a344826311 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 4 Feb 2010 14:04:20 +0100 Subject: fixes bug #380 pip is'n available in every state of e2, so don't try to get the status if it's not available --- lib/python/Screens/ServiceStopScreen.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Screens/ServiceStopScreen.py b/lib/python/Screens/ServiceStopScreen.py index 7f0d26a5..628a93a5 100644 --- a/lib/python/Screens/ServiceStopScreen.py +++ b/lib/python/Screens/ServiceStopScreen.py @@ -6,16 +6,26 @@ class ServiceStopScreen: self.session except: print "[ServiceStopScreen] ERROR: no self.session set" - + self.oldref = None self.onClose.append(self.__onClose) + def pipAvailable(self): + # pip isn't available in every state of e2 + try: + self.session.pipshown + pipavailable = True + except: + pipavailable = False + return pipavailable + def stopService(self): self.oldref = self.session.nav.getCurrentlyPlayingServiceReference() self.session.nav.stopService() - if self.session.pipshown: # try to disable pip - self.session.pipshown = False - del self.session.pip + if self.pipAvailable(): + if self.session.pipshown: # try to disable pip + self.session.pipshown = False + del self.session.pip def __onClose(self): self.session.nav.playService(self.oldref) -- cgit v1.2.3 From 775a74c65d2178c7a9f39c994287aa5ba5259321 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 9 Feb 2010 14:26:01 +0100 Subject: lib/python/Plugins/Extensions/DVDPlayer/plugin.py: also check with upper case --- lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/python') diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index e895a141..6e4d9cc6 100755 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -736,6 +736,7 @@ def filescan(**kwargs): paths_to_scan = [ ScanPath(path = "video_ts", with_subdirs = False), + ScanPath(path = "VIDEO_TS", with_subdirs = False), ScanPath(path = "", with_subdirs = False), ], name = "DVD", -- cgit v1.2.3 From 0b5970ebeb4e04cc7b733d2d7b8044459407c634 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 9 Feb 2010 14:26:35 +0100 Subject: lib/python/Tools/HardwareInfo.py: remove debug output --- lib/python/Tools/HardwareInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python') diff --git a/lib/python/Tools/HardwareInfo.py b/lib/python/Tools/HardwareInfo.py index 612a565f..e72d2912 100644 --- a/lib/python/Tools/HardwareInfo.py +++ b/lib/python/Tools/HardwareInfo.py @@ -3,7 +3,7 @@ class HardwareInfo: def __init__(self): if HardwareInfo.device_name is not None: - print "using cached result" +# print "using cached result" return HardwareInfo.device_name = "unknown" -- cgit v1.2.3 From f87f40e3d7bade8c5dbd12d9ccc7f1b2417fff04 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 9 Feb 2010 19:45:42 +0100 Subject: lib/python/Plugins/SystemPlugins/SoftwareManager: more robust code this i.e. fixes: Traceback (most recent call last): File "/usr/lib/enigma2/python/Tools/BoundFunction.py", line 9, in __call__ return self.fnc(*self.args + args, **newkwargs) File "/usr/lib/enigma2/python/Components/Console.py", line 56, in finishedCB self.callbacks[name](data,retval,extra_args) File "/usr/lib/enigma2/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py", line 108, in IpkgListAvailableCB SoftwareTools.available_packetlist.append([name, split[1].strip(), split[2].strip()]) ref bug #383 --- .../SystemPlugins/SoftwareManager/SoftwareTools.py | 25 +++++++++++++--------- .../SystemPlugins/SoftwareManager/plugin.py | 25 ++++++++++++++-------- 2 files changed, 31 insertions(+), 19 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py index 4e7591ef..e8cf6dc2 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py @@ -94,14 +94,17 @@ class SoftwareTools(DreamInfoHandler): def IpkgListAvailableCB(self, result, retval, extra_args = None): (callback) = extra_args - if len(result): + if result: if SoftwareTools.list_updating: SoftwareTools.available_packetlist = [] for x in result.splitlines(): - split = x.split(' - ') - name = split[0].strip() + tokens = x.split(' - ') + name = tokens[0].strip() if not any(name.endswith(x) for x in self.unwanted_extensions): - SoftwareTools.available_packetlist.append([name, split[1].strip(), split[2].strip()]) + l = len(tokens) + version = l > 1 and tokens[1].strip() or "" + descr = l > 2 and tokens[2].strip() or "" + SoftwareTools.available_packetlist.append([name, version, descr]) if callback is None: self.startInstallMetaPackage() else: @@ -126,7 +129,7 @@ class SoftwareTools(DreamInfoHandler): def InstallMetaPackageCB(self, result, retval, extra_args = None): (callback) = extra_args - if len(result): + if result: self.fillPackagesIndexList() if callback is None: self.startIpkgListInstalled() @@ -152,13 +155,15 @@ class SoftwareTools(DreamInfoHandler): def IpkgListInstalledCB(self, result, retval, extra_args = None): (callback) = extra_args - if len(result): + if result: SoftwareTools.installed_packetlist = {} for x in result.splitlines(): - split = x.split(' - ') - name = split[0].strip() + tokens = x.split(' - ') + name = tokens[0].strip() if not any(name.endswith(x) for x in self.unwanted_extensions): - SoftwareTools.installed_packetlist[name] = split[1].strip() + l = len(tokens) + version = l > 1 and tokens[1].strip() or "" + SoftwareTools.installed_packetlist[name] = version if callback is None: self.countUpdates() else: @@ -203,7 +208,7 @@ class SoftwareTools(DreamInfoHandler): def IpkgUpdateCB(self, result, retval, extra_args = None): (callback) = extra_args - if len(result): + if result: if self.Console: if len(self.Console.appContainers) == 0: if callback is not None: diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index b20ba51e..4dbe7f70 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -1558,24 +1558,31 @@ class PacketManager(Screen): pass def IpkgList_Finished(self, result, retval, extra_args = None): - if len(result): + if result: self.packetlist = [] for x in result.splitlines(): - split = x.split(' - ') #self.blacklisted_packages - if not any(split[0].strip().endswith(x) for x in self.unwanted_extensions): - self.packetlist.append([split[0].strip(), split[1].strip(),split[2].strip()]) + tokens = x.split(' - ') #self.blacklisted_packages + name = tokens[0].strip() + if not any(name.endswith(x) for x in self.unwanted_extensions): + l = len(tokens) + version = l > 1 and tokens[1].strip() or "" + descr = l > 2 and tokens[2].strip() or "" + self.packetlist.append([name, version, descr]) if not self.Console: self.Console = Console() cmd = "ipkg list_installed" self.Console.ePopen(cmd, self.IpkgListInstalled_Finished) def IpkgListInstalled_Finished(self, result, retval, extra_args = None): - if len(result): + if result: self.installed_packetlist = {} for x in result.splitlines(): - split = x.split(' - ') - if not any(split[0].strip().endswith(x) for x in self.unwanted_extensions): - self.installed_packetlist[split[0].strip()] = split[1].strip() + tokens = x.split(' - ') #self.blacklisted_packages + name = tokens[0].strip() + if not any(name.endswith(x) for x in self.unwanted_extensions): + l = len(tokens) + version = l > 1 and tokens[1].strip() or "" + self.installed_packetlist[name] = version self.buildPacketList() def buildEntryComponent(self, name, version, description, state): @@ -1703,7 +1710,7 @@ def Plugins(path, **kwargs): plugin_path = path list = [ PluginDescriptor(where = [PluginDescriptor.WHERE_NETWORKCONFIG_READ], fnc = autostart), - PluginDescriptor(name=_("Software management"), description=_("Manage your receiver's software"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup), + PluginDescriptor(name=_("Software management"), description=_("Manage your receiver's software"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup), PluginDescriptor(name=_("Ipkg"), where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan) ] if config.usage.setup_level.index >= 2: # expert+ -- cgit v1.2.3 From 718bb417bc409a09b2989a6e51eeaa4d68d6208a Mon Sep 17 00:00:00 2001 From: acid-burn Date: Thu, 11 Feb 2010 14:15:33 +0100 Subject: NetworkWizard/NetworkWizard.py: * fix automatic interface selection if only one network adapter is available in some situations. refs #218 --- lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/python') diff --git a/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py b/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py index 018ae876..6096ca8b 100755 --- a/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py +++ b/lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py @@ -104,6 +104,9 @@ class NetworkWizard(WizardLanguage, Rc): self.rescanTimer.stop() self.Adapterlist = iNetwork.getAdapterList() self.InstalledInterfaceCount = len(self.Adapterlist) + if self.Adapterlist is not None: + if self.InstalledInterfaceCount == 1 and self.selectedInterface is None: + self.selectedInterface = self.Adapterlist[0] self.originalAth0State = iNetwork.getAdapterAttribute('ath0', 'up') self.originalEth0State = iNetwork.getAdapterAttribute('eth0', 'up') self.originalWlan0State = iNetwork.getAdapterAttribute('wlan0', 'up') -- cgit v1.2.3 From ecd9f154cdf3b90ef00bc92707ab0a1a29b642af Mon Sep 17 00:00:00 2001 From: acid-burn Date: Thu, 11 Feb 2010 14:27:16 +0100 Subject: WirelessLan/plugin.py: * fix sometimes not correctly returned ssid name from wlanscan screen. * don't count the hidden network helper entry as found network. * some small optimizations. refs #204 --- .../Plugins/SystemPlugins/WirelessLan/plugin.py | 33 +++++++++++++--------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py b/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py index c8568b98..a9f7bf43 100755 --- a/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py +++ b/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py @@ -151,6 +151,7 @@ class WlanStatus(Screen): self["statuspic"].setPixmapNum(0) self["statuspic"].show() + class WlanScan(Screen): skin = """ @@ -190,7 +191,7 @@ class WlanScan(Screen): self.WlanList = None self.cleanList = None self.oldlist = None - self.listLenght = None + self.listLength = None self.rescanTimer = eTimer() self.rescanTimer.callback.append(self.rescanTimerFired) @@ -226,7 +227,10 @@ class WlanScan(Screen): self.rescanTimer.stop() del self.rescanTimer if cur[1] is not None: - essid = cur[1] + if cur[1] == 'hidden...': + essid = cur[1] + else: + essid = cur[0] self.close(essid,self.getWlanList()) else: self.close(None,None) @@ -305,7 +309,7 @@ class WlanScan(Screen): self['list'].setList(self.newAPList) self["list"].setIndex(newListIndex) self["list"].updateList(self.newAPList) - self.listLenght = len(self.newAPList) + self.listLength = len(self.newAPList) self.buildWlanList() self.setInfo() @@ -315,7 +319,7 @@ class WlanScan(Screen): self.w = Wlan(self.iface) aps = self.w.getNetworkList() if aps is not None: - print "[NetworkWizard.py] got Accespoints!" + print "[WirelessLan.py] got Accespoints!" tmpList = [] compList = [] for ap in aps: @@ -340,31 +344,34 @@ class WlanScan(Screen): if refresh is False: self['list'].setList(self.APList) - self.listLenght = len(self.APList) + self.listLength = len(self.APList) self.setInfo() self.rescanTimer.start(5000) return self.cleanList def setInfo(self): length = self.getLength() - if length == 0: + if length <= 1: self["info"].setText(_("No wireless networks found! Please refresh.")) - elif length == 1: + elif length == 2: self["info"].setText(_("1 wireless network found!")) else: - self["info"].setText(str(length)+_(" wireless networks found!")) + self["info"].setText(str(length-1)+_(" wireless networks found!")) def buildWlanList(self): self.WlanList = [] - currList = [] - currList = self['list'].list - for entry in currList: - self.WlanList.append( (entry[1], entry[0]) ) + for entry in self['list'].list: + if entry[1] == "hidden...": + self.WlanList.append(( "hidden...",_("enter hidden network SSID") ))#continue + else: + self.WlanList.append( (entry[0], entry[0]) ) def getLength(self): - return self.listLenght + return self.listLength def getWlanList(self): + if self.WlanList is None: + self.buildWlanList() return self.WlanList -- 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') 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