[orca] Prevent Orca from constantly saying "not selected" in gnome-documents



commit 3fce6d9cabb5c1316d1bac91095488d91bb58c67
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Aug 21 11:49:07 2013 -0400

    Prevent Orca from constantly saying "not selected" in gnome-documents

 configure.ac                                       |    1 +
 src/orca/scripts/apps/Makefile.am                  |    1 +
 src/orca/scripts/apps/__init__.py                  |    1 +
 src/orca/scripts/apps/gnome-documents/Makefile.am  |    8 +++
 src/orca/scripts/apps/gnome-documents/__init__.py  |   23 ++++++++++
 src/orca/scripts/apps/gnome-documents/script.py    |   46 ++++++++++++++++++++
 .../apps/gnome-documents/speech_generator.py       |   40 +++++++++++++++++
 7 files changed, 120 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 468fe76..545cad7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,7 @@ src/orca/scripts/apps/gcalctool/Makefile
 src/orca/scripts/apps/gdmlogin/Makefile
 src/orca/scripts/apps/gdm-simple-greeter/Makefile
 src/orca/scripts/apps/gedit/Makefile
+src/orca/scripts/apps/gnome-documents/Makefile
 src/orca/scripts/apps/gnome_segv2/Makefile
 src/orca/scripts/apps/gnome-keyring-ask/Makefile
 src/orca/scripts/apps/gnome-mud/Makefile
diff --git a/src/orca/scripts/apps/Makefile.am b/src/orca/scripts/apps/Makefile.am
index 0605329..77e5472 100644
--- a/src/orca/scripts/apps/Makefile.am
+++ b/src/orca/scripts/apps/Makefile.am
@@ -12,6 +12,7 @@ SUBDIRS = \
        gdm-simple-greeter \
        gedit \
        gnome_segv2 \
+       gnome-documents \
        gnome-keyring-ask \
        gnome-mud \
        gnome-panel \
diff --git a/src/orca/scripts/apps/__init__.py b/src/orca/scripts/apps/__init__.py
index 34bfc03..44e98b0 100644
--- a/src/orca/scripts/apps/__init__.py
+++ b/src/orca/scripts/apps/__init__.py
@@ -9,6 +9,7 @@ __all__ = ['Banshee',
            'gcalctool',
            'gdmlogin',
            'gedit',
+           'gnome-documents',
            'gnome-keyring-ask',
            'gnome-mud',
            'gnome-panel',
diff --git a/src/orca/scripts/apps/gnome-documents/Makefile.am 
b/src/orca/scripts/apps/gnome-documents/Makefile.am
new file mode 100644
index 0000000..fa16aa9
--- /dev/null
+++ b/src/orca/scripts/apps/gnome-documents/Makefile.am
@@ -0,0 +1,8 @@
+orca_pathdir=$(pyexecdir)
+
+orca_python_PYTHON = \
+       __init__.py \
+       script.py \
+       speech_generator.py
+
+orca_pythondir=$(pyexecdir)/orca/scripts/apps/gnome-documents
diff --git a/src/orca/scripts/apps/gnome-documents/__init__.py 
b/src/orca/scripts/apps/gnome-documents/__init__.py
new file mode 100644
index 0000000..9ec22d1
--- /dev/null
+++ b/src/orca/scripts/apps/gnome-documents/__init__.py
@@ -0,0 +1,23 @@
+# Orca
+#
+# Copyright 2013 The Orca Team.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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 script for gnome-documents."""
+
+from .script import Script
+
diff --git a/src/orca/scripts/apps/gnome-documents/script.py b/src/orca/scripts/apps/gnome-documents/script.py
new file mode 100644
index 0000000..cfdc6df
--- /dev/null
+++ b/src/orca/scripts/apps/gnome-documents/script.py
@@ -0,0 +1,46 @@
+# Orca
+#
+# Copyright 2013 The Orca Team.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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 script for gnome-documents."""
+
+__id__        = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2013 The Orca Team"
+__license__   = "LGPL"
+
+import orca.scripts.default as default
+from .speech_generator import SpeechGenerator
+
+class Script(default.Script):
+
+    def __init__(self, app):
+        """Creates a new script for the given application.
+
+        Arguments:
+        - app: the application to create a script for.
+        """
+
+        default.Script.__init__(self, app)
+
+    def getSpeechGenerator(self):
+        """Returns the speech generator for this script."""
+
+        return SpeechGenerator(self)
+
diff --git a/src/orca/scripts/apps/gnome-documents/speech_generator.py 
b/src/orca/scripts/apps/gnome-documents/speech_generator.py
new file mode 100644
index 0000000..de55678
--- /dev/null
+++ b/src/orca/scripts/apps/gnome-documents/speech_generator.py
@@ -0,0 +1,40 @@
+# Orca
+#
+# Copyright 2013 The Orca Team.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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 speech generator for gnome-documents."""
+
+__id__        = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2013 The Orca Team"
+__license__   = "LGPL"
+
+import orca.speech_generator as speech_generator
+
+class SpeechGenerator(speech_generator.SpeechGenerator):
+
+    def __init__(self, script):
+        speech_generator.SpeechGenerator.__init__(self, script)
+
+    def _generateUnselectedCell(self, obj, **args):
+        # There are a number of objects in gnome-documents which claim to
+        # be selectable, but cannot actually be selected. Until we find and
+        # fix those issues, this will keep Orca from constantly tacking on
+        # "not selected" when presenting these objects.
+        return []


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