[orca] Don't insist upon label visibility for status bar notifications



commit 52064c1e1903d28fdc482a9d9b76569524270413
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jul 29 14:32:34 2015 -0400

    Don't insist upon label visibility for status bar notifications
    
    Status bar notification support is our way of providing application
    developers a sane, predictable means to have Orca notify users of
    status changes and other messages. But having a visible status bar
    and labels may be seen as an annoyance for sighted users. So we'll
    not insist on label visibility in this particular case.

 src/orca/scripts/default.py  |    3 ++-
 src/orca/speech_generator.py |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index a31ccd8..f3adf61 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2422,7 +2422,8 @@ class Script(script.Script):
         role = obj.getRole()
         if role == pyatspi.ROLE_NOTIFICATION:
             speech.speak(self.speechGenerator.generateSpeech(obj))
-            labels = self.utilities.unrelatedLabels(obj)
+            visibleOnly = not self.utilities.isStatusBarNotification(obj)
+            labels = self.utilities.unrelatedLabels(obj, visibleOnly)
             msg = ''.join(map(self.utilities.displayedText, labels))
             self.displayBrailleMessage(msg, flashTime=settings.brailleFlashTime)
             notification_messages.saveMessage(msg)
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 2cc9a11..c092f07 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -396,7 +396,8 @@ class SpeechGenerator(generator.Generator):
         """
         result = []
         acss = self.voice(DEFAULT)
-        labels = self._script.utilities.unrelatedLabels(obj)
+        visibleOnly = not self._script.utilities.isStatusBarNotification(obj)
+        labels = self._script.utilities.unrelatedLabels(obj, visibleOnly)
         for label in labels:
             name = self._generateName(label, **args)
             result.extend(name)


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