[orca] Prevent locusOfFocus change when navigating in SeaMonkey message list



commit 2cdc323f3d0705c6f7115872cb28104bf7f0b19b
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Apr 23 16:38:28 2016 -0400

    Prevent locusOfFocus change when navigating in SeaMonkey message list

 configure.ac                                |    1 +
 src/orca/scripts/apps/Makefile.am           |    1 +
 src/orca/scripts/apps/SeaMonkey/Makefile.am |    6 +++
 src/orca/scripts/apps/SeaMonkey/__init__.py |   23 +++++++++++
 src/orca/scripts/apps/SeaMonkey/script.py   |   57 +++++++++++++++++++++++++++
 src/orca/scripts/apps/__init__.py           |    1 +
 6 files changed, 89 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6179a93..9d9032d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,7 @@ src/orca/scripts/apps/pidgin/Makefile
 src/orca/scripts/apps/planner/Makefile
 src/orca/scripts/apps/rhythmbox/Makefile
 src/orca/scripts/apps/soffice/Makefile
+src/orca/scripts/apps/SeaMonkey/Makefile
 src/orca/scripts/apps/Thunderbird/Makefile
 src/orca/scripts/apps/xfwm4/Makefile
 src/orca/scripts/toolkits/Makefile
diff --git a/src/orca/scripts/apps/Makefile.am b/src/orca/scripts/apps/Makefile.am
index 110b7ac..c485655 100644
--- a/src/orca/scripts/apps/Makefile.am
+++ b/src/orca/scripts/apps/Makefile.am
@@ -29,6 +29,7 @@ SUBDIRS = \
        planner \
        rhythmbox \
        soffice \
+       SeaMonkey \
        Thunderbird \
        xfwm4
 
diff --git a/src/orca/scripts/apps/SeaMonkey/Makefile.am b/src/orca/scripts/apps/SeaMonkey/Makefile.am
new file mode 100644
index 0000000..afb4bd9
--- /dev/null
+++ b/src/orca/scripts/apps/SeaMonkey/Makefile.am
@@ -0,0 +1,6 @@
+orca_python_PYTHON = \
+       __init__.py \
+       script.py
+
+orca_pythondir=$(pkgpythondir)/scripts/apps/SeaMonkey
+
diff --git a/src/orca/scripts/apps/SeaMonkey/__init__.py b/src/orca/scripts/apps/SeaMonkey/__init__.py
new file mode 100644
index 0000000..6ce7e14
--- /dev/null
+++ b/src/orca/scripts/apps/SeaMonkey/__init__.py
@@ -0,0 +1,23 @@
+# Orca
+#
+# Copyright 2016 Igalia, S.L.
+#
+# 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 SeaMonkey."""
+
+from .script import Script
+
diff --git a/src/orca/scripts/apps/SeaMonkey/script.py b/src/orca/scripts/apps/SeaMonkey/script.py
new file mode 100644
index 0000000..4ec3dc7
--- /dev/null
+++ b/src/orca/scripts/apps/SeaMonkey/script.py
@@ -0,0 +1,57 @@
+# Orca
+#
+# Copyright 2016 Igalia, S.L.
+#
+# Author: Joanmarie Diggs <jdiggs igalia com>
+#
+# 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 SeaMonkey."""
+
+__id__        = "$Id$"
+__version__   = "$Revision$"
+__date__      = "$Date$"
+__copyright__ = "Copyright (c) 2016 Igalia, S.L."
+__license__   = "LGPL"
+
+import pyatspi
+
+from orca import debug
+from orca import orca_state
+from orca.scripts.toolkits import Gecko
+
+
+class Script(Gecko.Script):
+
+    def __init__(self, app):
+        super().__init__(app)
+
+    def onBusyChanged(self, event):
+        """Callback for object:state-changed:busy accessibility events."""
+
+        try:
+            focusRole = orca_state.locusOfFocus.getRole()
+        except:
+            msg = "ERROR: Exception getting role for %s" % orca_state.locusOfFocus
+            debug.println(debug.LEVEL_INFO, msg, True)
+        else:
+            if focusRole == pyatspi.ROLE_TABLE_ROW :
+                msg = "SEAMONKEY: Ignoring, locusOfFocus is %s" % orca_state.locusOfFocus
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return
+
+        super().onBusyChanged(event)
+
diff --git a/src/orca/scripts/apps/__init__.py b/src/orca/scripts/apps/__init__.py
index 2c7a8e7..38d33e9 100644
--- a/src/orca/scripts/apps/__init__.py
+++ b/src/orca/scripts/apps/__init__.py
@@ -28,5 +28,6 @@ __all__ = ['Banshee',
            'planner',
            'rhythmbox',
            'soffice',
+           'SeaMonkey',
            'Thunderbird',
            'xfwm4']


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