[orca] Fix for bug 665288 - Orca's script manager cannot adequately handle multiple "unknown" applications
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix for bug 665288 - Orca's script manager cannot adequately handle multiple "unknown" applications
- Date: Thu, 1 Dec 2011 13:37:18 +0000 (UTC)
commit e8d392244594b0883df23f8298b1225e3c7f7305
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Dec 1 14:35:31 2011 +0100
Fix for bug 665288 - Orca's script manager cannot adequately handle multiple "unknown" applications which embed content from other toolkits
src/orca/script_manager.py | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
---
diff --git a/src/orca/script_manager.py b/src/orca/script_manager.py
index 8a5e24b..20da93e 100644
--- a/src/orca/script_manager.py
+++ b/src/orca/script_manager.py
@@ -36,7 +36,8 @@ _eventManager = getattr(orca, '_eventManager')
class ScriptManager:
def __init__(self):
- self.scripts = {}
+ self.appScripts = {}
+ self.toolkitScripts = {}
self._appModules = apps.__all__
self._toolkitModules = toolkits.__all__
self._defaultScript = None
@@ -78,7 +79,8 @@ class ScriptManager:
self._defaultScript = None
self.setActiveScript(None, "deactivate")
- self.scripts = {}
+ self.appScripts = {}
+ self.toolkitScripts = {}
def getModuleName(self, app):
"""Returns the module name of the script to use for application app."""
@@ -219,19 +221,19 @@ class ScriptManager:
objToolkit = self._toolkitForObject(obj)
if objToolkit:
- toolkitScript = self.scripts.get(objToolkit)
+ toolkitScript = self.toolkitScripts.get(app)
if not toolkitScript:
- toolkitScript = self._createScript(None, obj)
- self.scripts[objToolkit] = toolkitScript
+ toolkitScript = self._createScript(app, obj)
+ self.toolkitScripts[app] = toolkitScript
_eventManager.registerListeners(toolkitScript)
if not app:
appScript = self.getDefaultScript()
- elif app in self.scripts:
- appScript = self.scripts[app]
+ elif app in self.appScripts:
+ appScript = self.appScripts[app]
else:
appScript = self._createScript(app, None)
- self.scripts[app] = appScript
+ self.appScripts[app] = appScript
_eventManager.registerListeners(appScript)
# Only defer to the toolkit script for this object if the app script
@@ -277,10 +279,19 @@ class ScriptManager:
debug.printException(debug.LEVEL_FINEST)
return
- appList = self.scripts.keys()
+ appList = self.appScripts.keys()
appList = filter(lambda a: a!= None and a not in desktop, appList)
for app in appList:
- script = self.scripts.pop(app)
- _eventManager.deregisterListeners(script)
+ appScript = self.appScripts.pop(app)
+ _eventManager.deregisterListeners(appScript)
+ del appScript
+
+ try:
+ toolkitScript = self.toolkitScripts.pop(app)
+ except KeyError:
+ pass
+ else:
+ _eventManager.deregisterListeners(toolkitScript)
+ del toolkitScript
+
del app
- del script
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]