Example #1
0
	def onOk(self, evt):
		minDuration = ((self.minMinEntry.GetValue() * 60) + self.minSecEntry.GetValue()) * 1000
		maxDuration = ((self.maxMinEntry.GetValue() * 60) + self.maxSecEntry.GetValue()) * 1000
		# What if minimum is greater than maximum (subtle oversight)?
		if minDuration >= maxDuration:
			gui.messageBox(
				# Translators: Message to report wrong value for duration fields.
				_("Minimum duration is greater than the maximum duration."),
				translate("Error"), wx.OK|wx.ICON_ERROR,self)
			self.minMinEntry.SetFocus()
			return
		self.Destroy()
		global _findDialogOpened
		if user32.FindWindowW(u"SPLStudio", None):
			obj = self.obj.next
			# Manually locate tracks here.
			while obj is not None:
				filename = splbase.studioAPI(obj.IAccessibleChildID-1, 211)
				if minDuration <= splbase.studioAPI(filename, 30) <= maxDuration:
					break
				obj = obj.next
			if obj is not None:
				# This time, set focus once, as doing it twice causes focus problems only if using Studio 5.10 or later.
				obj.setFocus()
				# 16.11: Select the desired track manually.
				# #45 (18.02): call select track function in splbase module.
				splbase.selectTrack(obj.IAccessibleChildID-1)
			else:
				wx.CallAfter(gui.messageBox,
				# Translators: Standard dialog message when an item one wishes to search is not found (copy this from main nvda.po).
				_("No track with duration between minimum and maximum duration."),
				# Translators: Standard error title for find error (copy this from main nvda.po).
				_("Time range find error"),wx.OK|wx.ICON_ERROR)
		_findDialogOpened = False
Example #2
0
	def on_slave_connection_failed(self):
		if self.connector.successful_connects == 0:
			self.disconnect_from_slave()
			# Translators: Title of the connection error dialog.
			gui.messageBox(parent=gui.mainFrame, caption=_("Error Connecting"),
			# Translators: Message shown when cannot connect to the remote computer.
			message=_("Unable to connect to the remote computer"), style=wx.OK | wx.ICON_WARNING)
Example #3
0
	def _error(self):
		self._stopped()
		gui.messageBox(
			# Translators: A message indicating that an error occurred while downloading an update to NVDA.
			_("Error downloading update."),
			_("Error"),
			wx.OK | wx.ICON_ERROR)
Example #4
0
	def onEnableDisable(self, evt):
		index=self.addonsList.GetFirstSelected()
		if index<0: return
		addon=self.curAddons[index]
		shouldDisable = self._shouldDisable(addon)
		try:
			# Counterintuitive, but makes sense when context is taken into account.
			addon.enable(not shouldDisable)
		except addonHandler.AddonError:
			log.error("Couldn't change state for %s add-on"%addon.name, exc_info=True)
			if shouldDisable:
				# Translators: The message displayed when the add-on cannot be disabled.
				message = _("Could not disable the {description} add-on.").format(
					description=addon.manifest['summary'])
			else:
				# Translators: The message displayed when the add-on cannot be enabled.
				message = _("Could not enable the {description} add-on.").format(
					description=addon.manifest['summary'])
			gui.messageBox(
				message,
				# Translators: The title of a dialog presented when an error occurs.
				_("Error"),
				wx.OK | wx.ICON_ERROR
			)
			return

		self.enableDisableButton.SetLabel(_("&Enable add-on") if shouldDisable else _("&Disable add-on"))
		self.refreshAddonsList(activeIndex=index)
Example #5
0
def _showAddonInfo(addon):
	manifest = addon.manifest
	# Translators: message shown in the Addon Information dialog.
	message=[_(
		"{summary} ({name})\n"
		"Version: {version}\n"
		"Author: {author}\n"
		"Description: {description}\n"
	).format(**manifest)]
	url=manifest.get('url')
	if url:
		# Translators: the url part of the About Add-on information
		message.append(_("URL: {url}").format(url=url))
	minimumNVDAVersion = addonAPIVersion.formatForGUI(addon.minimumNVDAVersion)
	message.append(
		# Translators: the minimum NVDA version part of the About Add-on information
		_("Minimum required NVDA version: {}").format(minimumNVDAVersion)
	)
	lastTestedNVDAVersion = addonAPIVersion.formatForGUI(addon.lastTestedNVDAVersion)
	message.append(
		# Translators: the last NVDA version tested part of the About Add-on information
		_("Last NVDA version tested: {}").format(lastTestedNVDAVersion)
	)
	# Translators: title for the Addon Information dialog
	title=_("Add-on Information")
	gui.messageBox("\n".join(message), title, wx.OK)
Example #6
0
	def onDelete(self, evt):
		index = self.profileList.Selection
		if gui.messageBox(
			# Translators: The confirmation prompt displayed when the user requests to delete a configuration profile.
			_("This profile will be permanently deleted. This action cannot be undone."),
			# Translators: The title of the confirmation dialog for deletion of a configuration profile.
			_("Confirm Deletion"),
			wx.OK | wx.CANCEL | wx.ICON_QUESTION, self
		) != wx.OK:
			return
		name = self.profileNames[index]
		try:
			config.conf.deleteProfile(name)
		except:
			log.debugWarning("", exc_info=True)
			# Translators: An error displayed when deleting a configuration profile fails.
			gui.messageBox(_("Error deleting profile."),
				_("Error"), wx.OK | wx.ICON_ERROR, self)
			return
		del self.profileNames[index]
		self.profileList.Delete(index)
		self.profileList.SetString(0, self.getProfileDisplay(None, includeStates=True))
		self.profileList.Selection = 0
		self.onProfileListChoice(None)
		self.profileList.SetFocus()
Example #7
0
def doStartupDialogs():
    import config
    import gui

    # Translators: The title of the dialog to tell users that there are erros in the configuration file.
    if config.conf.baseConfigError:
        import wx

        gui.messageBox(
            # Translators: A message informing the user that there are errors in the configuration file.
            _(
                "Your configuration file contains errors. "
                "Your configuration has been reset to factory defaults.\n"
                "More details about the errors can be found in the log file."
            ),
            # Translators: The title of the dialog to tell users that there are errors in the configuration file.
            _("Configuration File Error"),
            wx.OK | wx.ICON_EXCLAMATION,
        )
    if config.conf["general"]["showWelcomeDialogAtStartup"]:
        gui.WelcomeDialog.run()
    import inputCore

    if inputCore.manager.userGestureMap.lastUpdateContainedError:
        import wx

        gui.messageBox(
            _("Your gesture map file contains errors.\n" "More details about the errors can be found in the log file."),
            _("gesture map File Error"),
            wx.OK | wx.ICON_EXCLAMATION,
        )
