[orca/orca-gnome3: 15/23] Some code style refactor for gsettings related purposes: * Replacing textAttributesBrailleIndica



commit 96f579d86c73fe2ad3b655346c13bcb79c727d0e
Author: Javier Hernández Antúnez <jhernandez emergya es>
Date:   Tue Mar 8 02:04:45 2011 +0100

    Some code style refactor for gsettings related purposes:
        * Replacing textAttributesBrailleIndicator by brailleIndicatorAttrib
        * Replacing enableMagZoomerColorInversion by enableMagColorInversion
        * Replacing speakMultiCaseStringsAsWords by speechSplitMultiCase

 docs/doc-set/user_guide.html                       |    2 +-
 docs/doc-set/user_guide.sgml                       |    2 +-
 org.gnome.Orca.gschema.xml                         |   16 +++++++-------
 src/orca/braille.py                                |    2 +-
 src/orca/mag.py                                    |    8 +++---
 src/orca/orca-setup.ui                             |    2 +-
 src/orca/orca_gui_prefs.py                         |   22 ++++++++++----------
 src/orca/orca_prefs.py                             |    2 +-
 src/orca/settings.py                               |   14 ++++++------
 src/orca/speech.py                                 |    4 +-
 test/harness/user-settings.conf.in                 |    6 ++--
 .../firefox/sayAll_bug-591351-1.settings           |    6 ++--
 .../gtk-demo/spoken_indentation.settings           |    6 ++--
 13 files changed, 46 insertions(+), 46 deletions(-)
---
diff --git a/docs/doc-set/user_guide.html b/docs/doc-set/user_guide.html
index 46218dd..d07947f 100644
--- a/docs/doc-set/user_guide.html
+++ b/docs/doc-set/user_guide.html
@@ -161,7 +161,7 @@ orca.settings.magZoomerRight = 1014
 orca.settings.magZoomerTop = 0
 orca.settings.magZoomerBottom = 758
 orca.settings.magZoomFactor = 4
-orca.settings.enableMagZoomerColorInversion = False
+orca.settings.enableMagColorInversion = False
 orca.settings.magSmoothingMode = orca.settings.MAG_SMOOTHING_MODE_BILINEAR
 orca.settings.magMouseTrackingMode = orca.settings.MAG_MOUSE_TRACKING_MODE_CENTERED
 orca.settings.verbalizePunctuationStyle = orca.settings.PUNCTUATION_STYLE_MOST
diff --git a/docs/doc-set/user_guide.sgml b/docs/doc-set/user_guide.sgml
index 467057d..0ff9abc 100644
--- a/docs/doc-set/user_guide.sgml
+++ b/docs/doc-set/user_guide.sgml
@@ -274,7 +274,7 @@ orca.settings.magZoomerRight = 1014
 orca.settings.magZoomerTop = 0
 orca.settings.magZoomerBottom = 758
 orca.settings.magZoomFactor = 4
-orca.settings.enableMagZoomerColorInversion = False
+orca.settings.enableMagColorInversion = False
 orca.settings.magSmoothingMode = orca.settings.MAG_SMOOTHING_MODE_BILINEAR
 orca.settings.magMouseTrackingMode = orca.settings.MAG_MOUSE_TRACKING_MODE_CENTERED
 orca.settings.verbalizePunctuationStyle = orca.settings.PUNCTUATION_STYLE_MOST
diff --git a/org.gnome.Orca.gschema.xml b/org.gnome.Orca.gschema.xml
index 350f73a..e57499c 100644
--- a/org.gnome.Orca.gschema.xml
+++ b/org.gnome.Orca.gschema.xml
@@ -58,8 +58,8 @@
   </key>
   <key name="enable-mag-zoom-color-inversion" type="b">
     <default>false</default>
-    <summary>TODO: Add a summary for enable-mag-zoomer-color-inversion key</summary>
-    <description>TODO: Add a description for enable-mag-zoomer-color-inversion key.</description>
+    <summary>TODO: Add a summary for enable-mag-color-inversion key</summary>
+    <description>TODO: Add a description for enable-mag-color-inversion key.</description>
   </key>
   <key name="mag-cursor-size" type="i">
     <default>32</default>
