Repository navigation
Time out stalled Waze requests, and add an English translation - #4
Merged
Merged
Conversation
Runs pyside6-qmlformat over the four QML files so the repository is clean against the qmlformat hook and the PR Lint workflow, instead of leaving the reformat to whichever change happens to touch a file first. Whitespace only: tabs become four spaces, single-line anchors/width/height blocks expand onto their own lines, single-statement if bodies drop their braces, and the stray semicolon after "import qb.base 1.0" is removed. Verified no semantic change — with whitespace and semicolons stripped, all four files are byte-identical to their previous versions. qmllint passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Addresses the two limitations the README listed. Request timeouts. Qt's QML XMLHttpRequest has no timeout property, so each request is now guarded by a Timer that aborts it after 15 seconds. A request that times out, returns a non-200 status or yields unparseable JSON replaces the duration with an em dash instead of leaving the previous value on the tile, so an unreachable Waze reads as unavailable rather than as a stale travel time. Only one request per route is in flight at a time: a refresh, a settings change or a route going inactive aborts the one before it. A route whose coordinates are blank now clears its row rather than keeping the last value. The guard is armed before send(), because a request that fails immediately runs its handler from inside send(). Translations. Every user-visible string now goes through qsTr(), with Dutch as the source language, and lang/lang_en_GB.qm translates the 27 of them to English. This follows the lang/lang_<locale>.qm convention the other ToonStore apps use. lang_en_GB.ts is kept as the editable source alongside the compiled catalog, and the README documents the lupdate/lrelease cycle. Verified pyside6-lupdate finds exactly the 27 strings in the catalog, with none missing and none stale, and that the compiled catalog loads through QTranslator and resolves every context. Co-Authored-By: Claude Opus 5 <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.
Addresses the two limitations the README listed.
Note on the diff size: #3 was merged into
chore/license-readme-toolingrather thanmain, and #2 had already merged intomainby then, so the qmlformat reformat never reachedmain. This PR is built on it and therefore carries it as its first commit — merging this lands both. Review commit-by-commit:Apply qmlformat…is the pure reformat already reviewed in #3,Time out stalled Waze requests…is the actual change.TscClockTile.qmlhas no real content change at all — with whitespace and semicolons stripped it is byte-identical tomain.Request timeouts
Qt's QML
XMLHttpRequesthas notimeoutproperty, so each request is guarded by aTimerthat aborts it after 15 seconds.—instead of leaving the previous value on the tile. An unreachable Waze now reads as unavailable rather than as a stale travel time.send(), since a request that fails immediately runs its handler from insidesend()— otherwise the timer would start after the request had already finished and later blank out a good value.Translations
Every user-visible string now goes through
qsTr()with Dutch as the source language, andlang/lang_en_GB.qmtranslates all 27 to English.This follows the
lang/lang_<locale>.qmconvention the other ToonStore apps use — worth noting that the catalogs currently shipped by toon-weer and TSC's buienradar are byte-identical 205-byte copies of the stock Toon Clock catalog (contextsClockApp/ClockScreen/ClockMenu), so they translate nothing in those apps. This one is generated from the actual sources.lang_en_GB.tsis kept as the editable source next to the compiled.qm, and the README documents thelupdate/lreleasecycle. Dutch needs no catalog, being the source language.Verification
pyside6-lupdateover the four QML files finds exactly the 27 strings in the catalog — none missing from it, none stale in it.QTranslatorand every context resolves, including the strings containing»andö.pre-commit run --all-filespasses, and the.qmis byte-identical afterwards — the text hooks correctly skip it..gitattributesmarks*.qm binary.Still needs a look on a real Toon: the timeout path can't be exercised off-device, and whether the framework picks up
lang/for this app is only inferable from the convention.Version
Bumped to 1.1.1 with a Changelog entry — a patch bump, since this is a fix plus internal i18n groundwork. Drop that commit hunk if you'd rather batch more before releasing.
🤖 Generated with Claude Code