[orca] Reduce minimum word requirement for non-dialog unrelated labels



commit 6f6e5efa6810f2f5b0e44c7bf6b385dd6805641a
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Apr 29 16:34:21 2018 -0400

    Reduce minimum word requirement for non-dialog unrelated labels

 src/orca/script_utilities.py |    2 +-
 src/orca/speech_generator.py |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 65782ec..4c1627a 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -510,7 +510,7 @@ class Utilities:
                 pass
 
         if not displayedText and role in [pyatspi.ROLE_PUSH_BUTTON, pyatspi.ROLE_LIST_ITEM]:
-            labels = self.unrelatedLabels(obj)
+            labels = self.unrelatedLabels(obj, minimumWords=1)
             if not labels:
                 labels = self.unrelatedLabels(obj, onlyShowing=False, minimumWords=1)
             displayedText = " ".join(map(self.displayedText, labels))
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 69b08ce..2336b20 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -446,7 +446,13 @@ class SpeechGenerator(generator.Generator):
         result = []
         acss = self.voice(DEFAULT)
         visibleOnly = not self._script.utilities.isStatusBarNotification(obj)
-        labels = self._script.utilities.unrelatedLabels(obj, visibleOnly)
+
+        minimumWords = 1
+        role = args.get('role', obj.getRole())
+        if role == pyatspi.ROLE_DIALOG:
+            minimumWords = 3
+
+        labels = self._script.utilities.unrelatedLabels(obj, visibleOnly, minimumWords)
         for label in labels:
             name = self._generateName(label, **args)
             if name and len(name[0]) == 1:


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