Example #8
0
File: core.py Project: bramd/nvda
def doStartupDialogs():
	import config
	import gui
	# Translators: The title of the dialog to tell users that there are erros in the configuration file.
	if config.conf.baseConfigError:
		import wx
		gui.messageBox(
			# Translators: A message informing the user that there are errors in the configuration file.
			_("Your configuration file contains errors. "
				"Your configuration has been reset to factory defaults.\n"
				"More details about the errors can be found in the log file."),
			# Translators: The title of the dialog to tell users that there are errors in the configuration file.
			_("Configuration File Error"),
			wx.OK | wx.ICON_EXCLAMATION)
	if config.conf["general"]["showWelcomeDialogAtStartup"]:
		gui.WelcomeDialog.run()
	if config.conf["speechViewer"]["showSpeechViewerAtStartup"]:
		gui.mainFrame.onToggleSpeechViewerCommand(evt=None)
	import inputCore
	if inputCore.manager.userGestureMap.lastUpdateContainedError:
		import wx
		gui.messageBox(_("Your gesture map file contains errors.\n"
				"More details about the errors can be found in the log file."),
			_("gesture map File Error"), wx.OK|wx.ICON_EXCLAMATION)
	if not globalVars.appArgs.secure and not config.isAppX and not config.conf['update']['askedAllowUsageStats']:
		gui.runScriptModalDialog(gui.AskAllowUsageStatsDialog(None))
Example #9
0
	def onRename(self, evt):
		index = self.profileList.Selection
		oldName = self.profileNames[index]
		# Translators: The label of a field to enter a new name for a configuration profile.
		with wx.TextEntryDialog(self, _("New name:"),
				# Translators: The title of the dialog to rename a configuration profile.
				_("Rename Profile"), defaultValue=oldName) as d:
			if d.ShowModal() == wx.ID_CANCEL:
				return
			newName = api.filterFileName(d.Value)
		try:
			config.conf.renameProfile(oldName, newName)
		except ValueError:
			# Translators: An error displayed when renaming a configuration profile
			# and a profile with the new name already exists.
			gui.messageBox(_("That profile already exists. Please choose a different name."),
				_("Error"), wx.OK | wx.ICON_ERROR, self)
			return
		except:
			log.debugWarning("", exc_info=True)
			gui.messageBox(_("Error renaming profile."),
				_("Error"), wx.OK | wx.ICON_ERROR, self)
			return
		self.profileNames[index] = newName
		self.profileList.SetString(index, self.getProfileDisplay(newName, includeStates=True))
		self.profileList.Selection = index
		self.profileList.SetFocus()
def saveCrash():
	message = crashDialog()
	timestamp = datetime.datetime.now().strftime("%a %d %B %Y %H-%M-%S") #colons aren't allowed in file names.
	userFriendlyTimestamp = datetime.datetime.now().strftime("%a %d %B %Y %H:%M:%S") #colons aren't allowed in file names.
	msg = message.split(" ", 5)
	#Some characters like : aren't file safe. Just remove them.
	mst = (msg[:-1] if len(msg) > 5 else msg) #It's a list and we need a string.
	msg = " ".join(msg)
	msg = re.sub(r"[^a-zA-Z0-9_ -]", "", msg)
	folderName = timestamp + " "+msg
	userDir = config.conf["crashSaver"]["dir"]
	
	#translators: the plural word for crash in your language.
	crashDir = os.path.join(userDir, _("crashes"))
	if not os.path.exists(crashDir):
		os.mkdir(crashDir)
	crashDir = os.path.join(crashDir, folderName)
	os.mkdir(crashDir)
	temp = tempfile.gettempdir()
	try:
		shutil.move(os.path.join(temp, "nvda_crash.dmp"), crashDir) #No need to check existance. See above.
	except Exception as e:
		gui.messageBox("check the log please")
		raise e
	with open(os.path.join(crashDir, "message.txt"), "w") as messageFile:
		VersionInfo().write(messageFile)
		messageFile.write("The crash occured at {0}\n".format(userFriendlyTimestamp))
		messageFile.write("User supplied message:\n\n")
		messageFile.write(message)
	gui.messageBox(crashDir, "the NVDA crash is in this directory.")
	def onOk(self, evt):
		if os.path.exists(self.edit.Value):
			config.conf["crashSaver"]["dir"] = self.edit.Value
		else:
			gui.messageBox(_("That folder doesn't exist. Enter a valid folder name."))
			return
		super(CrashSettings, self).onOk(evt)
Example #12
0
	def _showAddonInfo(self, manifest):
		# Translators: message shown in the Addon Information dialog.
		message=[_(
			"{summary} ({name})\n"
			"Version: {version}\n"
			"Author: {author}\n"
			"Description: {description}\n"
		).format(**manifest)]
		url=manifest.get('url')
		if url:
			# Translators: the url part of the About Add-on information
			message.append(_("URL: {url}").format(url=url))
		# Translators: shown when a version is unknown in the about add-on dialog
		unknownVersion = _("unknown")
		minimumNVDAVersion = manifest.get('minimumNVDAVersion', default=unknownVersion)
		message.append(
			# Translators: the minimum NVDA version part of the About Add-on information
			_("Minimum required NVDA version: {version}").format(version=minimumNVDAVersion)
		)
		lastTestedNVDAVersion = manifest.get('lastTestedNVDAVersion', unknownVersion)
		message.append(
			# Translators: the last NVDA version tested part of the About Add-on information
			_("Last NVDA version tested: {version}").format(version=lastTestedNVDAVersion)
		)
		# Translators: title for the Addon Information dialog
		title=_("Add-on Information")
		gui.messageBox("\n".join(message), title, wx.OK)
Example #13
0
def doCreatePortable(portableDirectory,copyUserConfig=False):
	d = gui.IndeterminateProgressDialog(gui.mainFrame,
		# Translators: The title of the dialog presented while a portable copy of NVDA is bieng created.
		_("Creating Portable Copy"),
		# Translators: The message displayed while a portable copy of NVDA is bieng created.
		_("Please wait while a portable copy of NVDA is created."))
	try:
		gui.ExecAndPump(installer.createPortableCopy,portableDirectory,copyUserConfig)
	except Exception as e:
		log.error("Failed to create portable copy",exc_info=True)
		d.done()
		if isinstance(e,installer.RetriableFailure):
			# Translators: a message dialog asking to retry or cancel when NVDA portable copy creation fails
			message=_("NVDA is unable to remove or overwrite a file.")
			# Translators: the title of a retry cancel dialog when NVDA portable copy creation  fails
			title=_("File in Use")
			if winUser.MessageBox(None,message,title,winUser.MB_RETRYCANCEL)==winUser.IDRETRY:
				return doCreatePortable(portableDirectory,copyUserConfig)
		# Translators: The message displayed when an error occurs while creating a portable copy of NVDA.
		# %s will be replaced with the specific error message.
		gui.messageBox(_("Failed to create portable copy: %s")%e,
			_("Error"),
			wx.OK | wx.ICON_ERROR)
		return
	d.done()
	# Translators: The message displayed when a portable copy of NVDA has been successfully created.
	# %s will be replaced with the destination directory.
	gui.messageBox(_("Successfully created a portable copy of NVDA at %s")%portableDirectory,
		_("Success"))
