orca r3939 - in trunk: . src/orca/scripts/apps/evolution
- From: richb svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r3939 - in trunk: . src/orca/scripts/apps/evolution
- Date: Thu, 29 May 2008 19:15:43 +0000 (UTC)
Author: richb
Date: Thu May 29 19:15:42 2008
New Revision: 3939
URL: http://svn.gnome.org/viewvc/orca?rev=3939&view=rev
Log:
* src/orca/scripts/apps/evolution/script.py:
Fixed bug #516565 â Orca speaks the full line of a message in
Evo when it should not.
Modified:
trunk/ChangeLog
trunk/src/orca/scripts/apps/evolution/script.py
Modified: trunk/src/orca/scripts/apps/evolution/script.py
==============================================================================
--- trunk/src/orca/scripts/apps/evolution/script.py (original)
+++ trunk/src/orca/scripts/apps/evolution/script.py Thu May 29 19:15:42 2008
@@ -524,9 +524,6 @@
self.speakTextIndentation(obj, string)
line = self.adjustForRepeats(string)
- if self.speakNewLine(obj):
- speech.speakCharacter("\n", None)
-
if self.speakBlankLine(obj):
# Translators: "blank" is a short word to mean the
# user has navigated to an empty line.
@@ -1199,6 +1196,15 @@
"Home", "End", "Return"]:
return
+ # If the last keyboard event was a "same line"
+ # navigation key, then pass this event onto the
+ # onCaretMoved() method in the parent class for
+ # speaking. See bug #516565 for more details.
+ #
+ if lastKey in ["Left", "Right", "Home", "End"]:
+ default.Script.onCaretMoved(self, event)
+ return
+
self.message_panel = event.source.parent.parent
self.presentMessageLine(event.source, newLocusOfFocus)
@@ -1339,63 +1345,6 @@
default.Script.locusOfFocusChanged(self, event,
oldLocusOfFocus, newLocusOfFocus)
- def speakNewLine(self, obj):
- """Returns True if a newline should be spoken.
- Otherwise, returns False.
- """
-
- # Get the the AccessibleText interrface.
- try:
- text = obj.queryText()
- except NotImplementedError:
- return False
-
- # Was a left or right-arrow key pressed?
- if not (orca_state.lastInputEvent and \
- orca_state.lastInputEvent.__dict__.has_key("event_string")):
- return False
-
- lastKey = orca_state.lastNonModifierKeyEvent.event_string
- if lastKey != "Left" and lastKey != "Right":
- return False
-
- # Was a control key pressed?
- mods = orca_state.lastInputEvent.modifiers
- isControlKey = mods & (1 << pyatspi.MODIFIER_CONTROL)
-
- # Get the line containing the caret
- caretOffset = text.caretOffset
- line = text.getTextAtOffset(caretOffset, \
- pyatspi.TEXT_BOUNDARY_LINE_START)
- lineStart = line[1]
- lineEnd = line[2]
-
- if isControlKey: # control-right-arrow or control-left-arrow
-
- # Get the word containing the caret.
- word = text.getTextAtOffset(caretOffset, \
- pyatspi.TEXT_BOUNDARY_WORD_START)
- wordStart = word[1]
- wordEnd = word[2]
-
- if lastKey == "Right":
- if wordStart == lineStart:
- return True
- else:
- if wordEnd == lineEnd:
- return True
-
- else: # right arrow or left arrow
-
- if lastKey == "Right":
- if caretOffset == lineStart:
- return True
- else:
- if caretOffset == lineEnd:
- return True
-
- return False
-
def speakBlankLine(self, obj):
"""Returns True if a blank line should be spoken.
Otherwise, returns False.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]