[orca] Fix for bug 657579 - Orca should not present tooltips shown as a result of mouse hovering unless the



commit 867f7298a6d6a89561652c372e5a38985991b622
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun Aug 28 20:57:26 2011 -0400

    Fix for bug 657579 - Orca should not present tooltips shown as a result of mouse hovering unless the 'present tooltips' setting is enabled

 src/orca/scripts/default.py |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 0207357..511fb0b 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -3304,20 +3304,26 @@ class Script(script.Script):
         # Handle tooltip popups.
         #
         if event.source.getRole() == pyatspi.ROLE_TOOL_TIP:
-            obj = event.source
-            if event.type.startswith("object:state-changed:showing"):
-                if event.detail1 == 1:
-                    self.presentToolTip(obj)
-                elif orca_state.locusOfFocus:
-                    keyString, mods = self.utilities.lastKeyAndModifiers()
-                    if keyString == "F1":
-                        self.updateBraille(orca_state.locusOfFocus)
-                        utterances = self.speechGenerator.generateSpeech(
-                            orca_state.locusOfFocus)
-                        utterances.extend(self.tutorialGenerator.getTutorial(
-                            orca_state.locusOfFocus, False))
-                        speech.speak(utterances)
-            return
+            if not event.type.startswith("object:state-changed:showing"):
+                return
+
+            keyString, mods = self.utilities.lastKeyAndModifiers()
+            if keyString != "F1" \
+               and not  _settingsManager.getSetting('presentToolTips'):
+                return
+
+            if event.detail1 == 1:
+                self.presentToolTip(event.source)
+                return
+
+            if orca_state.locusOfFocus and keyString == "F1":
+                obj = orca_state.locusOfFocus
+                self.updateBraille(obj)
+                utterances = self.speechGenerator.generateSpeech(obj)
+                utterances.extend(
+                    self.tutorialGenerator.getTutorial(obj, False))
+                speech.speak(utterances)
+                return
 
         if event.source.getRole() in state_change_notifiers:
             notifiers = state_change_notifiers[event.source.getRole()]



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