diff --git a/script/todo/qemu_deploy_form.py b/script/todo/qemu_deploy_form.py index 7f75bd8..83658f3 100644 --- a/script/todo/qemu_deploy_form.py +++ b/script/todo/qemu_deploy_form.py @@ -608,12 +608,25 @@ def run_deploy_form(ctx, run_app: bool = True): return "" return desktops[index - 1][0] + def _desktop_label(self): + """LibellĂ© court du type de VM, pour le tableau et les totaux.""" + key = self._desktop() + if not key: + return t("server") + label = dict(desktops).get(key, key) + return f"đŸ–„ {label}" + def _render_plan(self): table = self.query_one("#plan", DataTable) table.clear() + # Le type ne concerne QUE les VM rĂ©ellement créées : une VM dĂ©jĂ  + # dĂ©finie n'est pas retouchĂ©e, lui afficher « GNOME » laisserait + # croire qu'on va lui poser un bureau. + kind = self._desktop_label() for r in self.rows: vm = r["vm"] icon = {"new": "", "exists": "⏭ ", "orphan": "❌ "}[r["state"]] + status = kind if r["state"] == "new" else f"{icon}{r['note']}" table.add_row( vm["name"], vm["distro"], @@ -622,7 +635,7 @@ def run_deploy_form(ctx, run_app: bool = True): str(vm["vcpus"]), f"{vm['ram']}Mo", f"{r['disk_gb']}G", - f"{icon}{r['note']}", + status, ) if not self.rows: # Rien de cochĂ© : un total Ă  zĂ©ro n'apprend rien, on dit @@ -646,7 +659,7 @@ def run_deploy_form(ctx, run_app: bool = True): ) self.query_one("#totals", Static).update( f" {n} {t('VMs')} · {cpus} vCPU · {ram} Mo · ~{disk} G" - f"{warn}{dup_txt}" + f" · {self._desktop_label()}{warn}{dup_txt}" ) # -- rĂ©actions aux champs -------------------------------------- # @@ -655,7 +668,9 @@ def run_deploy_form(ctx, run_app: bool = True): self.arch = arches[event.radio_set.pressed_index] self._reload_catalog() elif event.radio_set.id == "f_type": - self._recompute() # le disque annonce inclut GNOME + # Recalcul : le disque annonce inclut le bureau, et la + # colonne Statut affiche le type de VM. + self._recompute() elif event.radio_set.id == "f_profile": index = event.radio_set.pressed_index self.profile = "custom" if index == 4 else str(index + 1) diff --git a/script/todo/todo_i18n.py b/script/todo/todo_i18n.py index 06289a0..4c5ffde 100644 --- a/script/todo/todo_i18n.py +++ b/script/todo/todo_i18n.py @@ -2035,6 +2035,10 @@ TRANSLATIONS = { "fr": "Graphique (serveur + bureau GNOME)", "en": "Graphical (server + GNOME desktop)", }, + "server": { + "fr": "serveur", + "en": "server", + }, "Graphical (server + desktop):": { "fr": "Graphique (serveur + bureau) :", "en": "Graphical (server + desktop):",