Repository navigation
No longer remove failed add-ons installs and warn when add-on installs, removals and updates cannot complete #15937
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
Changes from 7 commits
5f344e8
0c896c4
ec9e408
122ad56
85a2a4f
72cd22b
376a7ab
d5d2942
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -69,6 +69,53 @@ def __bool__(self): | |||||
| _shuttingDownFlagLock = threading.Lock() | ||||||
|
|
||||||
|
|
||||||
| def _showAddonsWarnings() -> None: | ||||||
| addonFailureMessages: list[str] = [] | ||||||
| failedUpdates = addonHandler._failedPendingInstalls.intersection(addonHandler._failedPendingRemovals) | ||||||
| failedInstalls = addonHandler._failedPendingInstalls - failedUpdates | ||||||
| failedRemovals = addonHandler._failedPendingRemovals - failedUpdates | ||||||
| if failedUpdates: | ||||||
| addonFailureMessages.append( | ||||||
| ngettext( | ||||||
| # Translators: Shown when one or more add-ons failed to update. | ||||||
| "The following add-on failed to update: {}", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add end of sentence period. It's better when reading the whole dialog (NVDA+B) and various such messages are concatenated.
Suggested change
|
||||||
| "The following add-ons failed to update: {}", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add period |
||||||
| len(failedUpdates) | ||||||
| ).format(", ".join(failedUpdates)) | ||||||
| ) | ||||||
| if failedRemovals: | ||||||
| addonFailureMessages.append( | ||||||
| ngettext( | ||||||
| # Translators: Shown when one or more add-ons failed to be uninstalled. | ||||||
| "The following add-on failed to uninstall: {}", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add period |
||||||
| "The following add-ons failed to uninstall: {}", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add period |
||||||
| len(failedRemovals) | ||||||
| ).format(", ".join(failedRemovals)) | ||||||
| ) | ||||||
| if failedInstalls: | ||||||
| addonFailureMessages.append( | ||||||
| ngettext( | ||||||
| # Translators: Shown when one or more add-ons failed to be installed. | ||||||
| "The following add-on failed to be installed: {}", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add period |
||||||
| "The following add-ons failed to be installed: {}", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add period |
||||||
| len(failedInstalls) | ||||||
| ).format(", ".join(failedInstalls)) | ||||||
| ) | ||||||
|
|
||||||
| if addonFailureMessages: | ||||||
| import wx | ||||||
| import gui | ||||||
| gui.messageBox( | ||||||
| _( | ||||||
| # Translators: Shown when one or more actions on add-ons failed. | ||||||
| "Some operations on add-ons failed. See the log file for more details.\n{}" | ||||||
| ).format("\n".join(addonFailureMessages)), | ||||||
| # Translators: Title of message shown when requested action on add-ons failed. | ||||||
| _("Add-on failures"), | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not the add-on is failing, it's its install/removal process. A simpler title would be enough IMO.
Suggested change
|
||||||
| wx.ICON_ERROR | wx.OK | ||||||
| ) | ||||||
|
|
||||||
|
|
||||||
| def doStartupDialogs(): | ||||||
| import config | ||||||
| import gui | ||||||
|
|
@@ -138,6 +185,7 @@ def onResult(ID): | |||||
| pass | ||||||
| # Ask the user if usage stats can be collected. | ||||||
| gui.runScriptModalDialog(gui.startupDialogs.AskAllowUsageStatsDialog(None), onResult) | ||||||
| _showAddonsWarnings() | ||||||
|
|
||||||
|
|
||||||
| @dataclass | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are displaying an error message:
or only: