3
# Copyright 2004-2007 Sun Microsystems Inc.
5
# This library is free software; you can redistribute it and/or
6
# modify it under the terms of the GNU Library General Public
7
# License as published by the Free Software Foundation; either
8
# version 2 of the License, or (at your option) any later version.
10
# This library is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# Library General Public License for more details.
15
# You should have received a copy of the GNU Library General Public
16
# License along with this library; if not, write to the
17
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
# Boston, MA 02111-1307, USA.
20
""" Custom script for The notification daemon.
26
__copyright__ = "Copyright (c) 2005-2007 Sun Microsystems Inc."
29
import orca.orca as orca
30
import orca.default as default
31
import orca.debug as debug
32
import orca.settings as settings
33
import orca.speech as speech
34
import orca.rolenames as rolenames
36
from orca.orca_i18n import _
38
########################################################################
40
# The notification-daemon script class. #
42
########################################################################
44
class Script(default.Script):
45
def getListeners(self):
46
"""Sets up the AT-SPI event listeners for this script.
48
listeners = default.Script.getListeners(self)
50
listeners["window:create"] = \
55
def onWindowCreate(self, event):
56
"""Called whenever a window is created in the notification-daemon
62
a = self.findByRole(event.source, rolenames.ROLE_LABEL)
63
texts = [self.getDisplayedText(acc) for acc in a]
64
# Translators: This denotes a notification to the user of some sort.
66
text = _('Notification %s') % ' '.join(texts)
67
speech.speak(text, None, True)