@@ -242,10 +242,10 @@
     <summary>TODO: Add a summary for enabled-brailled-text-attributes key</summary>
     <description>TODO: Add a description for enabled-brailled-text-attributes key.</description>
   </key>
-  <key name="text-attributes-braille-indicator" type="i">
+  <key name="braille-indicator-attrib" type="i">
     <default>0</default>
-    <summary>TODO: Add a summary for text-attributes-braille-indicator key</summary>
-    <description>TODO: Add a description for text-attributes-braille-indicator key.</description>
+    <summary>TODO: Add a summary for braille-indicator-attrib key</summary>
+    <description>TODO: Add a description for braille-indicator-attrib key.</description>
   </key>
   <key name="braille-rolename-style" type="i">
     <default>1</default>
@@ -409,10 +409,10 @@
     <summary>TODO: Add a summary for read-table-cell-row key</summary>
     <description>TODO: Add a description for read-table-cell-row key.</description>
   </key>
-  <key name="speak-multi-case-strings-as-words" type="b">
+  <key name="speech-split-multi-case" type="b">
     <default>false</default>
-    <summary>TODO: Add a summary for speak-multi-case-strings-as-words key</summary>
-    <description>TODO: Add a description for speak-multi-case-strings-as-words key.</description>
+    <summary>TODO: Add a summary for speech-split-multi-case key</summary>
+    <description>TODO: Add a description for speech-split-multi-case key.</description>
   </key>
   <key name="message-verbosity-level" type="i">
     <default>1</default>
diff --git a/src/orca/braille.py b/src/orca/braille.py
index 845c432..f803343 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -732,7 +732,7 @@ class Text(Region):
         lineEndOffset = self.lineOffset + stringLength
         regionMask = [settings.TEXT_ATTR_BRAILLE_NONE]*stringLength
 
-        attrIndicator = settings.textAttributesBrailleIndicator
+        attrIndicator = settings.brailleIndicatorAttrib
         selIndicator = settings.brailleSelectorIndicator
         linkIndicator = settings.brailleLinkIndicator
         script = orca_state.activeScript