Example #14
0
def onInstall():
	for addon in addonHandler.getAvailableAddons():
		if addon.manifest['name'] == "EloquenceAutoLanguageSwitching":
			gui.messageBox(
				"You have an older version of Eloquence Auto Language Switching installed, it is going to be uninstalled now to avoid compatibility issues.",
				"Older version installed",
				wx.ICON_WARNING)
			addon.requestRemove()
Example #15
0
	def on_ok(self, evt):
		if self.client_or_server.GetSelection() == 0 and (not self.panel.host.GetValue() or not self.panel.key.GetValue()):
			gui.messageBox(_("Both host and key must be set."), _("Error"), wx.OK | wx.ICON_ERROR)
		elif self.client_or_server.GetSelection() == 1 and not self.panel.key.GetValue():
			gui.messageBox(_("Key must be set."), _("Error"), wx.OK | wx.ICON_ERROR)
			self.panel.key.SetFocus()
		else:
			evt.Skip()
Example #16
0
	def saveTriggers(self, parentWindow=None):
		try:
			config.conf.saveProfileTriggers()
		except:
			log.debugWarning("", exc_info=True)
			# Translators: An error displayed when saving configuration profile triggers fails.
			gui.messageBox(_("Error saving configuration profile triggers - probably read only file system."),
				_("Error"), wx.OK | wx.ICON_ERROR, parent=parentWindow)
Example #17
0
def _finderError():
	global _findDialogOpened
	if _findDialogOpened:
		# Translators: Text of the dialog when another find dialog is open.
		gui.messageBox(_("Another find dialog is open."),translate("Error"),style=wx.OK | wx.ICON_ERROR)
	else:
		# Translators: Text of the dialog when a generic error has occured.
		gui.messageBox(_("An unexpected error has occured when trying to open find dialog."),translate("Error"),style=wx.OK | wx.ICON_ERROR)
Example #18
0
	def onOk(self, evt):
		if self.noSoundsCheckBox.IsChecked() and not self.speakRolesCheckBox.IsChecked():
			gui.messageBox("Disabling both sounds and  speaking is not allowed. NVDA will not say roles like button and checkbox, and sounds won't play either. Please change one of these settings", "Error")
			return
		config.conf["unspoken"]["sayAll"] = self.sayAllCheckBox.IsChecked()
		config.conf["unspoken"]["speakRoles"] = self.speakRolesCheckBox.IsChecked()
		config.conf["unspoken"]["noSounds"] = self.noSoundsCheckBox.IsChecked()
		config.conf["unspoken"]["volumeAdjust"] = self.volumeCheckBox.IsChecked()
		super(SettingsDialog, self).onOk(evt)
Example #19
0
def doInstall(createDesktopShortcut,startOnLogon,copyPortableConfig,isUpdate,silent=False,startAfterInstall=True):
	progressDialog = gui.IndeterminateProgressDialog(gui.mainFrame,
		# Translators: The title of the dialog presented while NVDA is being updated.
		_("Updating NVDA") if isUpdate
		# Translators: The title of the dialog presented while NVDA is being installed.
		else _("Installing NVDA"),
		# Translators: The message displayed while NVDA is being updated.
		_("Please wait while your previous installation of NVDA is being updated.") if isUpdate
		# Translators: The message displayed while NVDA is being installed.
		else _("Please wait while NVDA is being installed"))
	try:
		res=config.execElevated(config.SLAVE_FILENAME,["install",str(int(createDesktopShortcut)),str(int(startOnLogon))],wait=True,handleAlreadyElevated=True)
		if res==2: raise installer.RetriableFailure
		if copyPortableConfig:
			installedUserConfigPath=config.getInstalledUserConfigPath()
			if installedUserConfigPath:
				gui.ExecAndPump(installer.copyUserConfig,installedUserConfigPath)
	except Exception as e:
		res=e
		log.error("Failed to execute installer",exc_info=True)
	progressDialog.done()
	del progressDialog
	if isinstance(res,installer.RetriableFailure):
		# Translators: a message dialog asking to retry or cancel when NVDA install fails
		message=_("The installation is unable to remove or overwrite a file. Another copy of NVDA may be running on another logged-on user account. Please make sure all installed copies of NVDA are shut down and try the installation again.")
		# Translators: the title of a retry cancel dialog when NVDA installation fails
		title=_("File in Use")
		if winUser.MessageBox(None,message,title,winUser.MB_RETRYCANCEL)==winUser.IDRETRY:
			return doInstall(createDesktopShortcut,startOnLogon,copyPortableConfig,isUpdate,silent,startAfterInstall)
	if res!=0:
		log.error("Installation failed: %s"%res)
		# Translators: The message displayed when an error occurs during installation of NVDA.
		gui.messageBox(_("The installation of NVDA failed. Please check the Log Viewer for more information."),
			# Translators: The title of a dialog presented when an error occurs.
			_("Error"),
			wx.OK | wx.ICON_ERROR)
		return
	if not silent:
		msg = (
			# Translators: The message displayed when NVDA has been successfully installed.
			_("Successfully installed NVDA. ") if not isUpdate
			# Translators: The message displayed when NVDA has been successfully updated.
			else _("Successfully updated your installation of NVDA. "))
		# Translators: The message displayed to the user after NVDA is installed
		# and the installed copy is about to be started.
		gui.messageBox(msg+_("Please press OK to start the installed copy."),
			# Translators: The title of a dialog presented to indicate a successful operation.
			_("Success"))
	if startAfterInstall:
		# #4475: ensure that the first window of the new process is not hidden by providing SW_SHOWNORMAL  
		shellapi.ShellExecute(None, None,
			os.path.join(installer.defaultInstallPath,'nvda.exe'),
			u"-r",
			None, winUser.SW_SHOWNORMAL)
	else:
		wx.GetApp().ExitMainLoop()
