orca r4034 - in trunk: . src/orca src/orca/scripts/toolkits/Gecko



Author: wwalker
Date: Mon Jul 14 19:09:34 2008
New Revision: 4034
URL: http://svn.gnome.org/viewvc/orca?rev=4034&view=rev

Log:
Fix for bug #534022 - The Line-end symbol (46 123) should be configurable per application.


Modified:
   trunk/ChangeLog
   trunk/src/orca/braille.py
   trunk/src/orca/braillegenerator.py
   trunk/src/orca/flat_review.py
   trunk/src/orca/orca-setup.glade
   trunk/src/orca/orca_gui_prefs.py
   trunk/src/orca/orca_prefs.py
   trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py
   trunk/src/orca/scripts/toolkits/Gecko/script.py
   trunk/src/orca/settings.py

Modified: trunk/src/orca/braille.py
==============================================================================
--- trunk/src/orca/braille.py	(original)
+++ trunk/src/orca/braille.py	Mon Jul 14 19:09:34 2008
@@ -501,7 +501,7 @@
 
         Region.__init__(self, string, cursorOffset, True)
 
-        if not self.contracted:
+        if not self.contracted and not settings.disableBrailleEOL:
             self.string += self.eol
 
     def repositionCursor(self):

Modified: trunk/src/orca/braillegenerator.py
==============================================================================
--- trunk/src/orca/braillegenerator.py	(original)
+++ trunk/src/orca/braillegenerator.py	Mon Jul 14 19:09:34 2008
@@ -648,7 +648,7 @@
 
         textRegion = braille.Text(obj,
                                   self._script.getDisplayedLabel(obj),
-                                  " $l")
+                                  settings.brailleEOLIndicator)
         regions.append(textRegion)
 
         # We do not want the role at the end of text areas.
@@ -834,7 +834,7 @@
 
         textRegion = braille.Text(obj,
                                   self._script.getDisplayedLabel(obj),
-                                  " $l")
+                                  settings.brailleEOLIndicator)
         regions.append(textRegion)
 
         # We do not want the role at the end of text areas.

Modified: trunk/src/orca/flat_review.py
==============================================================================
--- trunk/src/orca/flat_review.py	(original)
+++ trunk/src/orca/flat_review.py	Mon Jul 14 19:09:34 2008
@@ -569,14 +569,15 @@
 
                 brailleOffset += len(region.string.decode("UTF-8"))
 
-            if len(self.brailleRegions):
-                pad = braille.Region(" ")
-                pad.brailleOffset = brailleOffset
-                self.brailleRegions.append(pad)
-                brailleOffset += 1
-            eol = braille.Region("$l")
-            eol.brailleOffset = brailleOffset
-            self.brailleRegions.append(eol)
+            if not settings.disableBrailleEOL:
+                if len(self.brailleRegions):
+                    pad = braille.Region(" ")
+                    pad.brailleOffset = brailleOffset
+                    self.brailleRegions.append(pad)
+                    brailleOffset += 1
+                eol = braille.Region("$l")
+                eol.brailleOffset = brailleOffset
+                self.brailleRegions.append(eol)
 
         return self.brailleRegions
 

Modified: trunk/src/orca/orca-setup.glade
==============================================================================
--- trunk/src/orca/orca-setup.glade	(original)
+++ trunk/src/orca/orca-setup.glade	Mon Jul 14 19:09:34 2008
@@ -1555,6 +1555,26 @@
 			  <property name="fill">False</property>
 			</packing>
 		      </child>
+
+		      <child>
+			<widget class="GtkCheckButton" id="disableBrailleEOL">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Disable _end of line symbol</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			  <signal name="toggled" handler="disableBrailleEOLChecked" last_modification_time="Thu, 21 May 2008 14:39:01 GMT"/>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>

