feat: add progress bar and ETA to splash screen#120
Open
raman78 wants to merge 1 commit intoSTOCD:mainfrom
Open
feat: add progress bar and ETA to splash screen#120raman78 wants to merge 1 commit intoSTOCD:mainfrom
raman78 wants to merge 1 commit intoSTOCD:mainfrom
Conversation
The splash screen currently shows only a text label during startup. This adds a `QProgressBar` and a file counter label that are driven by a new `splash_progress(self, current, total)` helper — safe to call from any worker thread. Implementation: - `splash.py` is replaced with a QTimer-polling design: worker threads write to a plain dict (_state); the MainThread timer reads it every 50ms and updates widgets — no Qt calls from worker threads, no extra signals - ETA is computed from the rate of progress since the bar first appeared and displayed inline in the status label: "Downloading Icons (ETA: 12s)" - `progress_bar` and `progress_detail` are hidden by default and only appear when a worker calls `splash_progress(self, current, total)` with total > 0 — backwards compatible, behaviour unchanged if never called - Both widgets are accessed via `getattr(self.widgets, ..., None)` so they degrade gracefully even if `setup_splash` is ever overridden - `setup_splash()` gains two rows in the existing grid layout for the bar and counter; the stretch spacers are adjusted accordingly New public API in `splash.py`: `splash_text(self, text)` — update status label (was already there) `splash_progress(self, cur, total)` — update progress bar + counter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
The splash screen shows only a text label during startup. Long operations like downloading several thousand icons give no indication of how much remains.
Solution
Replaces the three-function
splash.pywith a QTimer-polling design and adds aQProgressBar+ file counter label tosetup_splash().Thread-safety: worker threads write to a plain Python
dict(_state); aQTimerin MainThread polls it every 50 ms and updates widgets — no Qt calls from worker threads, no new signals.New API:
ETA displayed inline:
Downloading Icons (ETA: 34s)Backwards compatible: bar and counter are hidden by default; if nothing calls
splash_progress()the splash looks identical to before. Both widgets accessed viagetattr(..., None)for graceful degradation.src/splash.pysplash_progress+ ETAsrc/app.pysetup_splash()— adds progress bar + counter rowssrc/datafunctions.pysplash_progressto import