fix(gui): clarifier aide et disponibilite moteurs
Passe theme clair, libelles utilisateur, aides conteneurs, recherche de mise a jour et indication honnete des moteurs optionnels non embarques. Tests GUI unitaires: 126 passed.
This commit is contained in:
@@ -7,6 +7,7 @@ démarrage (seul ``local_status`` est lu).
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from tkinter import messagebox
|
||||
from typing import Optional
|
||||
|
||||
import customtkinter as ctk
|
||||
@@ -35,6 +36,11 @@ _STATUS_LABELS = {
|
||||
"none": "Aucune licence",
|
||||
}
|
||||
|
||||
_UPDATE_CHECK_MESSAGE = (
|
||||
"Aucune version publiée n'a été trouvée sur le portail.\n\n"
|
||||
"Vérifiez que le serveur web est joignable ou contactez votre administrateur."
|
||||
)
|
||||
|
||||
|
||||
def _build_info() -> str:
|
||||
try:
|
||||
@@ -86,9 +92,9 @@ class AboutTab(ctk.CTkFrame):
|
||||
items = [
|
||||
("🏷️", "Version", f"Interface V6 — {GUI_VERSION}"),
|
||||
("📅", "Build", _build_info()),
|
||||
("🧠", "Moteurs NER", "CamemBERT · EDS-Pseudo · GLiNER"),
|
||||
("🧠", "Moteurs NER", "CamemBERT inclus · EDS/GLiNER optionnels non embarqués"),
|
||||
("🔒", "Traitement", "100 % local — aucune donnée transmise"),
|
||||
("📚", "Gazetteers", "INSEE 219K · FINESS 108K · BDPM 7K"),
|
||||
("📚", "Bases de données", "INSEE 219K · FINESS 108K · BDPM 7K"),
|
||||
("📁", "Formats", "PDF · DOCX · ODT · RTF · TXT · Images"),
|
||||
("🖥️", "Poste", self._machine_id),
|
||||
]
|
||||
@@ -102,6 +108,9 @@ class AboutTab(ctk.CTkFrame):
|
||||
txt.pack(side="left")
|
||||
ctk.CTkLabel(txt, text=key.upper(), text_color=p["text_muted"], font=ui_kit.font(10), anchor="w").pack(anchor="w")
|
||||
ctk.CTkLabel(txt, text=val, text_color=p["text"], font=ui_kit.font(12, "bold"), anchor="w").pack(anchor="w")
|
||||
ui_kit.secondary_button(info, p, "🔄 Rechercher une mise à jour", command=self._check_updates).pack(
|
||||
anchor="w", padx=16, pady=(0, 14)
|
||||
)
|
||||
|
||||
# Bloc licence
|
||||
lic = ui_kit.Card(self, p, title="🔑 Licence")
|
||||
@@ -151,3 +160,19 @@ class AboutTab(ctk.CTkFrame):
|
||||
self.set_status(LicenseStatus.none("Aucune licence à vérifier"))
|
||||
return
|
||||
self.set_status(self._client.check(ref, self._machine_id))
|
||||
|
||||
def _check_updates(self) -> None:
|
||||
if self._client is None:
|
||||
messagebox.showinfo("Mise à jour", _UPDATE_CHECK_MESSAGE)
|
||||
return
|
||||
payload = self._client.latest_version()
|
||||
if not payload:
|
||||
messagebox.showinfo("Mise à jour", _UPDATE_CHECK_MESSAGE)
|
||||
return
|
||||
version = str(payload.get("version") or "version inconnue")
|
||||
channel = str(payload.get("channel") or "canal non précisé")
|
||||
filename = str(payload.get("filename") or "fichier non précisé")
|
||||
messagebox.showinfo(
|
||||
"Mise à jour",
|
||||
f"Version publiée : {version}\nCanal : {channel}\nFichier : {filename}",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user