[orca] Fix for bgo#585049 - When I select paragraphs with Ctrl+Shift+Down key combination, Orca says incorr



commit 492383b81b413d6c0103928eec9d9cdf360951aa
Author: Willie Walker <william walker sun com>
Date:   Thu Jul 23 09:35:07 2009 -0400

    Fix for bgo#585049 - When I select paragraphs with Ctrl+Shift+Down key combination, Orca says incorrect information message
    
    This allows the script to determine what should be spoken

 src/orca/default.py                       |   36 ++++++++++++++--------------
 src/orca/scripts/toolkits/Gecko/script.py |   12 +++++++++
 2 files changed, 30 insertions(+), 18 deletions(-)
---
diff --git a/src/orca/default.py b/src/orca/default.py
index 13addfb..a689772 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -7658,6 +7658,18 @@ class Script(script.Script):
             self.pointOfReference["lastSelections"].append(
               text.getSelection(i))
 
+    def _getCtrlShiftSelectionsStrings(self):
+        return [
+            # Translators: when the user selects (highlights) text in
+            # a document, Orca will speak information about what they
+            # have selected.
+            #
+            _("paragraph selected down from cursor position"),
+            _("paragraph unselected down from cursor position"),
+            _("paragraph selected up from cursor position"),
+            _("paragraph unselected up from cursor position"),
+        ]
+
     def speakTextSelectionState(self, obj, startOffset, endOffset):
         """Speak "selected" if the text was just selected, "unselected" if
         it was just unselected.
@@ -7752,31 +7764,19 @@ class Script(script.Script):
 
         elif (eventStr == "Down") and isShiftKey and isControlKey:
             specialCaseFound = True
+            strings = self._getCtrlShiftSelectionsStrings()
             if selectedText:
-                # Translators: when the user selects (highlights) text in
-                # a document, Orca will speak information about what they
-                # have selected.
-                #
-                line = _("line selected down from cursor position")
+                line = strings[0]
             else:
-                # Translators: when the user unselects text in a document,
-                # Orca will speak information about what they have unselected.
-                #
-                line = _("line unselected down from cursor position")
+                line = strings[1]
 
         elif (eventStr == "Up") and isShiftKey and isControlKey:
             specialCaseFound = True
+            strings = self._getCtrlShiftSelectionsStrings()
             if selectedText:
-                # Translators: when the user selects (highlights) text in
-                # a document, Orca will speak information about what they
-                # have selected.
-                #
-                line = _("line selected up from cursor position")
+                line = strings[2]
             else:
-                # Translators: when the user unselects text in a document,
-                # Orca will speak information about what they have unselected.
-                #
-                line = _("line unselected up from cursor position")
+                line = strings[3]
 
         elif (eventStr == "Home") and isShiftKey and isControlKey:
             specialCaseFound = True
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 2721544..f498686 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -1512,6 +1512,18 @@ class Script(default.Script):
 
         default.Script.onTextInserted(self, event)
 
+    def _getCtrlShiftSelectionsStrings(self):
+        return [
+            # Translators: when the user selects (highlights) text in
+            # a document, Orca will speak information about what they
+            # have selected.
+            #
+            _("line selected down from cursor position"),
+            _("line unselected down from cursor position"),
+            _("line selected up from cursor position"),
+            _("line unselected up from cursor position"),
+        ]
+
     def onTextSelectionChanged(self, event):
         """Called when an object's text selection changes.
 



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