[orca] Fix for bgo#618806 - WhereAmI in Thunderbird presents the full message text when a message is editab



commit b73a3ade06869716abfd0d3b1a7d822f67ce234e
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun May 16 15:38:55 2010 -0400

    Fix for bgo#618806 - WhereAmI in Thunderbird presents the full message text when a message is editable

 src/orca/scripts/apps/Thunderbird/Makefile.am   |    1 +
 src/orca/scripts/apps/Thunderbird/formatting.py |   54 +++++++++++++++++++++++
 src/orca/scripts/apps/Thunderbird/script.py     |    5 ++
 3 files changed, 60 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/Thunderbird/Makefile.am b/src/orca/scripts/apps/Thunderbird/Makefile.am
index 12d8979..df484e3 100644
--- a/src/orca/scripts/apps/Thunderbird/Makefile.am
+++ b/src/orca/scripts/apps/Thunderbird/Makefile.am
@@ -2,6 +2,7 @@ orca_pathdir=$(pyexecdir)
 
 orca_python_PYTHON = \
 	__init__.py \
+	formatting.py \
 	script.py \
 	script_settings.py \
 	script_utilities.py \
diff --git a/src/orca/scripts/apps/Thunderbird/formatting.py b/src/orca/scripts/apps/Thunderbird/formatting.py
new file mode 100644
index 0000000..2815eb2
--- /dev/null
+++ b/src/orca/scripts/apps/Thunderbird/formatting.py
@@ -0,0 +1,54 @@
+# Orca
+#
+# Copyright 2010 Joanmarie Diggs.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA  02110-1301 USA.
+
+"""Custom formatting for Thunderbird."""
+
+__id__ = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2010 Joanmarie Diggs."
+__license__   = "LGPL"
+
+# pylint: disable-msg=C0301
+
+import copy
+import pyatspi
+
+import orca.formatting
+
+formatting = {
+    'speech': {
+        pyatspi.ROLE_DOCUMENT_FRAME: {
+            'basicWhereAmI': 'label + readOnly + textRole + textContent + anyTextSelection + ' + orca.formatting.MNEMONIC,
+            'detailedWhereAmI': 'label + readOnly + textRole + textContentWithAttributes + anyTextSelection + ' + orca.formatting.MNEMONIC + ' + ' + orca.formatting.TUTORIAL
+            },
+        }
+    }
+
+class Formatting(orca.formatting.Formatting):
+    def __init__(self, script):
+        orca.formatting.Formatting.__init__(self, script)
+        self.update(copy.deepcopy(formatting))
+        self._defaultFormatting = orca.formatting.Formatting(script)
+
+    def getFormat(self, **args):
+        if args.get('useDefaultFormatting', False):
+            return self._defaultFormatting.getFormat(**args)
+        else:
+            return orca.formatting.Formatting.getFormat(self, **args)
diff --git a/src/orca/scripts/apps/Thunderbird/script.py b/src/orca/scripts/apps/Thunderbird/script.py
index 0fedbea..c8e2ec6 100644
--- a/src/orca/scripts/apps/Thunderbird/script.py
+++ b/src/orca/scripts/apps/Thunderbird/script.py
@@ -39,6 +39,7 @@ import orca.scripts.toolkits.Gecko as Gecko
 
 from orca.orca_i18n import _
 
+from formatting import Formatting
 from speech_generator import SpeechGenerator
 from script_utilities import Utilities
 import script_settings
@@ -85,6 +86,10 @@ class Script(Gecko.Script):
 
         self.textArea = None
 
+    def getFormatting(self):
+        """Returns the formatting strings for this script."""
+        return Formatting(self)
+
     def getSpeechGenerator(self):
         """Returns the speech generator for this script."""
 



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