gtk: interface GTK4, préférences, versions, traductions, licence MIT

- interface gtkmm-4 : véhicules, ajout par VIN, mises à jour, dossier,
  téléchargement avec reprise et arrêt, choix de la clé, confirmation,
  écriture avec progression, fin avec guide d'installation ; travail
  dans un thread, résultats renvoyés via Glib::Dispatcher
- préférences : dossier de téléchargement, langue (système par défaut),
  recherche automatique de nouvelle version d'OpenPU
- recherche de nouvelle version (releases GitHub, format tags Gitea
  accepté) avec ouverture de la page dans le navigateur ;
  openpu-cli app-update
- versions : project(VERSION) + git describe régénéré à chaque build,
  openpu-cli --version, À propos, User-Agent, CHANGELOG, tools/release.sh
  (étiquette annotée, push vers tous les remotes, release GitHub)
- traductions gettext : textes anglais, fr.po complet (96 chaînes),
  extracteur de secours sans xgettext
- core : module job (téléchargement licence/fw/carte), liens des guides
  PDF, ordre des véhicules conservé (ordered_json)
- licence MIT (LICENSE, en-têtes SPDX) ; dépôt principal sur GitHub
- validé dans WSLg : parcours complet jusqu'à l'écriture d'une clé loop
  (FAT32 propre, fichiers téléchargés supprimés)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
