From 1fc2700e351c0297089925aba6c3a7b890dfb077 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 13 Feb 2010 18:47:15 +0100 Subject: lib/driver/rc.cpp,rcinput.cpp: only do EVIOCGRAB when event bit 0x1E is set in event device evbits --- lib/driver/rc.cpp | 5 ++++- lib/driver/rcinput.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/driver/rc.cpp b/lib/driver/rc.cpp index c56fde44..c1ff13ea 100644 --- a/lib/driver/rc.cpp +++ b/lib/driver/rc.cpp @@ -129,8 +129,11 @@ void eRCInputEventDriver::setExclusive(bool b) { if (handle >= 0) { + long evbits; int grab = b; - if (::ioctl(handle, EVIOCGRAB, grab) < 0) + if (::ioctl(handle, EVIOCGBIT(0, EV_MAX+1), &evbits) < 0) + perror("EVIOCGBIT"); + else if ((evbits & (1 << 0x1E)) && ::ioctl(handle, EVIOCGRAB, grab) < 0) perror("EVIOCGRAB"); } } diff --git a/lib/driver/rcinput.cpp b/lib/driver/rcinput.cpp index e593087d..2bfeefa1 100644 --- a/lib/driver/rcinput.cpp +++ b/lib/driver/rcinput.cpp @@ -89,7 +89,8 @@ eRCDeviceInputDev::eRCDeviceInputDev(eRCInputEventDriver *driver) void eRCDeviceInputDev::setExclusive(bool b) { - driver->setExclusive(!iskeyboard && b); + if (!iskeyboard) + driver->setExclusive(b); } const char *eRCDeviceInputDev::getDescription() const -- cgit v1.2.3 From 985e7a88ad3611501223da5c74cd0e7edbb3e703 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(-) 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 e87c31487053cf0273a1bc82867c58bce99ed5f3 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Sat, 20 Feb 2010 08:35:07 +0100 Subject: WirelessLan/plugin.py: * use dict to store already found entries. This avoids increasing entries inside WLAN-Scan in new 1.6 Images. this fixes #448 --- .../Plugins/SystemPlugins/WirelessLan/plugin.py | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py b/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py index a9f7bf43..a687714d 100755 --- a/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py +++ b/lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py @@ -190,7 +190,7 @@ class WlanScan(Screen): self.newAPList = None self.WlanList = None self.cleanList = None - self.oldlist = None + self.oldlist = {} self.listLength = None self.rescanTimer = eTimer() self.rescanTimer.callback.append(self.rescanTimerFired) @@ -274,24 +274,18 @@ class WlanScan(Screen): return((essid, bssid, _("Signal: ") + str(signal), _("Max. Bitrate: ") + str(maxrate), _("Encrypted: ") + encryption, _("Interface: ") + str(iface), divpng)) def updateAPList(self): - self.oldlist = [] - self.oldlist = self.cleanList - self.newAPList = [] newList = [] + newList = self.getAccessPoints(refresh = True) + self.newAPList = [] tmpList = [] newListIndex = None currentListEntry = None currentListIndex = None - newList = self.getAccessPoints(refresh = True) - - for oldentry in self.oldlist: - if oldentry not in newList: - newList.append(oldentry) - for newentry in newList: - if newentry[1] == "hidden...": - continue - tmpList.append(newentry) + for ap in self.oldlist.keys(): + data = self.oldlist[ap]['data'] + if data is not None: + tmpList.append(data) if len(tmpList): if "hidden..." not in tmpList: @@ -303,7 +297,7 @@ class WlanScan(Screen): currentListEntry = self["list"].getCurrent() idx = 0 for entry in self.newAPList: - if entry == currentListEntry: + if entry[0] == currentListEntry[0]: newListIndex = idx idx +=1 self['list'].setList(self.newAPList) @@ -335,6 +329,10 @@ class WlanScan(Screen): compList.remove(compentry) for entry in compList: self.cleanList.append( ( entry[0], entry[1], entry[2], entry[3], entry[4], entry[5] ) ) + if not self.oldlist.has_key(entry[0]): + self.oldlist[entry[0]] = { 'data': entry } + else: + self.oldlist[entry[0]]['data'] = entry if "hidden..." not in self.cleanList: self.cleanList.append( ( _("enter hidden network SSID"), "hidden...", True, self.iface, _("unavailable"), "" ) ) -- cgit v1.2.3