Skip to content

Time out stalled Waze requests, and add an English translation - #4

Merged
luukvisser merged 2 commits into
mainfrom
fix/travel-timeout-and-i18n
Aug 6, 2026
Merged

luukvisser merged 2 commits into
mainfrom
fix/travel-timeout-and-i18n

Conversation

@luukvisser

@luukvisser luukvisser commented Aug 6, 2026 •

Copy link
Copy Markdown
Owner

Addresses the two limitations the README listed.

Note on the diff size: #3 was merged into chore/license-readme-tooling rather than main, and #2 had already merged into main by then, so the qmlformat reformat never reached main. 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.qml has no real content change at all — with whitespace and semicolons stripped it is byte-identical to main.

Request timeouts

Qt's QML XMLHttpRequest has no timeout property, so each request is 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 — instead of leaving the previous value on the tile. An unreachable Waze now reads as unavailable rather than as a stale travel time.
  • Only one request per route is ever in flight. A refresh, a settings change, or a route going inactive aborts the previous one.
  • A route whose coordinates are blank clears its row rather than keeping the last value.
  • The guard is armed before send(), since a request that fails immediately runs its handler from inside send() — 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, and lang/lang_en_GB.qm translates all 27 to English.

This follows the lang/lang_<locale>.qm convention 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 (contexts ClockApp/ClockScreen/ClockMenu), so they translate nothing in those apps. This one is generated from the actual sources.

lang_en_GB.ts is kept as the editable source next to the compiled .qm, and the README documents the lupdate / lrelease cycle. Dutch needs no catalog, being the source language.

Verification

  • pyside6-lupdate over the four QML files finds exactly the 27 strings in the catalog — none missing from it, none stale in it.
  • The compiled catalog loads through QTranslator and every context resolves, including the strings containing » and ö.
  • pre-commit run --all-files passes, and the .qm is byte-identical afterwards — the text hooks correctly skip it. .gitattributes marks *.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

luukvisser and others added 2 commits August 6, 2026 16:22
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>
@luukvisser
luukvisser changed the base branch from chore/qmlformat to main August 6, 2026 14:36
@luukvisser
luukvisser merged commit 64afc11 into main Aug 6, 2026
2 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.

1 participant