Example #20
0
	def onSaveAsCommand(self, evt):
		filename = wx.FileSelector(_("Save As"), default_filename="nvda.log", flags=wx.SAVE | wx.OVERWRITE_PROMPT, parent=self)
		if not filename:
			return
		try:
			# codecs.open() forces binary mode, which is bad under Windows because line endings won't be converted to crlf automatically.
			# Therefore, do the encoding manually.
			file(filename, "w").write(self.outputCtrl.GetValue().encode("UTF-8"))
		except (IOError, OSError), e:
			gui.messageBox(_("Error saving log: %s") % e.strerror, _("Error"), style=wx.OK | wx.ICON_ERROR, parent=self)
Example #21
0
	def on_ok(self, evt):
		if self.autoconnect.GetValue():
			if not self.client_or_server.GetSelection() and (not self.host.GetValue() or not self.key.GetValue()):
				gui.messageBox(_("Both host and key must be set."), _("Error"), wx.OK | wx.ICON_ERROR)
			elif self.client_or_server.GetSelection() and not self.port.GetValue() or not self.key.GetValue():
				gui.messageBox(_("Both port and key must be set."), _("Error"), wx.OK | wx.ICON_ERROR)
			else:
				evt.Skip()
		else:
			evt.Skip()
Example #22
0
 def onChangeState(self, evt):
     sel = self.profileList.Selection
     profile = self.profileNames[sel]
     if self.isProfileManual(profile):
         profile = None
     try:
         config.conf.manualActivateProfile(profile)
     except:
         # Translators: An error displayed when activating a configuration profile fails.
         gui.messageBox(_("Error activating profile."), _("Error"),
                        wx.OK | wx.ICON_ERROR, self)
         return
     self.Close()
Example #23
0
 def _downloadSuccess(self):
     self._stopped()
     # Translators: The message presented when the update has been successfully downloaded
     # and is about to be installed.
     gui.messageBox(
         _("Update downloaded. It will now be installed."),
         # Translators: The title of the dialog displayed when the update is about to be installed.
         _("Install Update"))
     state["removeFile"] = self.destPath
     saveState()
     # #4475: ensure that the new process shows its first window, by providing SW_SHOWNORMAL
     shellapi.ShellExecute(None, None, self.destPath.decode("mbcs"),
                           u"--install -m", None, winUser.SW_SHOWNORMAL)
def _onInstallMSRCommands():
	MSRPATH = os.path.expanduser(r"~\documents\speech macros")
	commandsFile = os.path.join(addonRootDir, "dictationBridge.WSRMac")
	#Translators: Official Title of Microsoft speech Recognition in your language.
	thisProgram = _("Microsoft Speech Recognition")
	if os.path.exists(MSRPATH):
		shutil.copy(commandsFile, MSRPATH)
		successDialog(thisProgram)
	else:
		#Translators: The user doesn't have microsoft speech recognition profiles, or we can't find them.
		gui.messageBox(_("Failed to locate your Microsoft Speech Macros folder. Please see the troublshooting part of the documentation for more details."),
			#Translators: Title for the microsoft speech recognitioninstalation  error dialog.
			_("Error installing MSR utilities"))
Example #25
0
	def handleRemoteAddonInstall(cls, addonPath):
		# Add-ons cannot be installed into a Windows store version of NVDA
		if config.isAppX:
			# Translators: The message displayed when an add-on cannot be installed due to NVDA running as a Windows Store app
			gui.messageBox(_("Add-ons cannot be installed in the Windows Store version of NVDA"),
				# Translators: The title of a dialog presented when an error occurs.
				_("Error"),
				wx.OK | wx.ICON_ERROR)
			return
		closeAfter = AddonsDialog._instance() is None
		dialog = AddonsDialog(gui.mainFrame)
		dialog.installAddon(addonPath, closeAfter=closeAfter)
		del dialog
Example #26
0
	def _downloadSuccess(self):
		self._stopped()
		# Translators: The message presented when the update has been successfully downloaded
		# and is about to be installed.
		gui.messageBox(_("Update downloaded. It will now be installed."),
			# Translators: The title of the dialog displayed when the update is about to be installed.
			_("Install Update"))
		state["removeFile"] = self.destPath
		saveState()
		shellapi.ShellExecute(None, None,
			self.destPath.decode("mbcs"),
			u"--install -m",
			None, 0)
Example #27
0
	def onChangeState(self, evt):
		sel = self.profileList.Selection
		profile = self.profileNames[sel]
		if self.isProfileManual(profile):
			profile = None
		try:
			config.conf.manualActivateProfile(profile)
		except:
			# Translators: An error displayed when activating a configuration profile fails.
			gui.messageBox(_("Error activating profile."),
				_("Error"), wx.OK | wx.ICON_ERROR, self)
			return
		self.Close()
Example #28
0
	def __init__(self):
		#Translators: The title of the tip of the day dialog.
		super(TipDialog, self).__init__(gui.mainFrame, wx.ID_ANY, title=_("Tip Of The Day"))
		self.panel  = panel = wx.Panel(self, wx.ID_ANY)
		mainSizer=wx.BoxSizer(wx.VERTICAL)
		tipSizer = wx.BoxSizer(wx.VERTICAL)
		self.tips  = getTips()
		if not self.tips:
			return #Critical error.
		self.index=tipConfig.conf["internal"]["index"]
		self.level = tipConfig.conf["user"]["level"]
		self.title = item = wx.StaticText(panel)
		tipSizer.Add(item)
		self.edit = item = wx.TextCtrl(panel, size = (500,500), style =  wx.TE_READONLY|wx.TE_MULTILINE)
		tipSizer.Add(item)
		mainSizer.Add(tipSizer, border=20,flag=wx.LEFT|wx.RIGHT|wx.TOP)
		buttonSizer=wx.BoxSizer(wx.HORIZONTAL)
		self.back = item = wx.Button(panel, wx.ID_BACKWARD)
		buttonSizer.Add(item)
		self.Bind(wx.EVT_BUTTON, self.onBack, item)
		item = wx.Button(panel, wx.ID_CLOSE)
		self.Bind(wx.EVT_BUTTON, self.onClose, item)
		buttonSizer.Add(item)
		self.forward = item = wx.Button(panel, wx.ID_FORWARD)
		self.Bind(wx.EVT_BUTTON, self.onForward, item)
		buttonSizer.Add(item)
		mainSizer.Add(buttonSizer,border=20,flag=wx.LEFT|wx.RIGHT|wx.BOTTOM)
		mainSizer.Fit(panel)
		self.Bind(wx.EVT_CLOSE, self.onClose)
		self.edit.Bind(wx.EVT_KEY_DOWN, self.onKeyDown)
		self.SetSizer(mainSizer)
		self.edit.SetFocus()
		self.cache = []
		self.superIndex = 0
		noShow = True
		for i in range(len(self.tips)):
			if  self.level in self.tips[i][1]["level"]:
				self.cache.append(i)
				if i == self.index:
					self.superIndex = len(self.cache)-1
					noShow = False
		# when the tips wrap, it'll reset to 0. We should notify the user the tips wrapped however.
		if noShow:
			gui.messageBox(
				#Translators: Message for when the user has seen all possible tips.
				_("You have seen all possible tips. The add-on will now show you the first tip again."),
				#Translators: The title of the dialog that shows up when the user has seen all tips.
				_("Out of Tips")				)
				
		self.prepEdit()
		self.prepButtons()
