Beispiel #1
0
	def onOk(self, evt):
		action=self.actionsList.GetSelection()
		# Because Windows Store version of NVDA does not support add-ons yet, add 1 if action is 2 or above if this is such a case.
		if action >= 2 and config.isAppX:
			action += 1
		if action == 0:
			safeAppExit()
		elif action == 1:
			queueHandler.queueFunction(queueHandler.eventQueue,core.restart)
		elif action == 2:
			queueHandler.queueFunction(queueHandler.eventQueue,core.restart,disableAddons=True)
		elif action == 3:
			queueHandler.queueFunction(queueHandler.eventQueue,core.restart,debugLogging=True)
		elif action == 4:
			if updateCheck:
				destPath, version, apiVersion, backCompatTo = updateCheck.getPendingUpdate()
				from addonHandler import getIncompatibleAddons
				if any(getIncompatibleAddons(currentAPIVersion=apiVersion, backCompatToAPIVersion=backCompatTo)):
					confirmUpdateDialog = updateCheck.UpdateAskInstallDialog(
						parent=gui.mainFrame,
						destPath=destPath,
						version=version,
						apiVersion=apiVersion,
						backCompatTo=backCompatTo
					)
					confirmUpdateDialog.ShowModal()
				else:
					updateCheck.executePendingUpdate()
		self.Destroy()
Beispiel #2
0
	def onOk(self, evt):
		action=self.actionsList.GetSelection()
		# Because Windows Store version of NVDA does not support add-ons yet, add 1 if action is 2 or above if this is such a case.
		if action >= 2 and config.isAppX:
			action += 1
		if action == 0:
			if not core.triggerNVDAExit():
				log.error("NVDA already in process of exiting, this indicates a logic error.")
			return  # there's no need to destroy ExitDialog in this instance as triggerNVDAExit will do this
		elif action == 1:
			queueHandler.queueFunction(queueHandler.eventQueue,core.restart)
		elif action == 2:
			queueHandler.queueFunction(queueHandler.eventQueue,core.restart,disableAddons=True)
		elif action == 3:
			queueHandler.queueFunction(queueHandler.eventQueue,core.restart,debugLogging=True)
		elif action == 4:
			if updateCheck:
				destPath, version, apiVersion, backCompatTo = updateCheck.getPendingUpdate()
				from addonHandler import getIncompatibleAddons
				if any(getIncompatibleAddons(currentAPIVersion=apiVersion, backCompatToAPIVersion=backCompatTo)):
					confirmUpdateDialog = updateCheck.UpdateAskInstallDialog(
						parent=gui.mainFrame,
						destPath=destPath,
						version=version,
						apiVersion=apiVersion,
						backCompatTo=backCompatTo
					)
					confirmUpdateDialog.ShowModal()
				else:
					updateCheck.executePendingUpdate()
		wx.CallAfter(self.Destroy)
Beispiel #3
0
	def onExecuteUpdateCommand(self, evt):
		if updateCheck and updateCheck.isPendingUpdate():
			destPath, version, apiVersion, backCompatToAPIVersion = updateCheck.getPendingUpdate()
			from addonHandler import getIncompatibleAddons
			if any(getIncompatibleAddons(apiVersion, backCompatToAPIVersion)):
				confirmUpdateDialog = updateCheck.UpdateAskInstallDialog(
					parent=gui.mainFrame,
					destPath=destPath,
					version=version,
					apiVersion=apiVersion,
					backCompatTo=backCompatToAPIVersion
				)
				gui.runScriptModalDialog(confirmUpdateDialog)
			else:
				updateCheck.executePendingUpdate()
Beispiel #4
0
 def onOk(self, evt):
     action = [
         a for a in _ExitAction
         if a.displayString == self.actionsList.GetStringSelection()
     ][0]
     if action == _ExitAction.EXIT:
         WelcomeDialog.closeInstances()
         if core.triggerNVDAExit():
             # there's no need to destroy ExitDialog in this instance as triggerNVDAExit will do this
             return
         else:
             log.error(
                 "NVDA already in process of exiting, this indicates a logic error."
             )
             return
     elif action == _ExitAction.RESTART:
         queueHandler.queueFunction(queueHandler.eventQueue, core.restart)
     elif action == _ExitAction.RESTART_WITH_ADDONS_DISABLED:
         queueHandler.queueFunction(queueHandler.eventQueue,
                                    core.restart,
                                    disableAddons=True)
     elif action == _ExitAction.RESTART_WITH_DEBUG_LOGGING_ENABLED:
         queueHandler.queueFunction(queueHandler.eventQueue,
                                    core.restart,
                                    debugLogging=True)
     elif action == _ExitAction.INSTALL_PENDING_UPDATE:
         if updateCheck:
             destPath, version, apiVersion, backCompatTo = updateCheck.getPendingUpdate(
             )
             from addonHandler import getIncompatibleAddons
             from gui import mainFrame
             if any(
                     getIncompatibleAddons(
                         currentAPIVersion=apiVersion,
                         backCompatToAPIVersion=backCompatTo)):
                 confirmUpdateDialog = updateCheck.UpdateAskInstallDialog(
                     parent=mainFrame,
                     destPath=destPath,
                     version=version,
                     apiVersion=apiVersion,
                     backCompatTo=backCompatTo)
                 confirmUpdateDialog.ShowModal()
             else:
                 updateCheck.executePendingUpdate()
     wx.CallAfter(self.Destroy)