diff --git a/src/orca/mag.py b/src/orca/mag.py
index ca1991f..7a1cae1 100644
--- a/src/orca/mag.py
+++ b/src/orca/mag.py
@@ -756,8 +756,8 @@ def __setupZoomer(restore=None):
     setZoomerMagFactor(value, value, False)
 
     value = restore.get(
-        'enableMagZoomerColorInversion',
-        _settingsManager.getSetting('enableMagZoomerColorInversion'))
+        'enableMagColorInversion',
+        _settingsManager.getSetting('enableMagColorInversion'))
     setZoomerColorInversion(value, False)
 
     brightness = restore.get(
@@ -1559,7 +1559,7 @@ def toggleColorEnhancements(script=None, inputEvent=None):
     #
     [levelX, levelY] = _zoomer.getMagFactor()
     
-    normal = {'enableMagZoomerColorInversion': False,
+    normal = {'enableMagColorInversion': False,
               'magBrightnessLevelRed': 0,
               'magBrightnessLevelGreen': 0,
               'magBrightnessLevelBlue': 0,
@@ -1749,7 +1749,7 @@ def cycleZoomerType(script=None, inputEvent=None):
 
     if not orca_state.colorEnhancementsEnabled:
         toRestore.update(\
-            {'enableMagZoomerColorInversion': False,
+            {'enableMagColorInversion': False,
              'magBrightnessLevelRed': 0,
              'magBrightnessLevelGreen': 0,
              'magBrightnessLevelBlue': 0,
diff --git a/src/orca/orca-setup.ui b/src/orca/orca-setup.ui
index 844de40..51d8bfe 100644
--- a/src/orca/orca-setup.ui
+++ b/src/orca/orca-setup.ui
@@ -1443,7 +1443,7 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkCheckButton" id="speakMultiCaseStringsAsWordsCheckButton">
+                                  <object class="GtkCheckButton" id="speechSplitMultiCaseCheckButton">
                                     <property name="label" translatable="yes" comments="Translators: multicase strings are StringsWithWordsMashedTogetherLikeThis.">Speak multicase strings as wor_ds</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index b76433a..3f9ae2a 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -1631,8 +1631,8 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
 
         self.get_widget("speakBlankLinesCheckButton").set_active(\
             prefs["speakBlankLines"])
-        self.get_widget("speakMultiCaseStringsAsWordsCheckButton").set_active(\
-            prefs["speakMultiCaseStringsAsWords"])
+        self.get_widget("speechSplitMultiCaseCheckButton").set_active(\
+            prefs["speechSplitMultiCase"])
         self.get_widget("enableTutorialMessagesCheckButton").set_active(\
             prefs["enableTutorialMessages"])
 
@@ -2090,7 +2090,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
 
         # Get the 'Invert Colors' preference and set the checkbox accordingly.
         #
-        value = prefs["enableMagZoomerColorInversion"]
+        value = prefs["enableMagColorInversion"]
         self.get_widget("magInvertColorsCheckBox").set_active(value)
 
         # Get the mouse tracking preference and set the active value for
@@ -2176,7 +2176,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         #
         self._createTextAttributesTreeView()
 
-        brailleIndicator = prefs["textAttributesBrailleIndicator"]
+        brailleIndicator = prefs["brailleIndicatorAttrib"]
         if brailleIndicator == settings.TEXT_ATTR_BRAILLE_7:
             self.get_widget("textBraille7Button").set_active(True)
         elif brailleIndicator == settings.TEXT_ATTR_BRAILLE_8:
@@ -3019,7 +3019,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
            toggled the text attributes braille indicator value. If this signal
            was generated as the result of a radio button getting selected
            (as opposed to a radio button losing the selection), set the
-           'textAttributesBrailleIndicator' preference to the new value.
+           'brailleIndicatorAttrib' preference to the new value.
 
         Arguments:
         - widget: the component that generated the signal.
@@ -3032,24 +3032,24 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
             # corner will be used to 'underline' text of interest.
             #
             if widget.get_label() == _("Dot _7"):
-                self.prefsDict["textAttributesBrailleIndicator"] = \
+                self.prefsDict["brailleIndicatorAttrib"] = \
                     settings.TEXT_ATTR_BRAILLE_7
             # Translators: If the user chooses this setting, the
             # dot in the bottom right corner of the braille cell
             # will be used to 'underline' text of interest.
             #
             elif widget.get_label() == _("Dot _8"):
-                self.prefsDict["textAttributesBrailleIndicator"] = \
+                self.prefsDict["brailleIndicatorAttrib"] = \
                     settings.TEXT_ATTR_BRAILLE_8
             # Translators: If the user chooses this setting, the
             # two dots at the bottom of the braille cell will be
             # used to 'underline' text of interest.
             #
             elif widget.get_label() == _("Dots 7 an_d 8"):
-                self.prefsDict["textAttributesBrailleIndicator"] = \
+                self.prefsDict["brailleIndicatorAttrib"] = \
                     settings.TEXT_ATTR_BRAILLE_BOTH
             else:
-                self.prefsDict["textAttributesBrailleIndicator"] = \
+                self.prefsDict["brailleIndicatorAttrib"] = \
                     settings.TEXT_ATTR_BRAILLE_NONE
 
     def punctuationLevelChanged(self, widget):
@@ -3980,7 +3980,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         """Signal handler for the "toggled" signal for the
            magCrossHairOnOffCheckButton GtkCheckButton widget.
            The user has [un]checked the magnification 'Invert Colors'
-           checkbox. Set the 'enableMagZoomerColorInversion' preference
+           checkbox. Set the 'enableMagColorInversion' preference
            to the new value.
 
         Arguments:
@@ -3990,7 +3990,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         value = widget.get_active()
         if self.enableLiveUpdating and widget.is_focus():
             mag.setZoomerColorInversion(value)
-        self.prefsDict["enableMagZoomerColorInversion"] = value
+        self.prefsDict["enableMagColorInversion"] = value
 
     def keyModifiedToggle(self, cell, path, model, col):
         """When the user changes a checkbox field (boolean field)"""
diff --git a/src/orca/orca_prefs.py b/src/orca/orca_prefs.py
index ad67a08..9cdf308 100644
--- a/src/orca/orca_prefs.py
+++ b/src/orca/orca_prefs.py
@@ -802,7 +802,7 @@ class OrcaPrefs:
                 value = self._getSpokenTextAttributesString(prefsDict[key])
             elif key == "enabledBrailledTextAttributes":
                 value = self._getBrailledTextAttributesString(prefsDict[key])
-            elif key == "textAttributesBrailleIndicator":
+            elif key == "brailleIndicatorAttrib":
                 value = self._getTextAttributesBrailleIndicatorString( \
                                                               prefsDict[key])
             elif key == "progressBarVerbosity":
diff --git a/src/orca/settings.py b/src/orca/settings.py
index 4e25a0f..abb12a3 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -140,7 +140,7 @@ userCustomizableSettings = [
     "enableMagZoomerBorder",
     "magZoomerBorderSize",
     "magZoomerBorderColor",
-    "enableMagZoomerColorInversion",
+    "enableMagColorInversion",
     "magBrightnessLevel",
     "magBrightnessLevelRed",
     "magBrightnessLevelBlue",
@@ -166,10 +166,10 @@ userCustomizableSettings = [
     "sayAllStyle",
     "keyboardLayout",
     "speakBlankLines",
-    "speakMultiCaseStringsAsWords",
+    "speechSplitMultiCase",
     "enabledSpokenTextAttributes",
     "enabledBrailledTextAttributes",
-    "textAttributesBrailleIndicator",
+    "brailleIndicatorAttrib",
     "enableProgressBarUpdates",
     "profile",
     "progressBarUpdateInterval",
@@ -534,7 +534,7 @@ magZoomerBorderColor             = '#000000'
 
 # If True, invert the magnification zoomer colors.
 #
-enableMagZoomerColorInversion    = False
+enableMagColorInversion    = False
 
 # The brightness levels.  The range is from -1 to 1, with 0
 # being "normal"/no change.
@@ -732,7 +732,7 @@ speakBlankLines         = True
 
 # if True, process multi case strings as words.
 #
-speakMultiCaseStringsAsWords = False
+speechSplitMultiCase = False
 
 # If True, reads all the table cells in the current row rather than just
 # the current one.
@@ -804,7 +804,7 @@ enabledBrailledTextAttributes = \
     "strikethrough:false; justification:left; style:normal; " \
     "text-spelling:none;"
 
-# Text Attributes Braille Indicator (see textAttributesBrailleIndicator).
+# Text Attributes Braille Indicator (see brailleIndicatorAttrib).
 # The values represent the character to be used in the attrOr
 # field of brlAPI's writeStruct.
 #
@@ -812,7 +812,7 @@ TEXT_ATTR_BRAILLE_NONE = 0x00 # 00000000
 TEXT_ATTR_BRAILLE_7    = 0x40 # 01000000
 TEXT_ATTR_BRAILLE_8    = 0x80 # 10000000
 TEXT_ATTR_BRAILLE_BOTH = 0xc0 # 11000000
-textAttributesBrailleIndicator = TEXT_ATTR_BRAILLE_NONE
+brailleIndicatorAttrib = TEXT_ATTR_BRAILLE_NONE
 
 # The limit to enable a repeat character count to be spoken.
 # If set to 0, then there will be no repeat character count.
diff --git a/src/orca/speech.py b/src/orca/speech.py
index 56de03d..708320c 100644
--- a/src/orca/speech.py
+++ b/src/orca/speech.py
@@ -163,11 +163,11 @@ def sayAll(utteranceIterator, progressCallback):
 def _speak(text, acss, interrupt):
     """Speaks the individual string using the given ACSS."""
 
-    if settings.speakMultiCaseStringsAsWords:
+    if settings.speechSplitMultiCase:
         text = _processMultiCaseString(text)
     if orca_state.activeScript and orca_state.usePronunciationDictionary:
         text = orca_state.activeScript.utilities.adjustForPronunciation(text)
-    if settings.speakMultiCaseStringsAsWords:
+    if settings.speechSplitMultiCase:
         text = _processMultiCaseString(text)
 
     logLine = "SPEECH OUTPUT: '" + text + "'"
diff --git a/test/harness/user-settings.conf.in b/test/harness/user-settings.conf.in
index c43b79e..0fe999f 100644
--- a/test/harness/user-settings.conf.in
+++ b/test/harness/user-settings.conf.in
@@ -41,7 +41,7 @@
         "magZoomerBorderSize": 1, 
         "brailleAlignmentStyle": 0, 
         "enableEchoByWord": false, 
-        "enableMagZoomerColorInversion": false, 
+        "enableMagColorInversion": false, 
         "magCursorSize": 32, 
         "magSmoothingMode": 0, 
         "magZoomerLeft": 1200, 
@@ -61,14 +61,14 @@
         "enableSpeech": true, 
         "enableBraille": false, 
         "chatAnnounceBuddyTyping": false, 
-        "speakMultiCaseStringsAsWords": false, 
+        "speechSplitMultiCase": false, 
         "enableBrailleGrouping": false, 
         "readTableCellRow": true, 
         "activeProfile": [
             "Default", 
             "default"
         ], 
-        "textAttributesBrailleIndicator": 0, 
+        "brailleIndicatorAttrib": 0, 
         "enableMagCursorExplicitSize": false, 
         "messageVerbosityLevel": 1, 
         "enableMagLiveUpdating": true, 
diff --git a/test/keystrokes/firefox/sayAll_bug-591351-1.settings b/test/keystrokes/firefox/sayAll_bug-591351-1.settings
index d05738a..6ce4a6f 100644
--- a/test/keystrokes/firefox/sayAll_bug-591351-1.settings
+++ b/test/keystrokes/firefox/sayAll_bug-591351-1.settings
@@ -41,7 +41,7 @@
         "magZoomerBorderSize": 1, 
         "brailleAlignmentStyle": 0, 
         "enableEchoByWord": false, 
-        "enableMagZoomerColorInversion": false, 
+        "enableMagColorInversion": false, 
         "magCursorSize": 32, 
         "magSmoothingMode": 0, 
         "magZoomerLeft": 1200, 
@@ -61,14 +61,14 @@
         "enableSpeech": true, 
         "enableBraille": false, 
         "chatAnnounceBuddyTyping": false, 
-        "speakMultiCaseStringsAsWords": false, 
+        "speechSplitMultiCase": false, 
         "enableBrailleGrouping": false, 
         "readTableCellRow": true, 
         "activeProfile": [
             "Default", 
             "default"
         ], 
-        "textAttributesBrailleIndicator": 0, 
+        "brailleIndicatorAttrib": 0, 
         "enableMagCursorExplicitSize": false, 
         "messageVerbosityLevel": 1, 
         "enableMagLiveUpdating": true, 
diff --git a/test/keystrokes/gtk-demo/spoken_indentation.settings b/test/keystrokes/gtk-demo/spoken_indentation.settings
index b795f4c..41007f4 100644
--- a/test/keystrokes/gtk-demo/spoken_indentation.settings
+++ b/test/keystrokes/gtk-demo/spoken_indentation.settings
@@ -41,7 +41,7 @@
         "magZoomerBorderSize": 1, 
         "brailleAlignmentStyle": 0, 
         "enableEchoByWord": false, 
-        "enableMagZoomerColorInversion": false, 
+        "enableMagColorInversion": false, 
         "magCursorSize": 32, 
         "magSmoothingMode": 0, 
         "magZoomerLeft": 1200, 
@@ -61,14 +61,14 @@
         "enableSpeech": true, 
         "enableBraille": false, 
         "chatAnnounceBuddyTyping": false, 
-        "speakMultiCaseStringsAsWords": false, 
+        "speechSplitMultiCase": false, 
         "enableBrailleGrouping": false, 
         "readTableCellRow": true, 
         "activeProfile": [
             "Default", 
             "default"
         ], 
-        "textAttributesBrailleIndicator": 0, 
+        "brailleIndicatorAttrib": 0, 
         "enableMagCursorExplicitSize": false, 
         "messageVerbosityLevel": 1, 
         "enableMagLiveUpdating": true, 



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