Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the Retry Installation action to the Add-on Store. #17104

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/gui/addonStoreGui/controls/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ def _actions(self) -> List[BatchAddonActionVM]:
validCheck=lambda aVMs: AddonListValidator(aVMs).canUseUpdateAction(),
actionTarget=self._selectedAddons,
),
BatchAddonActionVM(
# Translators: Label for an action that retries the selected add-ons
displayName=pgettext("addonStore", "Re&try installing selected add-ons"),
seanbudd marked this conversation as resolved.
Show resolved Hide resolved
actionHandler=self._storeVM.getAddons,
validCheck=lambda aVMs: AddonListValidator(aVMs).canUseRetryAction(),
actionTarget=self._selectedAddons,
),
BatchAddonActionVM(
# Translators: Label for an action that cancel install of the selected add-ons
displayName=pgettext("addonStore", "Ca&ncel install of selected add-ons"),
Expand Down Expand Up @@ -218,6 +225,9 @@ def canUseUpdateAction(self) -> bool:
hasInstallable = True
return hasUpdatable and not hasInstallable

def canUseRetryAction(self) -> bool:
return any(aVM.canUseRetryAction() for aVM in self.addonsList)

def canUseCancelInstallAction(self) -> bool:
for aVM in self.addonsList:
if aVM.canUseCancelInstallAction():
Expand Down
3 changes: 3 additions & 0 deletions source/gui/addonStoreGui/viewModels/addonList.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def canUseUpdateOverrideIncompatibilityAction(self) -> bool:
def canUseReplaceAction(self) -> bool:
return self.status == AvailableAddonStatus.REPLACE_SIDE_LOAD

def canUseRetryAction(self) -> bool:
return self.status in {AvailableAddonStatus.DOWNLOAD_FAILED, AvailableAddonStatus.INSTALL_FAILED}

def canUseCancelInstallAction(self) -> bool:
return self.status in (AvailableAddonStatus.DOWNLOADING, AvailableAddonStatus.DOWNLOAD_SUCCESS)

Expand Down
10 changes: 10 additions & 0 deletions source/gui/addonStoreGui/viewModels/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ def _makeActionsList(self):
validCheck=lambda aVM: aVM.canUseUpdateOverrideIncompatibilityAction(),
actionTarget=selectedListItem,
),
AddonActionVM(
# Translators: Label for an action that retries the selected addon
displayName=pgettext("addonStore", "Re&try install"),
actionHandler=self.getAddon,
validCheck=lambda aVM: aVM.canUseRetryAction(),
actionTarget=selectedListItem,
),
AddonActionVM(
# Translators: Label for an action that replaces the selected addon with
# an add-on store version.
Expand Down Expand Up @@ -671,6 +678,9 @@ def cancelInstallForAddon(self, listItemVM: AddonListItemVM[_AddonStoreModel]):
self._cancelPendingInstallForAddon(listItemVM)

log.debug(f"Completed cancelling install of {listItemVM.Id}")
addonHandler.state[addonHandler.AddonStateCategory.PENDING_OVERRIDE_COMPATIBILITY].discard(
listItemVM.model.name,
)
listItemVM.status = getStatus(listItemVM.model, self._filteredStatusKey)

def cancelInstallForAddons(self, listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]):
Expand Down
3 changes: 2 additions & 1 deletion user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ In order to use this feature, the application volume adjuster needs to be enable
* In Mozilla Firefox, NVDA will report the highlighted text when a URL containing a text fragment is visited. (#16910, @jcsteh)
* NVDA can now report when a link destination points to the current page. (#141, @LeonarddeR, @nvdaes)
* Added an action in the Add-on Store to cancel the install of add-ons. (#15578, @hwf1324)
* Added an action in the Add-on Store to retry the installation if the download/installation of an add-on fails. (#17090, @hwf1324)
* It is now possible to specify a mirror URL to use for the Add-on Store. (#14974)

### Changes

* The Report link destination, Character formatting information, and Speak selection dialogs, now include "Close" and "Copy" buttons for user convenience. (#17018, @XLTechie)
* The exit dialog now allows you to restart NVDA with add-ons disabled and debug logging enabled simultaneously. (#11538, @CyrilleB79)r
* The exit dialog now allows you to restart NVDA with add-ons disabled and debug logging enabled simultaneously. (#11538, @CyrilleB79)

### Bug Fixes

Expand Down
1 change: 1 addition & 0 deletions user_docs/en/userGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3653,6 +3653,7 @@ This could include accessing your personal data or even the entire system.
You can install and update add-ons by [browsing Available add-ons](#AddonStoreBrowsing).
Select an add-on from the "Available add-ons" or "Updatable add-ons" tab.
Then use the update, install, or replace action to start the installation.
If the download or installation fails you can retry the installation.
It is also possible to cancel the install before exiting the Add-on Store.

You can also install multiple add-ons at once.
Expand Down