Example #29
0
 def on_ok(self, evt):
     if self.autoconnect.GetValue():
         if not self.client_or_server.GetSelection() and (
                 not self.host.GetValue() or not self.key.GetValue()):
             gui.messageBox(_("Both host and key must be set."), _("Error"),
                            wx.OK | wx.ICON_ERROR)
         elif self.client_or_server.GetSelection(
         ) and not self.port.GetValue() or not self.key.GetValue():
             gui.messageBox(_("Both port and key must be set."), _("Error"),
                            wx.OK | wx.ICON_ERROR)
         else:
             evt.Skip()
     else:
         evt.Skip()
Example #30
0
	def _downloadSuccess(self):
		self._stopped()
		# Translators: The message presented when the update has been successfully downloaded
		# and is about to be installed.
		gui.messageBox(_("Update downloaded. It will now be installed."),
			# Translators: The title of the dialog displayed when the update is about to be installed.
			_("Install Update"))
		state["removeFile"] = self.destPath
		saveState()
		# #4475: ensure that the new process shows its first window, by providing SW_SHOWNORMAL
		shellapi.ShellExecute(None, None,
			self.destPath.decode("mbcs"),
			u"--install -m",
			None, winUser.SW_SHOWNORMAL)
Example #31
0
	def checkGestures(self, gestures: base.FilteredGestures) -> None:
		"""Show a list of gestures in a separate window,
		if the gesture collection is empty, a warning is displayed.
		@param gestures: filtered collection of input gestures
		@type gestures: base.FilteredGestures
		"""
		if len(gestures) > 0:
			gui.mainFrame._popupSettingsDialog(GesturesListDialog, title=gestures.title, gestures=gestures)
		else:
			gui.messageBox(
				# Translators: Notification of no search results
				_("Target gestures not found"),
				caption=gestures.title,
				parent=gui.mainFrame)
Example #32
0
def _finderError():
    global _findDialogOpened
    if _findDialogOpened:
        # Translators: Text of the dialog when another find dialog is open.
        gui.messageBox(_("Another find dialog is open."),
                       _("Error"),
                       style=wx.OK | wx.ICON_ERROR)
    else:
        # Translators: Text of the dialog when a generic error has occured.
        gui.messageBox(_(
            "An unexpected error has occured when trying to open find dialog."
        ),
                       _("Error"),
                       style=wx.OK | wx.ICON_ERROR)
Example #33
0
 def script_check_password_strength(self, gesture):
     if len(self.passwords) == 0:
         # translators: message spoken when no password list is loaded.
         ui.message(_("You must loada password list."))
         return
     if self.inDialog:
         # translators: text to indicate that another dialog is already open.
         gui.messageBox(
             _("Another dialog is already open; close it first!"),
             _("Cannot continue"))
         return
     t = threading.Thread(target=self.get_pass)
     t.daemon = True
     t.start()
Example #34
0
def handleRemoteAddonInstall(addonPath):
    # Add-ons cannot be installed into a Windows store version of NVDA
    if config.isAppX:
        gui.messageBox(
            # Translators: The message displayed when an add-on cannot be installed due to NVDA running as a Windows Store app
            _("Add-ons cannot be installed in the Windows Store version of NVDA"
              ),
            # Translators: The title of a dialog presented when an error occurs.
            _("Error"),
            wx.OK | wx.ICON_ERROR)
        return
    gui.mainFrame.prePopup()
    installAddon(gui.mainFrame, addonPath)
    gui.mainFrame.postPopup()
def checkWindowListAddonInstalled():
	h = winUser.getForegroundWindow()
	addonCheckList = [
		"fakeClipboardAnouncement",
		"listDesFenetres",
		"ListeIconesZoneNotification",
		"DitDossierOuvrirEnregistrer"]
	for addon in addonHandler.getRunningAddons():
		if addon.manifest["name"] in addonCheckList:
			# Translators: message of message box
			msg = _("Attention, you must uninstall %s addon because it is now included in this addon.")  # noqa:E501
			gui.messageBox(msg % addon.manifest["name"])
			break
	winUser.setForegroundWindow(h)
Example #36
0
def compileUserDic(self):
	log.info('system_dic "%s"' % jtalkDir.dic_dir)
	log.info('configDir "%s"' % jtalkDir.configDir)
	srcs = jtalkDir.user_dic_srcs()
	if not srcs:
		gui.messageBox(_("No source found."),_("Done"),wx.OK)
		return
	for s in srcs:
		u = os.path.join(jtalkDir.configDir, os.path.basename(s).replace('.txt', '.dic'))
		log.info('user_dic %s to %s' % (s, u))
		# mecab-dict-index.exe -d ..\source\synthDrivers\jtalk\dic -u jtusr.dic -f utf-8 -t utf-8 jtusr.txt
		ret = mecabDictIndex['-d', jtalkDir.dic_dir, '-u', u, '-f', 'utf-8', '-t', 'utf-8', s]()
		log.info(ret)
	gui.messageBox(_("Compile done."),_("Done"),wx.OK)
Example #37
0
def handleRemoteAddonInstall(addonPath):
	# Add-ons cannot be installed into a Windows store version of NVDA
	if config.isAppX:
		gui.messageBox(
			# Translators: The message displayed when an add-on cannot be installed due to NVDA running as a Windows Store app
			_("Add-ons cannot be installed in the Windows Store version of NVDA"),
			# Translators: The title of a dialog presented when an error occurs.
			_("Error"),
			wx.OK | wx.ICON_ERROR)
		return
	gui.mainFrame.prePopup()
	if installAddon(gui.mainFrame, addonPath):
		promptUserForRestart()
	gui.mainFrame.postPopup()
