Esempio n. 1
0
#Copyright 2013-2016 Tyler Spivey, released under the GPL
import cPickle
import os
import config
import globalPluginHandler
import speech
import ui
import addonHandler
addonHandler.initTranslation()

class GlobalPlugin(globalPluginHandler.GlobalPlugin):
	scriptCategory = _("Switch Synth")

	def __init__(self, *args, **kwargs):
		super(GlobalPlugin, self).__init__(*args, **kwargs)
		self.synths = {}
		self.slot = 1
		self.load()

	def script_setSynth(self, gesture):
		self.slot = slot = int(gesture.displayName[-1])
		if slot in self.synths:
			config.conf.profiles[0]['speech'][self.synths[slot]['name']].clear()
			config.conf.profiles[0]['speech'][self.synths[slot]['name']].update(self.synths[slot]['config'])
			config.conf['speech'][self.synths[slot]['name']]._cache.clear()
			speech.setSynth(self.synths[slot]['name'])
		speech.getSynth().saveSettings()
		ui.message(str(slot))
	#Translators: Input help mode message for set synth command.
	script_setSynth.__doc__ = _("Sets the currently active synthesizer to the selected slot.")
        return

    def toggleDebugFlag():
        return


del sys.path[-1]

sharedPath = os.path.join(_curAddon.path, "shared")
sys.path.append(sharedPath)
from ww_informationDialog import InformationDialog  # noqa:E402
from ww_py3Compatibility import _unicode  # noqa:E402
from ww_addonConfigManager import _addonConfigManager  # noqa:E402
del sys.path[-1]

addonHandler.initTranslation()
_addonSummary = _unicode(_curAddon.manifest['summary'])
_scriptCategory = _addonSummary

_NVDAVersion = [version_year, version_major]


class ScriptsForMovingInTable(NVDAObjects.NVDAObject):

    _baseGestures = {
        # move to element
        "moveToNextColumn": ("kb:windows+control+rightArrow", ),
        "moveToPreviousColumn": ("kb:windows+control+leftArrow", ),
        "moveToNextRow": ("kb:windows+control+downArrow", ),
        "moveToPreviousRow": ("kb:windows+control+upArrow", ),
        "moveToFirstColumn": ("kb:windows+control+home", ),