[orca/gnome-3-18] Present newly-shown GtkInfoBars
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-18] Present newly-shown GtkInfoBars
- Date: Wed, 18 Nov 2015 23:29:46 +0000 (UTC)
commit a4fe2464fc1f5a4fdf5bf63d57bba64cc7f4a789
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Nov 18 18:26:42 2015 -0500
Present newly-shown GtkInfoBars
src/orca/scripts/apps/evince/script.py | 14 --------------
src/orca/scripts/toolkits/gtk/script.py | 15 ++++++++-------
2 files changed, 8 insertions(+), 21 deletions(-)
---
diff --git a/src/orca/scripts/apps/evince/script.py b/src/orca/scripts/apps/evince/script.py
index fc4936f..c140948 100644
--- a/src/orca/scripts/apps/evince/script.py
+++ b/src/orca/scripts/apps/evince/script.py
@@ -33,7 +33,6 @@ import orca.keybindings as keybindings
import orca.orca as orca
import orca.orca_state as orca_state
import orca.scripts.toolkits.gtk as gtk
-import orca.settings as settings
from orca.structural_navigation import StructuralNavigation
########################################################################
@@ -120,19 +119,6 @@ class Script(gtk.Script):
gtk.Script.onCaretMoved(self, event)
- def onShowingChanged(self, event):
- """Callback for object:state-changed:showing accessibility events."""
-
- obj = event.source
- if obj.getRole() == pyatspi.ROLE_ALERT and event.detail1:
- labels = self.utilities.unrelatedLabels(obj)
- message = " ".join(map(self.utilities.displayedText, labels))
- self.presentMessage(
- message, voice=self.voices.get(settings.DEFAULT_VOICE))
- return
-
- gtk.Script.onShowingChanged(self, event)
-
def onTextSelectionChanged(self, event):
"""Callback for object:text-selection-changed accessibility events."""
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 2fa5eee..40181ea 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -195,16 +195,17 @@ class Script(default.Script):
def onShowingChanged(self, event):
"""Callback for object:state-changed:showing accessibility events."""
+ if not event.detail1:
+ super().onShowingChanged(event)
+ return
+
obj = event.source
- if not self.utilities._isNonModalPopOver(obj):
- default.Script.onShowingChanged(self, event)
+ if self.utilities._isNonModalPopOver(obj) \
+ or obj.getRole() in [pyatspi.ROLE_ALERT, pyatspi.ROLE_INFO_BAR]:
+ self.presentObject(event.source)
return
- if event.detail1:
- speech.speak(self.speechGenerator.generateSpeech(obj))
- labels = self.utilities.unrelatedLabels(obj)
- msg = ' '.join(map(self.utilities.displayedText, labels))
- self.presentMessage(msg)
+ super().onShowingChanged(event)
def onTextSelectionChanged(self, event):
"""Callback for object:text-selection-changed accessibility events."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]