Exemplo n.º 1
0
	def evaluateUpdatePendingUpdateMenuItemCommand(self):
		try:
			self.sysTrayIcon.menu.Remove(self.sysTrayIcon.installPendingUpdateMenuItem)
		except:
			log.debug("Error while removing  pending update menu item", exc_info=True)
			pass
		if not globalVars.appArgs.secure and updateCheck and updateCheck.isPendingUpdate():
			self.sysTrayIcon.menu.Insert(self.sysTrayIcon.installPendingUpdateMenuItemPos,self.sysTrayIcon.installPendingUpdateMenuItem)
Exemplo n.º 2
0
	def onExecuteUpdateCommand(self, evt):
		if updateCheck and updateCheck.isPendingUpdate():
			updateTuple = updateCheck.getPendingUpdate()
			newNVDAVersionTuple = updateTuple[2]
			from addonHandler import getAddonsWithoutKnownCompatibility
			if any(getAddonsWithoutKnownCompatibility(newNVDAVersionTuple)):
				confirmUpdateDialog = updateCheck.UpdateAskInstallDialog(gui.mainFrame, updateTuple[0], updateTuple[1], newNVDAVersionTuple)
				gui.runScriptModalDialog(confirmUpdateDialog)
			else:
				updateCheck.executePendingUpdate()
Exemplo n.º 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()
Exemplo n.º 4
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()
Exemplo n.º 5
0
	def __init__(self, parent):
		inst = ExitDialog._instance() if ExitDialog._instance else None
		if inst:
			return
		# Use a weakref so the instance can die.
		ExitDialog._instance = weakref.ref(self)
		# Translators: The title of the dialog to exit NVDA
		super(ExitDialog, self).__init__(parent, title=_("Exit NVDA"))
		dialog = self
		mainSizer = wx.BoxSizer(wx.VERTICAL)

		contentSizerHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)

		if globalVars.appArgs.disableAddons:
			# Translators: A message in the exit Dialog shown when all add-ons are disabled.
			addonsDisabledText = _("All add-ons are now disabled. They will be re-enabled on the next restart unless you choose to disable them again.")
			contentSizerHelper.addItem(wx.StaticText(self, wx.ID_ANY, label=addonsDisabledText))

		# Translators: The label for actions list in the Exit dialog.
		labelText=_("What would you like to &do?")
		self.actions = [
			# Translators: An option in the combo box to choose exit action.
			_("Exit"),
			# Translators: An option in the combo box to choose exit action.
			_("Restart")
		]
		# Windows Store version of NVDA does not support add-ons yet.
		if not config.isAppX:
			# Translators: An option in the combo box to choose exit action.
			self.actions.append(_("Restart with add-ons disabled"))
		# Translators: An option in the combo box to choose exit action.
		self.actions.append(_("Restart with debug logging enabled"))
		if updateCheck and updateCheck.isPendingUpdate():
			# Translators: An option in the combo box to choose exit action.
			self.actions.append(_("Install pending update"))
		self.actionsList = contentSizerHelper.addLabeledControl(labelText, wx.Choice, choices=self.actions)
		self.actionsList.SetSelection(0)

		contentSizerHelper.addDialogDismissButtons(wx.OK | wx.CANCEL)

		self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
		self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)

		mainSizer.Add(contentSizerHelper.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
		mainSizer.Fit(self)
		self.Sizer = mainSizer
		self.actionsList.SetFocus()
		self.CentreOnScreen()
Exemplo n.º 6
0
	def __init__(self, parent):
		inst = ExitDialog._instance() if ExitDialog._instance else None
		if inst:
			return
		# Use a weakref so the instance can die.
		ExitDialog._instance = weakref.ref(self)
		# Translators: The title of the dialog to exit NVDA
		super(ExitDialog, self).__init__(parent, title=_("Exit NVDA"))
		dialog = self
		mainSizer = wx.BoxSizer(wx.VERTICAL)

		contentSizerHelper = guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL)

		if globalVars.appArgs.disableAddons:
			# Translators: A message in the exit Dialog shown when all add-ons are disabled.
			addonsDisabledText = _("All add-ons are now disabled. They will be re-enabled on the next restart unless you choose to disable them again.")
			contentSizerHelper.addItem(wx.StaticText(self, wx.ID_ANY, label=addonsDisabledText))

		# Translators: The label for actions list in the Exit dialog.
		labelText=_("What would you like to &do?")
		self.actions = [
			# Translators: An option in the combo box to choose exit action.
			_("Exit"),
			# Translators: An option in the combo box to choose exit action.
			_("Restart")
		]
		# Windows Store version of NVDA does not support add-ons yet.
		if not config.isAppX:
			# Translators: An option in the combo box to choose exit action.
			self.actions.append(_("Restart with add-ons disabled"))
		# Translators: An option in the combo box to choose exit action.
		self.actions.append(_("Restart with debug logging enabled"))
		if updateCheck and updateCheck.isPendingUpdate():
			# Translators: An option in the combo box to choose exit action.
			self.actions.append(_("Install pending update"))
		self.actionsList = contentSizerHelper.addLabeledControl(labelText, wx.Choice, choices=self.actions)
		self.actionsList.SetSelection(0)

		contentSizerHelper.addItem( self.CreateButtonSizer(wx.OK | wx.CANCEL))

		self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
		self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)

		mainSizer.Add(contentSizerHelper.sizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL)
		mainSizer.Fit(self)
		self.Sizer = mainSizer
		self.actionsList.SetFocus()
		self.CentreOnScreen()
