Repository navigation
Show the download window through wx-utils' progress module - #7
Merged
Merged
Conversation
The update download window moved to wx-utils 0.4.2 as its progress module, together with its lifecycle guard and 99 percent gauge cap. start_download now hands the download to run_with_progress instead of running its own worker, update thread and dialog bookkeeping. On macOS the work also prepares the installation, and the window pulses with "Preparing update..." meanwhile, as before. The window now waits for any other wx-utils progress window in the application, instead of showing on top of it. Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ship-shape shows a progress window while it downloads an update. It builds this window itself: a worker thread downloads, a second thread updates the window every 200 ms, and a guard (
ProgressLifecycle) keeps the window alive until a running native update has returned. The gauge stops at 99 percent (download_percent).wx-utils 0.4.2 now has the same window as a shared
progressmodule (trypsynth/wx-utils#1). The guard and the 99 percent cap moved there unchanged.ship-shape should use the shared window instead of keeping its own copy. Paperback is also going to show this window for documents it downloads from links (trypsynth/paperback#1013). The shared window shows one run at a time, so an update download and a link download in the same application don't show two windows at once.
Changes
start_downloadhands the download torun_with_progress, with the same title and message as before. The download gets the window's Cancel flag, and moves the gauge as the file comes in. When the download ends, the callback installs the update, unless the user pressed Cancel. In both cases it then releases the guard that stops a second update check from starting.preparefunction holds that step. While it runs, the window shows "Preparing update..." and pulses. Cancel still stops the preparation.src/ui/progress.rs, the thread-local window, the shared download state, the update thread and the function that updated the window. They now live in wx-utils.The public API does not change.
Tests