def onInstall():
	import addonHandler
	addonHandler.initTranslation()
	import gui
	import wx
	import os
	import shutil
	import globalVars
	import sys
	curPath = os.path.dirname(__file__)
	sys.path.append(curPath)
	from onInstall import checkWindowListAddonInstalled, installNewSymbols
	del sys.path[-1]
	from addonHandler import _availableAddons
	addon = _availableAddons[curPath]
	addonName = addon.manifest["name"]
	addonSummary = addon.manifest["summary"]
	checkWindowListAddonInstalled()
	installNewSymbols()
	# save old configuration if user wants it
	userConfigPath = globalVars.appArgs.configPath
	addonConfigFile = os.path.join(userConfigPath, curConfigFileName)
	if os.path.exists(addonConfigFile):
		# existing previous addon config
		extraAppArgs = globalVars.appArgsExtra if hasattr(globalVars, "appArgsExtra") else globalVars.unknownAppArgs
		keep = True if "addon-auto-update" in extraAppArgs else False
		if keep or gui.messageBox(
			# Translators: the label of a message box dialog.
			_("Do you want to keep previous add-on configuration settings?"),
			# Translators: the title of a message box dialog.
			_("%s - installation") % addonSummary,
			wx.YES | wx.NO | wx.ICON_WARNING) == wx.YES or gui.messageBox(
				# Translators: the label of a message box dialog.
				_("Are you sure you don't want to keep the current add-on configuration settings?"),
				# Translators: the title of a message box dialog.
				_("%s - installation") % addonSummary,
				wx.YES | wx.NO | wx.ICON_WARNING) == wx.NO:
			dest = os.path.join(curPath, curConfigFileName)
			try:
				shutil.copy(addonConfigFile, dest)
				saveCurAddonConfigurationProfiles(addonName)
			except:  # noqa:E722
				log.error("Addon configuration cannot be saved: %s" % addonConfigFile)

		os.remove(addonConfigFile)
		if os.path.exists(addonConfigFile):
			log.error("Error on deletion of addon settings file: %s" % addonConfigFile)  # noqa:E501
	# in all cases, clean up all add-on configuration
	deleteAddonProfilesConfig(addonName)
Example #39
0
 def handleRemoteAddonInstall(cls, addonPath):
     # Add-ons cannot be installed into a Windows store version of NVDA
     if config.isAppX:
         # Translators: The message displayed when an add-on cannot be installed due to NVDA running as a Windows Store app
         gui.messageBox(
             _("Add-ons cannot be installed in the Windows Store version of NVDA"
               ),
             # Translators: The title of a dialog presented when an error occurs.
             _("Error"),
             wx.OK | wx.ICON_ERROR)
         return
     closeAfter = AddonsDialog._instance() is None
     dialog = AddonsDialog(gui.mainFrame)
     dialog.installAddon(addonPath, closeAfter=closeAfter)
     del dialog
Example #40
0
	def onOk(self, evt):
		i= self.listBox.GetSelection()
		if i != -1:
			filename= self.libraryFiles[i]
			#dlg= BookDialog(gui.mainFrame, filename)
			if  BookDialog.BOOKDIALOG:
				gui.messageBox(
				# Translators: Message be displayed when a library dialog is already opened.
			_('A library dialog is already opened; Close it first please.'),
			# Translators: Title of dialog.
			_('information'))
				return
			else:
				wx.CallAfter(self.openBookDialog, filename)
			self.Destroy()
Example #41
0
def getBookName(message, caption, book=None):
    "Allowing the user to enter the book name, upon adding a book or editing one."
    dlg = wx.TextEntryDialog(None, message, caption)
    if book:
        dlg.SetValue(book.name)
    dlg.ShowModal()
    result = dlg.GetValue().strip()
    if result:
        return result
    else:
        gui.messageBox(
            # Translators: message displayed when the user leaves the book name entry blank.
            _('Name required; You can not leave it blank'),
            _('information'))
        return getBookName(message, caption, book)
Example #42
0
def onInstall():
    addon = [
        x for x in addonHandler.getAvailableAddons()
        if x.manifest["name"] == "addonsHelp-1.0"
    ]
    if len(addon) > 0:
        addon = addon[0]
        gui.messageBox(
            # Translators: A message informing the user that he has installed an old version that contains a space rather than an underscore.
            _("You have installed the addonsHelp-1.0 add-on which is incompatible with this one. The new name of this add-on is addonsHelp. Click OK to update it."
              ),
            # Translators: The title of the dialogbox.
            _("Update confirmation"),
            wx.OK)
        addon.requestRemove()
Example #43
0
	def unsignedGestureWarning(self) -> bool:
		"""Display the warning if the selected gesture is not presented in the Input Gestures dialog.
		@return: an indication of whether the selected gesture is not presented in the Input gestures dialog
		@rtype: bool
		"""
		isUnsigned = self.isUnsignedInFocus()
		if isUnsigned:
			gui.messageBox(
				# Translators: Message that reports about the absence of the selected gesture in the Input Gestures dialog
				_("This gesture is not represented in the NVDA Input Gestures dialog."),
				# Translators: The title of the window that reports the lack of description of the selected gesture
				caption=_("Gesture without description"),
				style=wx.OK | wx.ICON_ERROR,
				parent=self)
		return isUnsigned
Example #44
0
 def on_ok(self, evt):
     if self.client_or_server.GetSelection() == 0 and (
             not self.panel.host.GetValue()
             or not self.panel.key.GetValue()):
         gui.messageBox(_("Both host and key must be set."), _("Error"),
                        wx.OK | wx.ICON_ERROR)
         self.panel.host.SetFocus()
     elif self.client_or_server.GetSelection(
     ) == 1 and not self.panel.port.GetValue(
     ) or not self.panel.key.GetValue():
         gui.messageBox(_("Both port and key must be set."), _("Error"),
                        wx.OK | wx.ICON_ERROR)
         self.panel.port.SetFocus()
     else:
         evt.Skip()
Example #45
0
def _onInstallMSRCommands():
    MSRPATH = os.path.expanduser(r"~\documents\speech macros")
    commandsFile = os.path.join(addonRootDir, "dictationBridge.WSRMac")
    #Translators: Official Title of Microsoft speech Recognition in your language.
    thisProgram = _("Microsoft Speech Recognition")
    if os.path.exists(MSRPATH):
        shutil.copy(commandsFile, MSRPATH)
        successDialog(thisProgram)
    else:
        #Translators: The user doesn't have microsoft speech recognition profiles, or we can't find them.
        gui.messageBox(
            _("Failed to locate your Microsoft Speech Macros folder. Please see the troublshooting part of the documentation for more details."
              ),
            #Translators: Title for the microsoft speech recognitioninstalation  error dialog.
            _("Error installing MSR utilities"))
