Beispiel #1
0
 def SetNewConfigValues (self):
  config.main['languages']['current'] = i18n.lang_from_printable_language(self.languages.language.GetValue())
  config.main['speech']['screenreader'] = self.speech.screenReader.GetValue()
  logging.info("Screen reader set to: %s" % config.main['speech']['screenreader'])
  config.main['speech']['rate'] = self.speech.SAPIRate.GetValue()
  logging.info("SAPI speech rate set to: %d" % config.main['speech']['rate'])
  config.main['speech']['volume'] = self.speech.SAPIVolume.GetValue()
  logging.info("SAPI volume set to: %d "% config.main['speech']['volume'])
  try:
   config.main['speech']['voice'] = self.speech.SAPIVoice.GetValue()
   logging.info("SAPI voice set to: %s." % config.main['speech']['voice'])
  except:
   logging.exception("Error setting new SAPI voice config value.")
  config.main['recognition']['enabled'] = self.speech.EnableSpeechRecognition.GetValue()
  config.main['client']['step'] = int(self.navigation.step.GetValue()) or 5
  config.main['client']['timeStep'] = int(self.navigation.timeStepHours.GetValue()*60 + self.navigation.timeStepMins.GetValue()) or 60
  config.main['client']['undoStackSize']=int(self.navigation.undoStackSize.GetValue()) or 100
  config.main['braille']['brailleSpoken'] = self.speech.braille.GetValue()
  config.main['client']['AutoStart'] = self.misc.AutoStart.GetValue()
  logging.info("AutoStart set to: %d." % config.main['client']['AutoStart'])
  config.main['client']['AskForExit'] = self.misc.AskForExit.GetValue()
  logging.info("AskForExit set to: %d." % config.main['client']['AskForExit'])
  config.main['shortener']['urlShortener'] = self.misc.shorteners.GetValue()
  logging.info("urlShortener set to: %s" % config.main['shortener']['urlShortener'])
  config.main['AudioServices']['sndUpAPIKey'] = self.misc.sndupKey.GetValue()
  logging.info("SndUp API key set to: %s." % config.main['AudioServices']['sndUpAPIKey'])
  config.main['UI']['stdKeyHandling'] = self.misc.stdKeyHandling.GetValue()
  logging.info("stdKeyHandling set to: %d" % config.main['UI']['stdKeyHandling'])
  config.main['UI']['sendMessagesWithEnterKey'] = self.misc.sendMessagesWithEnterKey.GetValue()
  logging.info("sendMessagesWithEnterKey set to: %d" % config.main['UI']['sendMessagesWithEnterKey'])
  config.main.write()
  i18n.setup()
  output.setup()
  if hasattr(sys, 'frozen') and not global_vars.portable:
   windows.setAutoStart(application.name, config.main['client']['AutoStart'])
Beispiel #2
0
 def SetNewConfigValues(self):
     config.main['languages'][
         'current'] = i18n.lang_from_printable_language(
             self.languages.language.GetValue())
     config.main['speech'][
         'screenreader'] = self.speech.screenReader.GetValue()
     logging.info("Screen reader set to: %s" %
                  config.main['speech']['screenreader'])
     config.main['speech']['rate'] = self.speech.SAPIRate.GetValue()
     logging.info("SAPI speech rate set to: %d" %
                  config.main['speech']['rate'])
     config.main['speech']['volume'] = self.speech.SAPIVolume.GetValue()
     logging.info("SAPI volume set to: %d " %
                  config.main['speech']['volume'])
     try:
         config.main['speech']['voice'] = self.speech.SAPIVoice.GetValue()
         logging.info("SAPI voice set to: %s." %
                      config.main['speech']['voice'])
     except:
         logging.exception("Error setting new SAPI voice config value.")
     config.main['recognition'][
         'enabled'] = self.speech.EnableSpeechRecognition.GetValue()
     config.main['client']['step'] = int(
         self.navigation.step.GetValue()) or 5
     config.main['client']['timeStep'] = int(
         self.navigation.timeStepHours.GetValue() * 60 +
         self.navigation.timeStepMins.GetValue()) or 60
     config.main['client']['undoStackSize'] = int(
         self.navigation.undoStackSize.GetValue()) or 100
     config.main['braille']['brailleSpoken'] = self.speech.braille.GetValue(
     )
     config.main['client']['AutoStart'] = self.misc.AutoStart.GetValue()
     logging.info("AutoStart set to: %d." %
                  config.main['client']['AutoStart'])
     config.main['client']['AskForExit'] = self.misc.AskForExit.GetValue()
     logging.info("AskForExit set to: %d." %
                  config.main['client']['AskForExit'])
     config.main['shortener'][
         'urlShortener'] = self.misc.shorteners.GetValue()
     logging.info("urlShortener set to: %s" %
                  config.main['shortener']['urlShortener'])
     config.main['AudioServices'][
         'sndUpAPIKey'] = self.misc.sndupKey.GetValue()
     logging.info("SndUp API key set to: %s." %
                  config.main['AudioServices']['sndUpAPIKey'])
     config.main['UI'][
         'stdKeyHandling'] = self.misc.stdKeyHandling.GetValue()
     logging.info("stdKeyHandling set to: %d" %
                  config.main['UI']['stdKeyHandling'])
     config.main['UI'][
         'sendMessagesWithEnterKey'] = self.misc.sendMessagesWithEnterKey.GetValue(
         )
     logging.info("sendMessagesWithEnterKey set to: %d" %
                  config.main['UI']['sendMessagesWithEnterKey'])
     config.main.write()
     i18n.setup()
     output.setup()
     if hasattr(sys, 'frozen') and not global_vars.portable:
         windows.setAutoStart(application.name,
                              config.main['client']['AutoStart'])
