[orca] Simply presentation of selected item in metacity and gtk-window-decorator



commit 9300478a7d848c6c8c28b04d5d4542f99be5e13a
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Nov 20 18:12:36 2018 -0500

    Simply presentation of selected item in metacity and gtk-window-decorator
    
    * Don't bother sanity-checking for "inaccessible" apps. It's an old
      heuristic and apparently an unreliable one.
    * Use presentMessage() rather displayBrailleMessage() + speech.speak()

 .../scripts/apps/gtk-window-decorator/script.py    | 32 +---------------------
 src/orca/scripts/apps/metacity/script.py           | 22 +--------------
 2 files changed, 2 insertions(+), 52 deletions(-)
---
diff --git a/src/orca/scripts/apps/gtk-window-decorator/script.py 
b/src/orca/scripts/apps/gtk-window-decorator/script.py
index 61f695f20..3bde12b77 100644
--- a/src/orca/scripts/apps/gtk-window-decorator/script.py
+++ b/src/orca/scripts/apps/gtk-window-decorator/script.py
@@ -27,7 +27,6 @@ __license__   = "LGPL"
 
 import orca.messages as messages
 import orca.scripts.default as default
-import orca.speech as speech
 import pyatspi
 
 ########################################################################
@@ -55,37 +54,8 @@ class Script(default.Script):
         - obj: the accessible status bar.
         """
 
-        objName = obj.name
-        if not (objName and len(objName)):
-            return
-
-        # gtk-window-decorator sometimes abbreviates the names, placing
-        # '...' at the end.  Strip the ending off so that we can compare
-        # the beginning of the window names with the objName.
-        #
-        index = objName.rfind('...')
-        if index >= 0:
-            objName = objName[0:index]
-
-        # Do we know about this window?  Traverse through our list of apps
-        # and go through the toplevel windows in each to see if we know
-        # about this one.  If we do, it's accessible.  If we don't, it is
-        # not.
-        #
-        found = False
-        for app in self.utilities.knownApplications():
-            for child in app:
-                if child.name.startswith(objName):
-                    found = True
-                    break
-
-        text = obj.name
-        if not found:
-            text += ". " + messages.INACCESSIBLE
-
         self.presentationInterrupt()
-        self.displayBrailleMessage(text)
-        speech.speak(text)
+        self.presentMessage(obj.name)
 
     def onNameChanged(self, event):
         """The status bar in gtk-window-decorator tells us what toplevel
diff --git a/src/orca/scripts/apps/metacity/script.py b/src/orca/scripts/apps/metacity/script.py
index 9b185e53a..29d58d7a6 100644
--- a/src/orca/scripts/apps/metacity/script.py
+++ b/src/orca/scripts/apps/metacity/script.py
@@ -27,7 +27,6 @@ __license__   = "LGPL"
 
 import orca.messages as messages
 import orca.scripts.default as default
-import orca.speech as speech
 import pyatspi
 
 ########################################################################
@@ -50,27 +49,8 @@ class Script(default.Script):
     def presentStatusBar(self, obj):
         """Presents information about the metacity status bar."""
 
-        # We have to stop speech, as Metacity has a key grab and we're not
-        # getting keys
         self.presentationInterrupt()
-
-        # If the window was iconified, then obj.name will be surrounded by
-        # brackets. If this is the case, remove them before comparing the
-        # name against the various window names. See bug #522797 for more
-        # details.
-        #
-        objName = obj.name
-        if objName and len(objName):
-            if objName[0] == "[" and objName[-1] == "]":
-                objName = objName[1:-1]
-
-        try:
-            text = obj.name
-        except:
-            text = objName
-
-        self.displayBrailleMessage(text)
-        speech.speak(text)
+        self.presentMessage(obj.name)
 
     def onNameChanged(self, event):
         """The status bar in metacity tells us what toplevel window


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]