Example #46
0
def addLibrary(message, caption, oldName=None):
    ''' Entering the name of new library, or renaming existing one by passing a value to oldName in this function.'''
    if oldName:
        name = wx.GetTextFromUser(message, caption, oldName).strip()
    else:
        name = wx.GetTextFromUser(message, caption).strip()
    if name in LibraryDialog.libraryFiles:
        gui.messageBox(
            # Translators: message displayed when the name is present for another library.
            _('This name is already present for another library, enter another name please'
              ),
            # Translators: Title of messagebox.
            _('Warning'))
        return addLibrary(message, caption, oldName)
    return name
Example #47
0
 def onOk(self, evt):
     if resultShortcut == "":
         gui.messageBox(_("You must define a shortcut"), _("Error"),
                        wx.OK | wx.ICON_ERROR, self)
         self.inputShortcut.SetFocus()
         return
     if self.action.GetSelection() == -1:
         gui.messageBox(_("You must define an action"), _("Error"),
                        wx.OK | wx.ICON_ERROR, self)
         self.action.SetFocus()
         return
     global resultActionData
     resultActionData = self.action.GetClientData(self.action.Selection)
     assert self.IsModal()
     self.EndModal(wx.ID_OK)
Example #48
0
 def retreave_from_file(cls):
     if cls.myBooks: return
     #else:
     try:
         with open(os.path.join(SAVING_DIR, cls.filename), 'rb') as f:
             d = pickle.load(f)
             cls.myBooks = d
     except EOFError:
         cls.myBooks = {}
         return
     except Exception as e:
         gui.messageBox("Unable to load data", "Error",
                        wx.OK | wx.ICON_ERROR)
         log.info("Error", exc_info=1)
         return
Example #49
0
 def deleteProfile(self) -> None:
     """Delete selected voice synthesizer profile."""
     if len(profiles) == 0:
         return
     item = int(
         self.synthsList.GetItem(itemIdx=self.synthsList.GetFocusedItem(),
                                 col=0).GetText())
     profiles.remove(item)
     self.displayContent()
     gui.messageBox(
         # Translators: Message that displayed after deleting the profile (also this is the script description)
         message=_("Profile %d successfully deleted") % item,
         caption=_(
             "delete the selected voice synthesizer profile").capitalize(),
         parent=self)
def onInstall():
    for addon in addonHandler.getAvailableAddons():
        if addon.name == "jump to line":
            import gui
            import wx
            gui.messageBox(
                _(
                    # Translators: Content of the dialog informing about presence of old no longer needed add-on.
                    "Functionality of The jump to line add-on that you have installed "
                    "is now included in the percentage checker. After pressing OK it would be removed."
                ),
                # Translators: Title of the dialog
                _("Information"),
                wx.OK)
            addon.requestRemove()
Example #51
0
def onInstall():
	import speechDictHandler
	import globalVars
	import os
	import shutil
	import gui
	import wx
	ADDON_DICTS_PATH = os.path.join(os.path.dirname(__file__), "globalPlugins", "emoticons", "emoticons")
	EXPORT_DICTS_PATH = os.path.join(speechDictHandler.speechDictsPath, "emoticons")
	for addon in addonHandler.getAvailableAddons():
		if addon.manifest['name'] == "Emoticons":
			if gui.messageBox(
				# Translators: the label of a message box dialog.
				_("You have installed the Emoticons add-on, probably an old and incompatible version with this one. Do you want to uninstall the old version?"),
				# Translators: the title of a message box dialog.
				_("Uninstall incompatible add-on"),
				wx.YES|wx.NO|wx.ICON_WARNING)==wx.YES:
					addon.requestRemove()
					break
	if os.path.isfile(os.path.join(speechDictHandler.speechDictsPath, "emoticons.dic")) or os.path.isfile(os.path.join(globalVars.appArgs.configPath, "emoticons.ini")) or os.path.isdir(EXPORT_DICTS_PATH):
		if gui.messageBox(
			# Translators: the label of a message box dialog.
			_("You seem to have previous settings saved for this add-on. Do you want to import them, removing deprecated files?"),
			# Translators: the title of a message box dialog.
			_("Import Emoticons add-on settings"),
			wx.YES|wx.NO|wx.ICON_WARNING)==wx.YES:
				try:
					shutil.copy(os.path.join(speechDictHandler.speechDictsPath, "emoticons.dic"), ADDON_DICTS_PATH)
				except:
					pass
				try:
					shutil.copy(os.path.join(speechDictHandler.speechDictsPath, "emoticons.dic"), EXPORT_DICTS_PATH)
				except:
					pass
				try:
					shutil.copytree(EXPORT_DICTS_PATH, ADDON_DICTS_PATH)
				except:
					pass
				try:
					os.remove(os.path.join(speechDictHandler.speechDictsPath, "emoticons.dic"))
				except:
					pass
				if os.path.isfile(os.path.join(globalVars.appArgs.configPath, "emoticons.ini")): # We suppose that emoticons speaking should be activated
					config.conf["emoticons"]["announcement"] = 1
					try:
						os.remove(os.path.join(globalVars.appArgs.configPath, "emoticons.ini"))
					except:
						pass
Example #52
0
	def postSave(self):
		if re.match(r"\d+", self._alarmTimeWaitingText.GetValue()):
			if gui.messageBox(
				_(
					# Translators: The message displayed after a countdown for an alarm has been chosen.
					"You've chosen an alarm to be triggered in {tm} {unit}"
				).format(tm=self._alarmTimeWaitingText.GetValue(), unit=self._alarmTimerChoice.GetStringSelection()),
				# Translators: The title of the dialog which appears when the user has chosen to trigger an alarm.
				_("Confirmation"), wx.OK | wx.CANCEL | wx.ICON_INFORMATION, self
			) == wx.OK:
				wakeUp = int(self._alarmTimeWaitingText.GetValue())
				if self._alarmTimerChoice.GetSelection() == 0:
					wakeUp *= 3600
				if self._alarmTimerChoice.GetSelection() == 1:
					wakeUp *= 60
				config.conf['clockAndCalendar']['alarmTime'] = wakeUp
				# We save the configuration, in case the user would not have checked the
				# "Save configuration on exit" checkbox in General settings.
				if not config.conf['general']['saveConfigurationOnExit']:
					config.conf.save()
				alarmHandler.run = alarmHandler.AlarmTimer(
					wakeUp, alarmHandler.runAlarm,
					[os.path.join(paths.ALARMS_DIR, self._alarmSoundChoice.GetStringSelection())]
				)
				alarmHandler.run.start()
