[Nvda-dev] commit r1880 - in trunk: . source/appModules

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Nvda-dev] commit r1880 - in trunk: . source/appModules

NVDA Subversion
Author: jteh
Date: Thu Apr  3 08:29:04 2008
New Revision: 1880

Log:
The Media Player Classic status bar is non-standard. However, it does conform to our idea of a status bar, so we can just override the role and let the new status bar code handle the rest. This removes a lot of unnecessary bloat from the Media Player Classic appModule.

Removed:
   trunk/source/appModules/mplayerc_desktop.kbd
Modified:
   trunk/   (props changed)
   trunk/source/appModules/mplayerc.py

Modified: trunk/source/appModules/mplayerc.py
==============================================================================
--- trunk/source/appModules/mplayerc.py (original)
+++ trunk/source/appModules/mplayerc.py Thu Apr  3 08:29:04 2008
@@ -5,55 +5,10 @@
 #See the file COPYING for more details.
 
 import appModuleHandler
-from NVDAObjects.IAccessible import IAccessible, getNVDAObjectFromEvent
 import controlTypes
-import api
-import IAccessibleHandler
-import ctypes
-import speech
-import keyboardHandler
 
 class appModule(appModuleHandler.appModule):
 
  def event_NVDAObject_init(self,obj):
  if obj.windowClassName=="#32770" and obj.windowControlID==10021:
- obj.__class__=MPCStatusBar
-
- def script_reportStatusLine(self,keyPress,nextScript):
- focus=api.getFocusObject()
- statusBarObject=focus.statusBar
- if not statusBarObject:
- statusWindow=ctypes.windll.user32.FindWindowExW(focus.parent.windowHandle,0,u'#32770',0)
- if statusWindow:
- statusBarObject=getNVDAObjectFromEvent(statusWindow,IAccessibleHandler.OBJID_CLIENT,0)
- if not statusBarObject:
- speech.speakMessage(_("no status bar found"))
- return
- if keyboardHandler.lastKeyCount == 1:
- speech.speakObject(statusBarObject,reason=speech.REASON_QUERY)
- else:
- speech.speakSpelling(statusBarObject.value)
- api.setNavigatorObject(statusBarObject)
- script_reportStatusLine.__doc__ = _("reads the current aplication status bar and moves the navigation cursor to it")
-
-class MPCStatusBar(IAccessible):
-
- def _get_firstChild(self):
- return None
-
- def _get_lastChild(self):
- return None
-
- def _get_children(self):
- return []
-
- def _get_role(self):
- return controlTypes.ROLE_STATUSBAR
-
- def _get_value(self):
- oldValue=super(MPCStatusBar,self)._get_value()
- valueFromChildren=" ".join([" ".join([y for y in (x.name,x.value) if y and not y.isspace()]) for x in super(MPCStatusBar,self)._get_children() if x.role == controlTypes.ROLE_GRAPHIC])
- if valueFromChildren:
- return valueFromChildren
- else:
- return oldValue
+ obj.role = controlTypes.ROLE_STATUSBAR


Loading...