Skip to content

Show the download window through wx-utils' progress module - #7

Merged
trypsynth merged 1 commit into
trypsynth:masterfrom
LeonarddeR:use-wx-utils-progress
Oct 9, 2026
Merged

trypsynth merged 1 commit into
trypsynth:masterfrom
LeonarddeR:use-wx-utils-progress

Conversation

@LeonarddeR

Copy link
Copy Markdown
Contributor

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 progress module (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

  • ship-shape depends on wx-utils 0.4.2. The lockfile also moves patois from 0.2.2 to 0.2.3, which wx-utils 0.4.2 needs.
  • start_download hands the download to run_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.
  • On macOS, the download also prepares the installation, as before. The new prepare function holds that step. While it runs, the window shows "Preparing update..." and pulses. Cancel still stops the preparation.
  • Removed: 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 readme paragraph about the download gauge now points to wx-utils, and says that the window waits for any other wx-utils progress window in the application.

The public API does not change.

Tests

  • The existing tests still pass. The tests for the guard and the 99 percent cap moved to wx-utils with the code.
  • The download window itself has no unit tests, in ship-shape or before this change. It needs a running application.

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
@trypsynth
trypsynth merged commit d1026a7 into trypsynth:master Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants