Esempio n. 1
0
	def _handleProfileSwitch(self):
		if not self._shouldHandleProfileSwitch:
			self._pendingHandleProfileSwitch = True
			return
		init = self.rootSection is None
		# Reset the cache.
		self.rootSection = AggregatedSection(self, (), self.spec, self.profiles)
		if init:
			# We're still initialising, so don't notify anyone about this change.
			return
		import synthDriverHandler
		synthDriverHandler.handleConfigProfileSwitch()
		import braille
		braille.handler.handleConfigProfileSwitch()
		import audioDucking
		audioDucking.handleConfigProfileSwitch()
Esempio n. 2
0
	def _handleProfileSwitch(self):
		if not self._shouldHandleProfileSwitch:
			self._pendingHandleProfileSwitch = True
			return
		init = self.rootSection is None
		# Reset the cache.
		self.rootSection = AggregatedSection(self, (), self.spec, self.profiles)
		if init:
			# We're still initialising, so don't notify anyone about this change.
			return
		import synthDriverHandler
		synthDriverHandler.handleConfigProfileSwitch()
		import braille
		braille.handler.handleConfigProfileSwitch()
		import audioDucking
		audioDucking.handleConfigProfileSwitch()
Esempio n. 3
0
def resetConfiguration(factoryDefaults=False):
    """Loads the configuration, installs the correct language support and initialises audio so that it will use the configured synth and speech settings.
	"""
    import config
    import braille
    import brailleInput
    import speech
    import languageHandler
    import inputCore
    log.debug("Terminating braille")
    braille.terminate()
    log.debug("Terminating brailleInput")
    brailleInput.terminate()
    log.debug("terminating speech")
    speech.terminate()
    log.debug("terminating addonHandler")
    addonHandler.terminate()
    log.debug("Reloading config")
    config.conf.reset(factoryDefaults=factoryDefaults)
    logHandler.setLogLevelFromConfig()
    #Language
    lang = config.conf["general"]["language"]
    log.debug("setting language to %s" % lang)
    languageHandler.setLanguage(lang)
    # Addons
    addonHandler.initialize()
    #Speech
    log.debug("initializing speech")
    speech.initialize()
    #braille
    log.debug("Initializing brailleInput")
    brailleInput.initialize()
    log.debug("Initializing braille")
    braille.initialize()
    log.debug("Reloading user and locale input gesture maps")
    inputCore.manager.loadUserGestureMap()
    inputCore.manager.loadLocaleGestureMap()
    import audioDucking
    if audioDucking.isAudioDuckingSupported():
        audioDucking.handleConfigProfileSwitch()
    log.info("Reverted to saved configuration")
Esempio n. 4
0
def resetConfiguration(factoryDefaults=False):
	"""Loads the configuration, installs the correct language support and initialises audio so that it will use the configured synth and speech settings.
	"""
	import config
	import braille
	import brailleInput
	import speech
	import languageHandler
	import inputCore
	log.debug("Terminating braille")
	braille.terminate()
	log.debug("Terminating brailleInput")
	brailleInput.terminate()
	log.debug("terminating speech")
	speech.terminate()
	log.debug("terminating addonHandler")
	addonHandler.terminate()
	log.debug("Reloading config")
	config.conf.reset(factoryDefaults=factoryDefaults)
	logHandler.setLogLevelFromConfig()
	#Language
	lang = config.conf["general"]["language"]
	log.debug("setting language to %s"%lang)
	languageHandler.setLanguage(lang)
	# Addons
	addonHandler.initialize()
	#Speech
	log.debug("initializing speech")
	speech.initialize()
	#braille
	log.debug("Initializing brailleInput")
	brailleInput.initialize()
	log.debug("Initializing braille")
	braille.initialize()
	log.debug("Reloading user and locale input gesture maps")
	inputCore.manager.loadUserGestureMap()
	inputCore.manager.loadLocaleGestureMap()
	import audioDucking
	if audioDucking.isAudioDuckingSupported():
		audioDucking.handleConfigProfileSwitch()
	log.info("Reverted to saved configuration")