예제 #1
0
    def onWindowCreate(self, event):
        """Called whenever a window is created in the notify-osd
        application.

        Arguments:
        - event: the Event.
        """
        try:
            ivalue = event.source.queryValue()
            value = ivalue.currentValue
        except NotImplementedError:
            value = -1
            
        utterances = []
        message = ""
        if value < 0:
            # Translators: This denotes a notification to the user of some sort.
            #
            utterances.append(_('Notification'))
            utterances.append(self.voices.get(settings.SYSTEM_VOICE))
            message = '%s %s' % (event.source.name, event.source.description)
            utterances.append(message)
            utterances.append(self.voices.get(settings.DEFAULT_VOICE))
        else:
            # A gauge notification, e.g. the Ubuntu volume notification that
            # appears when you press the multimedia keys.
            #
            message = '%s %d' % (event.source.name, value)
            utterances.append(message)
            utterances.append(self.voices.get(settings.SYSTEM_VOICE))

        speech.speak(utterances, None, True)
        self.displayBrailleMessage(message, flashTime=settings.brailleFlashTime)
        notification_messages.saveMessage(message)
예제 #2
0
파일: script.py 프로젝트: h4ck3rm1k3/orca
    def onNameChanged(self, event):
        """Callback for object:property-change:accessible-name events."""

        try:
            ivalue = event.source.queryValue()
            value = ivalue.currentValue
        except NotImplementedError:
            value = -1

        utterances = []
        message = ""
        if value < 0:
            utterances.append(messages.NOTIFICATION)
            utterances.append(self.voices.get(settings.SYSTEM_VOICE))
            message = '%s %s' % (event.source.name, event.source.description)
            utterances.append(message)
            utterances.append(self.voices.get(settings.DEFAULT_VOICE))
        else:
            # A gauge notification, e.g. the Ubuntu volume notification that
            # appears when you press the multimedia keys.
            #
            message = '%s %d' % (event.source.name, value)
            utterances.append(message)
            utterances.append(self.voices.get(settings.SYSTEM_VOICE))

        speech.speak(utterances, None, True)
        self.displayBrailleMessage(
            message, flashTime=settings.brailleFlashTime)
        notification_messages.saveMessage(message)
예제 #3
0
    def onNameChanged(self, event):
        """Callback for object:property-change:accessible-name events."""

        try:
            ivalue = event.source.queryValue()
            value = ivalue.currentValue
        except NotImplementedError:
            value = -1

        utterances = []
        message = ""
        if value < 0:
            utterances.append(messages.NOTIFICATION)
            utterances.append(self.voices.get(settings.SYSTEM_VOICE))
            message = '%s %s' % (event.source.name, event.source.description)
            utterances.append(message)
            utterances.append(self.voices.get(settings.DEFAULT_VOICE))
        else:
            # A gauge notification, e.g. the Ubuntu volume notification that
            # appears when you press the multimedia keys.
            #
            message = '%s %d' % (event.source.name, value)
            utterances.append(message)
            utterances.append(self.voices.get(settings.SYSTEM_VOICE))

        speech.speak(utterances, None, True)
        self.displayBrailleMessage(message,
                                   flashTime=settings.brailleFlashTime)
        notification_messages.saveMessage(message)
예제 #4
0
파일: script.py 프로젝트: GNOME/orca
    def onWindowCreated(self, event):
        """Callback for window:create accessibility events."""

        hasRole = lambda x: x and x.getRole() == pyatspi.ROLE_LABEL
        allLabels = pyatspi.findAllDescendants(event.source, hasRole)
        texts = [self.utilities.displayedText(acc) for acc in allLabels]
        text = "%s %s" % (messages.NOTIFICATION, " ".join(texts))
        speech.speak(text, None, True)
        self.displayBrailleMessage(text, flashTime=settings.brailleFlashTime)
        notification_messages.saveMessage(text)
예제 #5
0
    def onWindowCreated(self, event):
        """Callback for window:create accessibility events."""

        hasRole = lambda x: x and x.getRole() == pyatspi.ROLE_LABEL
        allLabels = pyatspi.findAllDescendants(event.source, hasRole)
        texts = [self.utilities.displayedText(acc) for acc in allLabels]
        text = '%s %s' % (messages.NOTIFICATION, ' '.join(texts))
        speech.speak(text, None, True)
        self.displayBrailleMessage(text, flashTime=settings.brailleFlashTime)
        notification_messages.saveMessage(text)