Modified: trunk/src/orca/orca_gui_prefs.py
==============================================================================
--- trunk/src/orca/orca_gui_prefs.py	(original)
+++ trunk/src/orca/orca_gui_prefs.py	Mon Jul 14 19:09:34 2008
@@ -1487,6 +1487,10 @@
         state = prefs["brailleRolenameStyle"] == \
                             settings.BRAILLE_ROLENAME_STYLE_SHORT
         self.get_widget("abbrevRolenames").set_active(state)
+
+        self.get_widget("disableBrailleEOL").set_active(
+            prefs["disableBrailleEOL"])
+
         if louis is None:
             self.get_widget( \
                 "contractedBrailleCheckbutton").set_sensitive(False)
@@ -2860,6 +2864,18 @@
             self.prefsDict["brailleRolenameStyle"] = \
                 settings.BRAILLE_ROLENAME_STYLE_LONG
 
+    def disableBrailleEOLChecked(self, widget):
+        """Signal handler for the "toggled" signal for the disableBrailleEOL
+           GtkCheckButton widget. The user has [un]checked the 'Disable
+           braille end of line symbol' checkbox. Set the 'disableBrailleEOL'
+           preference to the new value.
+
+        Arguments:
+        - widget: the component that generated the signal.
+        """
+
+        self.prefsDict["disableBrailleEOL"] = widget.get_active()
+
     def brailleVerbosityChanged(self, widget):
         """Signal handler for the "toggled" signal for the brailleBriefButton,
            or brailleVerboseButton GtkRadioButton widgets. The user has

Modified: trunk/src/orca/orca_prefs.py
==============================================================================
--- trunk/src/orca/orca_prefs.py	(original)
+++ trunk/src/orca/orca_prefs.py	Mon Jul 14 19:09:34 2008
@@ -720,6 +720,8 @@
                                                               prefsDict[key])
             elif key == "brailleContractionTable":
                 value = "'%s'" % prefsDict[key]
+            elif key == "brailleEOLIndicator":
+                value = "'%s'" % prefsDict[key]
             else:
                 value = prefsDict[key]
 

Modified: trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py	Mon Jul 14 19:09:34 2008
@@ -246,7 +246,7 @@
         if not label or not len(label):
             label = parent.name
 
-        textRegion = braille.Text(obj, label, " $l")
+        textRegion = braille.Text(obj, label, settings.brailleEOLIndicator)
         regions.append(textRegion)
         return [regions, textRegion]
 

Modified: trunk/src/orca/scripts/toolkits/Gecko/script.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/script.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/script.py	Mon Jul 14 19:09:34 2008
@@ -2251,7 +2251,9 @@
                 or ((obj.getRole() == pyatspi.ROLE_DOCUMENT_FRAME) \
                     and obj.getState().contains(pyatspi.STATE_EDITABLE)):
                 label = self.getDisplayedLabel(obj)
-                regions = [braille.Text(obj, label, " $l")]
+                regions = [braille.Text(obj,
+                                        label,
+                                        settings.brailleEOLIndicator)]
                 if isFocusedObj:
                     focusedRegion = regions[0]
             elif text and (obj.getRole() != pyatspi.ROLE_MENU_ITEM):

Modified: trunk/src/orca/settings.py
==============================================================================
--- trunk/src/orca/settings.py	(original)
+++ trunk/src/orca/settings.py	Mon Jul 14 19:09:34 2008
@@ -108,6 +108,8 @@
     "enableNavigationKeys",
     "enableBraille",
     "enableBrailleGrouping",
+    "disableBrailleEOL",
+    "brailleEOLIndicator",
     "brailleVerbosityLevel",
     "brailleRolenameStyle",
     "brailleSelectorIndicator",
@@ -338,6 +340,11 @@
 #
 enableBrailleMonitor    = False
 
+# string to indicate end of printed line for braille displays:
+#
+disableBrailleEOL = False
+brailleEOLIndicator = " $l"
+
 # Strings used to indicate checkbox/radio button states in braille:
 #
 brailleCheckBoxIndicators = ["< >", "<x>", "<->"]



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