This commit is contained in:
yann64andClaude Opus 5.5 committed 2026-11-28 19:54:04 +01:00
1 parent 6a7a2f1ee9
commit 384aaf78c6
62 files changed
+3029 -20

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: MIT
"""Minimal read-only asar extractor: copies selected files out of an asar archive.
usage: python -I asar_extract.py <app.asar> <out_dir> [prefix ...]
+14 -1
View File
@@ -1,4 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# Full local quality gate: build + tests, ASan/UBSan tests, valgrind, clang-tidy, cppcheck.
# usage: tools/check.sh [build-root] (default: ~/build/openpu-check)
set -eu
@@ -27,10 +28,22 @@ fi
if command -v clang-tidy >/dev/null; then
step "clang-tidy"
# Only our sources; compile_commands.json comes from the debug build.
find "$SRC/src" -name '*.cpp' -print0 |
find "$SRC/src" -name '*.cpp' -not -path '*/ui-*' -print0 |
xargs -0 clang-tidy -p "$OUT/debug" --quiet --warnings-as-errors='*'
fi
if pkg-config --exists gtkmm-4.0; then
step "GTK user interface build"
cmake -S "$SRC" -B "$OUT/gtk" -G Ninja -DCMAKE_BUILD_TYPE=Debug -DOPENPU_WERROR=ON -DOPENPU_UI_GTK=ON \
-DOPENPU_BUILD_TESTS=OFF >/dev/null
cmake --build "$OUT/gtk"
if command -v clang-tidy >/dev/null; then
step "clang-tidy (GTK user interface)"
find "$SRC/src/ui-gtk" -name '*.cpp' -print0 |
xargs -0 clang-tidy -p "$OUT/gtk" --quiet --warnings-as-errors='*'
fi
fi
if command -v cppcheck >/dev/null; then
step "cppcheck"
cppcheck --quiet --error-exitcode=1 --std=c++17 --enable=warning,performance,portability \
+1
View File
@@ -1,4 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# DEVELOPMENT ONLY (WSL / test VM): lets the invoking user run UDisks2 operations
# (loop-setup, format, mount, power-off) without a polkit agent, so that the end-to-end
# USB tests can run headless. Never install this on a real desktop machine.
+1
View File
@@ -1,4 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# End-to-end USB test on Linux without a real stick: a sparse disk image is attached as a loop
# device through UDisks2, `openpu-cli write-usb` formats and fills it, then the result is checked
# with sfdisk / fsck.fat / mtools. Needs udisks2, dosfstools, mtools and, in a session without a
+36
View File
@@ -0,0 +1,36 @@
# SPDX-License-Identifier: MIT
"""Fallback string extractor when xgettext is not available.
Collects _("...") calls (with adjacent literal concatenation) from C++ sources and writes a
gettext template. Prefer `cmake --build <dir> --target pot` (xgettext) when gettext is installed.
usage: python3 tools/extract_strings.py po/openpu.pot src/ui-gtk/main_window.cpp ...
"""
import re
import sys
CALL = re.compile(r'\b_\(\s*((?:"(?:[^"\\]|\\.)*"\s*)+)\)', re.S)
LITERAL = re.compile(r'"((?:[^"\\]|\\.)*)"')
def main():
out, *sources = sys.argv[1:]
seen = {}
for path in sources:
text = open(path, encoding="utf-8").read()
for m in CALL.finditer(text):
msgid = "".join(LITERAL.findall(m.group(1)))
line = text.count("\n", 0, m.start()) + 1
seen.setdefault(msgid, []).append(f"{path}:{line}")
with open(out, "w", encoding="utf-8", newline="\n") as f:
f.write('msgid ""\nmsgstr ""\n"Project-Id-Version: openpu\\n"\n'
'"Content-Type: text/plain; charset=UTF-8\\n"\n"Content-Transfer-Encoding: 8bit\\n"\n')
for msgid, refs in seen.items():
f.write("\n#: " + " ".join(refs) + "\n")
if "%1" in msgid:
f.write("#, qt-format\n")
f.write(f'msgid "{msgid}"\nmsgstr ""\n')
print(f"{len(seen)} strings -> {out}")
main()
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# Cut a release: set project(VERSION) in CMakeLists.txt, date the "Unreleased" section of
# CHANGELOG.md, commit, create the annotated tag vX.Y.Z, push to every remote (GitHub origin and
# the Gitea mirror) and publish the GitHub release that the in-app update check reads.
#
# usage: tools/release.sh X.Y.Z [--no-push]
set -eu
VERSION=${1:-}
PUSH=1
[ "${2:-}" = "--no-push" ] && PUSH=0
echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo "usage: $0 X.Y.Z [--no-push]" >&2; exit 2; }
cd "$(dirname "$0")/.."
[ -z "$(git status --porcelain)" ] || { echo "the working tree is not clean" >&2; exit 1; }
git rev-parse -q --verify "refs/tags/v$VERSION" >/dev/null && { echo "tag v$VERSION already exists" >&2; exit 1; }
grep -q '^## \[Unreleased\]' CHANGELOG.md || { echo "CHANGELOG.md has no [Unreleased] section" >&2; exit 1; }
PREVIOUS=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || true)
TODAY=$(date +%Y-%m-%d)
sed -i "s/^project(openpu VERSION [0-9.]* /project(openpu VERSION $VERSION /" CMakeLists.txt
grep -q "^project(openpu VERSION $VERSION " CMakeLists.txt || { echo "cannot update CMakeLists.txt" >&2; exit 1; }
# New release section under an empty Unreleased one, and comparison links at the bottom.
sed -i "s/^## \[Unreleased\]$/## [Unreleased]\n\n## [$VERSION] - $TODAY/" CHANGELOG.md
sed -i "s|^\[Unreleased\]: \(.*\)/compare/v[0-9.]*\.\.\.HEAD$|[Unreleased]: \1/compare/v$VERSION...HEAD\n[$VERSION]: \1/releases/tag/v$VERSION|" CHANGELOG.md
git add CMakeLists.txt CHANGELOG.md
git commit -q -m "release: v$VERSION"
NOTES=$(awk -v v="$VERSION" '$0 ~ "^## \\[" v "\\]" {on=1; next} on && /^(## |\[)/ {exit} on {print}' CHANGELOG.md)
git tag -a "v$VERSION" -m "OpenPU $VERSION" -m "$NOTES"
echo "tagged v$VERSION (previous: ${PREVIOUS:-none})"
[ "$PUSH" = 1 ] || exit 0
for remote in $(git remote); do
git push --follow-tags "$remote" HEAD
done
GH=$(command -v gh || command -v gh.exe || true)
[ -z "$GH" ] && [ -x "/c/Program Files/GitHub CLI/gh.exe" ] && GH="/c/Program Files/GitHub CLI/gh.exe"
if [ -n "$GH" ]; then
printf '%s\n' "$NOTES" | "$GH" release create "v$VERSION" --verify-tag --title "OpenPU $VERSION" --notes-file -
else
echo "gh not found: create the GitHub release for v$VERSION by hand" >&2
fi