Skip to content

Commit 761bcbf

Browse files
authored
Merge 760f41f into 21fbfa7
2 parents 21fbfa7 + 760f41f commit 761bcbf

5 files changed

Lines changed: 26 additions & 1 deletion

File tree

source/gui/addonStoreGui/controls/actions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ def _actions(self) -> List[BatchAddonActionVM]:
154154
validCheck=lambda aVMs: AddonListValidator(aVMs).canUseUpdateAction(),
155155
actionTarget=self._selectedAddons,
156156
),
157+
BatchAddonActionVM(
158+
# Translators: Label for an action that retries the selected add-ons
159+
displayName=pgettext("addonStore", "Re&try installing selected add-ons"),
160+
actionHandler=self._storeVM.getAddons,
161+
validCheck=lambda aVMs: AddonListValidator(aVMs).canUseRetryAction(),
162+
actionTarget=self._selectedAddons,
163+
),
157164
BatchAddonActionVM(
158165
# Translators: Label for an action that cancel install of the selected add-ons
159166
displayName=pgettext("addonStore", "Ca&ncel install of selected add-ons"),
@@ -218,6 +225,9 @@ def canUseUpdateAction(self) -> bool:
218225
hasInstallable = True
219226
return hasUpdatable and not hasInstallable
220227

228+
def canUseRetryAction(self) -> bool:
229+
return any(aVM.canUseRetryAction() for aVM in self.addonsList)
230+
221231
def canUseCancelInstallAction(self) -> bool:
222232
for aVM in self.addonsList:
223233
if aVM.canUseCancelInstallAction():

source/gui/addonStoreGui/viewModels/addonList.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def canUseUpdateOverrideIncompatibilityAction(self) -> bool:
140140
def canUseReplaceAction(self) -> bool:
141141
return self.status == AvailableAddonStatus.REPLACE_SIDE_LOAD
142142

143+
def canUseRetryAction(self) -> bool:
144+
return self.status in {AvailableAddonStatus.DOWNLOAD_FAILED, AvailableAddonStatus.INSTALL_FAILED}
145+
143146
def canUseCancelInstallAction(self) -> bool:
144147
return self.status in (AvailableAddonStatus.DOWNLOADING, AvailableAddonStatus.DOWNLOAD_SUCCESS)
145148

source/gui/addonStoreGui/viewModels/store.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ def _makeActionsList(self):
140140
validCheck=lambda aVM: aVM.canUseUpdateOverrideIncompatibilityAction(),
141141
actionTarget=selectedListItem,
142142
),
143+
AddonActionVM(
144+
# Translators: Label for an action that retries the selected addon
145+
displayName=pgettext("addonStore", "Re&try install"),
146+
actionHandler=self.getAddon,
147+
validCheck=lambda aVM: aVM.canUseRetryAction(),
148+
actionTarget=selectedListItem,
149+
),
143150
AddonActionVM(
144151
# Translators: Label for an action that replaces the selected addon with
145152
# an add-on store version.
@@ -671,6 +678,9 @@ def cancelInstallForAddon(self, listItemVM: AddonListItemVM[_AddonStoreModel]):
671678
self._cancelPendingInstallForAddon(listItemVM)
672679

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

676686
def cancelInstallForAddons(self, listItemVMs: Iterable[AddonListItemVM[_AddonStoreModel]]):

user_docs/en/changes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ In order to use this feature, the application volume adjuster needs to be enable
1212
* In Mozilla Firefox, NVDA will report the highlighted text when a URL containing a text fragment is visited. (#16910, @jcsteh)
1313
* NVDA can now report when a link destination points to the current page. (#141, @LeonarddeR, @nvdaes)
1414
* Added an action in the Add-on Store to cancel the install of add-ons. (#15578, @hwf1324)
15+
* Added an action in the Add-on Store to retry the installation if the download/installation of an add-on fails. (#17090, @hwf1324)
1516
* It is now possible to specify a mirror URL to use for the Add-on Store. (#14974)
1617

1718
### Changes
1819

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

2223
### Bug Fixes
2324

user_docs/en/userGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3653,6 +3653,7 @@ This could include accessing your personal data or even the entire system.
36533653
You can install and update add-ons by [browsing Available add-ons](#AddonStoreBrowsing).
36543654
Select an add-on from the "Available add-ons" or "Updatable add-ons" tab.
36553655
Then use the update, install, or replace action to start the installation.
3656+
If the download or installation fails you can retry the installation.
36563657
It is also possible to cancel the install before exiting the Add-on Store.
36573658

36583659
You can also install multiple add-ons at once.

0 commit comments

Comments
 (0)