Example #53
0
def promptMask(webModule):
	ref = webModule.getLayer("addon", raiseIfMissing=True).storeRef
	if ref[0] != "addons":
		raise ValueError("ref={!r}".format(ref))
	addonName = ref[1]
	for addon in addonHandler.getRunningAddons():
		if addon.name == addonName:
			addonSummary = addon.manifest["summary"]
			break
	else:
		raise LookupError("addonName={!r}".format(addonName))
	log.info(u"Proposing to mask {!r} from addon {!r}".format(webModule, addonName))
	msg = _(
		u"""This web module comes with the add-on {addonSummary}.
It cannot be modified at its current location.

Do you want to make a copy in your scratchpad?
"""
	).format(addonSummary=addonSummary)
	return gui.messageBox(
		parent=gui.mainFrame,
		message=msg,
		caption=_("Warning"),
		style=wx.ICON_WARNING | wx.YES | wx.NO
	) == wx.YES
Example #54
0
def doStartupDialogs():
	import config
	import gui
	if config.conf["general"]["showWelcomeDialogAtStartup"]:
		gui.WelcomeDialog.run()
	if globalVars.configFileError:
		gui.ConfigFileErrorDialog.run()
	import inputCore
	if inputCore.manager.userGestureMap.lastUpdateContainedError:
		import wx
		gui.messageBox(_("Your gesture map file contains errors.\n"
				"More details about the errors can be found in the log file."),
			_("gesture map File Error"), wx.OK|wx.ICON_EXCLAMATION)
	if not config.conf["upgrade"]["newLaptopKeyboardLayout"]:
		from gui import upgradeAlerts
		upgradeAlerts.NewLaptopKeyboardLayout.run()
Example #55
0
def getBookUrl2(message, caption, book=None):
    dlg = wx.TextEntryDialog(None, message, caption)
    if book:
        dlg.SetValue(book.url2)
    dlg.ShowModal()
    result = dlg.GetValue().strip()
    if result:
        b = Book.getBookByUrl2(result)
        if b:
            gui.messageBox(
                # Translators: message displayed when url2 is present for another book.
                _('This url is present for book {} by {}; please enter another one'
                  ).format(b.name, b.author),
                _('Warning'))
            return getBookUrl2(message, caption, book)
    return result
def onInstall():
	module = "globalPlugins.clipContentsDesigner"
	className = "GlobalPlugin"
	copyGesture = "kb:control+c"
	copyScriptName = "copy"
	cutGesture = "kb:control+x"
	cutScriptName = "cut"
	try:
		inputCore.manager.userGestureMap.remove(copyGesture, module, className, copyScriptName)
		inputCore.manager.userGestureMap.remove(cutGesture, module, className, cutScriptName)
	except ValueError:
		pass
	if gui.messageBox(
		# Translators: label of a dialog.
		_("""This add-on allows to confirm if you want to copy and cut, replacing the clipboard contents,
		when pressing control+c and control+x. This is named Emulate copy and cut.
		Do you want to configure Emulate copy and cut now? You may do or change this later."""),
		# Translators: title of a dialog.
		_("Configure Emulate copy and cut"),
		wx.YES | wx.NO | wx.ICON_WARNING
	) == wx.YES:
		config.conf.spec["clipContentsDesigner"] = confspec
		config.conf["clipContentsDesigner"]["confirmToCopy"] = True
		config.conf["clipContentsDesigner"]["confirmToCut"] = True
		config.conf.save()
		# Adapted from NVDA's core.
		inputCore.manager.userGestureMap.add(copyGesture, module, className, copyScriptName)
		inputCore.manager.userGestureMap.add(cutGesture, module, className, cutScriptName)
	inputCore.manager.userGestureMap.save()
def onInstall():
	import globalVars
	import wx
	import gui
	import sys
	if sys.version.startswith("3"):
		curPath = os.path.dirname(__file__)
	else:
		curPath = os.path.dirname(__file__).decode("mbcs")
	from addonHandler import _availableAddons
	addon = _availableAddons[curPath]
	addonName = addon.manifest["name"]
	addonSummary = addon.manifest["summary"]
	# save old configuration
	userConfigPath = globalVars.appArgs.configPath
	curConfigFileName = "%sAddon.ini" % addonName
	f = os.path.join(userConfigPath, curConfigFileName)
	if not os.path.exists(f):
		return
	if gui.messageBox(
		# Translators: the label of a message box dialog
		# to ask the user if he wants keep current configuration settings.
		_("Do you want to keep current add-on configuration settings ?"),
		# Translators: the title of a message box dialog.
		_("%s - installation") % addonSummary,
		wx.YES | wx.NO | wx.ICON_WARNING) == wx.NO:
		return
	path = os.path.join(curPath, curConfigFileName)
	saveFile(f, path)
	curAutoReadingSynthFileName = "%s_autoReadingSynth.pickle" % addonName
	f = os.path.join(userConfigPath, curAutoReadingSynthFileName)
	path = os.path.join(curPath, curAutoReadingSynthFileName)
	saveFile(f, path)
Example #58
0
def onInstall():
	requiredVer = "Windows 10 Version 1803"
	# Translators: Dialog text shown when attempting to install the add-on on an unsupported version of Windows (minSupportedVersion is the minimum version required for this add-on).
	if sys.getwindowsversion().build < 17134 and gui.messageBox(_("You are using an older version of Windows. This add-on requires {minSupportedVersion} or later. Are you sure you wish to install this add-on anyway?").format(minSupportedVersion = requiredVer),
	# Translators: title of the dialog shown when attempting to install the add-on on an old version of Windows.
	_("Old Windows version"), wx.YES | wx.NO | wx.CANCEL | wx.CENTER | wx.ICON_QUESTION) == wx.NO:
		raise RuntimeError("Old Windows version detected")
    def onInputChar(self, evt):
        id = evt.GetId()
        key = evt.GetKeyCode()
        if (key == wx.WXK_RETURN):
            self.goTo()
            return
        if (key == wx.WXK_SPACE):
            if self.tc2 and wx.GetKeyState(wx.WXK_CONTROL):
                text = self.TC2.GetValue()
            elif self.tc1:
                text = self.TC1.GetValue()
            wx.CallLater(30, speech.speakMessage, text)
            return

            return

        elif id == self.entriesListID and ((key == wx.WXK_DELETE) or
                                           (key == wx.WXK_NUMPAD_DELETE)):
            if gui.messageBox(_("Are you sure you wish to delete this items?"),
                              _("Deletion of items"),
                              wx.YES_NO | wx.ICON_WARNING) != wx.YES:
                return
            self.delete()
            return

        elif (key == wx.WXK_ESCAPE):
            self.Close()
            return
        evt.Skip()
 def deleteAll(self):
     if gui.messageBox(_("Are you sure you wish to delete all items?"),
                       _("Deletion of all items"),
                       wx.YES_NO | wx.ICON_WARNING) != wx.YES:
         return
     self.collectionObject.deleteAll()
     self.Close()