Beispiel #3
0
	def saveSettings(self, doExit=True):
		self.GeneralPage.GetValues()
		self.OutputPage.GetValues()
		self.AlertsPage.GetValues()
		self.VerbosityPage.GetValues()
		self.UpdatesPage.GetValues()
		self.ContactsManagerPage.GetValues()
		self.AdvancedPage.GetValues()
		self.changeLanguage()
		globalVars.Hotkey.unregisterHotkeys()
		config.conf.write()
		globalVars.Hotkey.registerHotkeys()
		output.initialize()
		windows.setAutoStart(versionInfo.name, config.conf["general"]["startAppWithWindows"])
		if doExit:
			output.speak(_("Settings saved."))
			globalVars.Frame.CloseDialog(self)
			if self.needsRestart:
				self.restart()
		else:
			output.speak(_("Settings applied."))
Beispiel #4
0
 def SetNewConfigValues(self):
     config.main["languages"]["current"] = i18n.lang_from_printable_language(self.languages.language.GetValue())
     config.main["speech"]["screenreader"] = self.speech.screenReader.GetValue()
     logging.info("Screen reader set to: %s" % config.main["speech"]["screenreader"])
     config.main["speech"]["rate"] = self.speech.SAPIRate.GetValue()
     logging.info("SAPI speech rate set to: %d" % config.main["speech"]["rate"])
     config.main["speech"]["volume"] = self.speech.SAPIVolume.GetValue()
     logging.info("SAPI volume set to: %d " % config.main["speech"]["volume"])
     try:
         config.main["speech"]["voice"] = self.speech.SAPIVoice.GetValue()
         logging.info("SAPI voice set to: %s." % config.main["speech"]["voice"])
     except:
         logging.exception("Error setting new SAPI voice config value.")
     config.main["recognition"]["enabled"] = self.speech.EnableSpeechRecognition.GetValue()
     config.main["client"]["step"] = int(self.navigation.step.GetValue()) or 5
     config.main["client"]["timeStep"] = (
         int(self.navigation.timeStepHours.GetValue() * 60 + self.navigation.timeStepMins.GetValue()) or 60
     )
     config.main["client"]["undoStackSize"] = int(self.navigation.undoStackSize.GetValue()) or 100
     config.main["braille"]["brailleSpoken"] = self.braille.braille.GetValue()
     config.main["client"]["AutoStart"] = self.misc.AutoStart.GetValue()
     logging.info("AutoStart set to: %d." % config.main["client"]["AutoStart"])
     config.main["client"]["AskForExit"] = self.misc.AskForExit.GetValue()
     logging.info("AskForExit set to: %d." % config.main["client"]["AskForExit"])
     config.main["shortener"]["urlShortener"] = self.misc.shorteners.GetValue()
     logging.info("urlShortener set to: %s" % config.main["shortener"]["urlShortener"])
     config.main["AudioServices"]["service"] = self.misc.audioServices.GetValue()
     logging.info("Audio service set to: %s." % config.main["AudioServices"]["service"])
     config.main["AudioServices"]["sndUpAPIKey"] = self.misc.sndupKey.GetValue()
     logging.info("SndUp API key set to: %s." % config.main["AudioServices"]["sndUpAPIKey"])
     config.main["UI"]["stdKeyHandling"] = self.misc.stdKeyHandling.GetValue()
     logging.info("stdKeyHandling set to: %d" % config.main["UI"]["stdKeyHandling"])
     config.main["UI"]["sendMessagesWithEnterKey"] = self.misc.sendMessagesWithEnterKey.GetValue()
     logging.info("sendMessagesWithEnterKey set to: %d" % config.main["UI"]["sendMessagesWithEnterKey"])
     config.main.write()
     i18n.setup()
     output.setup()
     # sessions.current_session.interface.ShowGui()
     if hasattr(sys, "frozen") and not global_vars.portable:
         windows.setAutoStart(application.name, config.main["client"]["AutoStart"])
Beispiel #5
0
 def saveSettings(self, doExit=True):
     self.GeneralPage.GetValues()
     self.OutputPage.GetValues()
     self.AlertsPage.GetValues()
     self.VerbosityPage.GetValues()
     self.UpdatesPage.GetValues()
     self.ContactsManagerPage.GetValues()
     self.AdvancedPage.GetValues()
     self.changeLanguage()
     globalVars.Hotkey.unregisterHotkeys()
     config.conf.write()
     globalVars.Hotkey.registerHotkeys()
     output.initialize()
     windows.setAutoStart(versionInfo.name,
                          config.conf["general"]["startAppWithWindows"])
     if doExit:
         output.speak(_("Settings saved."))
         globalVars.Frame.CloseDialog(self)
         if self.needsRestart:
             self.restart()
     else:
         output.speak(_("Settings applied."))