Exemplo n.º 7
0
    def __init__(self, parent):
        inst = ExitDialog._instance() if ExitDialog._instance else None
        if inst:
            return
        # Use a weakref so the instance can die.
        ExitDialog._instance = weakref.ref(self)
        # Translators: The title of the dialog to exit NVDA
        super(ExitDialog, self).__init__(parent, title=_("Exit NVDA"))
        dialog = self
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        warningMessages = []
        contentSizerHelper = guiHelper.BoxSizerHelper(self,
                                                      orientation=wx.VERTICAL)

        if globalVars.appArgs.disableAddons:
            # Translators: A message in the exit Dialog shown when all add-ons are disabled.
            addonsDisabledText = _(
                "All add-ons are now disabled. They will be re-enabled on the next restart unless you choose to disable them again."
            )
            warningMessages.append(addonsDisabledText)
        if languageHandler.isLanguageForced():
            langForcedMsg = _(
                # Translators: A message in the exit Dialog shown when NVDA language has been
                # overwritten from the command line.
                "NVDA's interface language is now forced from the command line."
                " On the next restart, the language  saved in NVDA's configuration will be used instead."
            )
            warningMessages.append(langForcedMsg)
        if warningMessages:
            contentSizerHelper.addItem(
                wx.StaticText(self,
                              wx.ID_ANY,
                              label="\n".join(warningMessages)))

        # Translators: The label for actions list in the Exit dialog.
        labelText = _("What would you like to &do?")
        allowedActions = list(_ExitAction)
        # Windows Store version of NVDA does not support add-ons yet.
        if config.isAppX:
            allowedActions.remove(_ExitAction.RESTART_WITH_ADDONS_DISABLED)
        # Changing debug level on secure screen is not allowed.
        # Logging on secure screens could allow keylogging of passwords and retrieval from the SYSTEM user.
        if globalVars.appArgs.secure:
            allowedActions.remove(
                _ExitAction.RESTART_WITH_DEBUG_LOGGING_ENABLED)
        # Installing updates should not happen in secure mode.
        if globalVars.appArgs.secure or not (updateCheck and
                                             updateCheck.isPendingUpdate()):
            allowedActions.remove(_ExitAction.INSTALL_PENDING_UPDATE)
        self.actions = [i.displayString for i in allowedActions]
        self.actionsList = contentSizerHelper.addLabeledControl(
            labelText, wx.Choice, choices=self.actions)
        self.actionsList.SetSelection(0)

        contentSizerHelper.addDialogDismissButtons(wx.OK | wx.CANCEL)

        self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
        self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)

        mainSizer.Add(contentSizerHelper.sizer,
                      border=guiHelper.BORDER_FOR_DIALOGS,
                      flag=wx.ALL)
        mainSizer.Fit(self)
        self.Sizer = mainSizer
        self.actionsList.SetFocus()
        self.CentreOnScreen()
Exemplo n.º 8
0
	def onExecuteUpdateCommand(self, evt):
		if updateCheck and updateCheck.isPendingUpdate():
			updateCheck.executeUpdate()
Exemplo n.º 9
0
 def onExecuteUpdateCommand(self, evt):
     if updateCheck and updateCheck.isPendingUpdate():
         updateCheck.executeUpdate()