Milestone ultima alpha
This commit is contained in:
@@ -21,6 +21,7 @@ from audit_log import log_user_action
|
||||
from busy_overlay import InlineBusyOverlay
|
||||
from gestione_aree import AsyncRunner
|
||||
from gestione_scarico import DEFAULT_SCARICO_USER, move_pallet_async, open_scarico_dialog
|
||||
from locale_text import load_locale_catalog, text as loc_text
|
||||
from tksheet import Sheet, natural_sort_key
|
||||
from tooltips import WidgetToolTip, load_tooltip_catalog, tooltip_text
|
||||
from ui_theme import theme_color, theme_font, theme_section, theme_value
|
||||
@@ -209,8 +210,9 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
"""Create the window and initialize the state used by the matrix view."""
|
||||
super().__init__(parent)
|
||||
self._theme = theme_section("layout_window", {})
|
||||
self._locale_catalog = load_locale_catalog()
|
||||
self._tooltip_catalog = load_tooltip_catalog()
|
||||
self.title("Warehouse - Layout corsie")
|
||||
self.title(loc_text("layout.title", catalog=self._locale_catalog, default="Layout corsie"))
|
||||
self.geometry(str(theme_value(self._theme, "window_geometry", "1200x740")))
|
||||
minsize = theme_value(self._theme, "window_minsize", [980, 560])
|
||||
self.minsize(int(minsize[0]), int(minsize[1]))
|
||||
@@ -307,7 +309,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
self.search_entry.grid(row=0, column=0, sticky="w")
|
||||
btn_search = ctk.CTkButton(
|
||||
srch,
|
||||
text="Cerca per barcode UDC",
|
||||
text=loc_text("layout.button.search", catalog=self._locale_catalog, default="Cerca per barcode UDC"),
|
||||
command=self._search_udc,
|
||||
font=theme_font(self._theme, "toolbar_button_font", ("Segoe UI", 10, "bold")),
|
||||
)
|
||||
@@ -324,14 +326,14 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
pass
|
||||
btn_refresh = ctk.CTkButton(
|
||||
tb,
|
||||
text="Aggiorna",
|
||||
text=loc_text("layout.button.refresh", catalog=self._locale_catalog, default="Aggiorna"),
|
||||
command=self._refresh_current,
|
||||
font=theme_font(self._theme, "toolbar_button_font", ("Segoe UI", 10, "bold")),
|
||||
)
|
||||
btn_refresh.grid(row=0, column=0, padx=4)
|
||||
btn_export = ctk.CTkButton(
|
||||
tb,
|
||||
text="Export XLSX",
|
||||
text=loc_text("layout.button.export", catalog=self._locale_catalog, default="Export XLSX"),
|
||||
command=self._export_xlsx,
|
||||
font=theme_font(self._theme, "toolbar_button_font", ("Segoe UI", 10, "bold")),
|
||||
)
|
||||
@@ -918,13 +920,13 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
bottom.grid(row=2, column=0, sticky="nsew", padx=8, pady=6)
|
||||
bottom.grid_columnconfigure(0, weight=1)
|
||||
|
||||
ctk.CTkLabel(bottom, text="Riempimento globale", font=("", 10, "bold")).grid(row=0, column=0, sticky="w", pady=(0, 2))
|
||||
ctk.CTkLabel(bottom, text=loc_text("layout.fill.global", catalog=self._locale_catalog, default="Riempimento globale"), font=("", 10, "bold")).grid(row=0, column=0, sticky="w", pady=(0, 2))
|
||||
self.tot_canvas = tk.Canvas(bottom, height=22, highlightthickness=0)
|
||||
self.tot_canvas.grid(row=1, column=0, sticky="ew", padx=(0, 260))
|
||||
self.tot_text = ctk.CTkLabel(bottom, text=pct_text(0.0, 0.0))
|
||||
self.tot_text.grid(row=1, column=0, sticky="e")
|
||||
|
||||
ctk.CTkLabel(bottom, text="Riempimento corsia selezionata", font=("", 10, "bold")).grid(row=2, column=0, sticky="w", pady=(10, 2))
|
||||
ctk.CTkLabel(bottom, text=loc_text("layout.fill.selected", catalog=self._locale_catalog, default="Riempimento corsia selezionata"), font=("", 10, "bold")).grid(row=2, column=0, sticky="w", pady=(10, 2))
|
||||
self.sel_canvas = tk.Canvas(bottom, height=22, highlightthickness=0)
|
||||
self.sel_canvas.grid(row=3, column=0, sticky="ew", padx=(0, 260))
|
||||
self.sel_text = ctk.CTkLabel(bottom, text=pct_text(0.0, 0.0))
|
||||
@@ -932,7 +934,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
|
||||
leg = ctk.CTkFrame(bottom)
|
||||
leg.grid(row=4, column=0, sticky="w", pady=(10, 0))
|
||||
ctk.CTkLabel(leg, text="Legenda celle:").grid(row=0, column=0, padx=(0, 8))
|
||||
ctk.CTkLabel(leg, text=loc_text("layout.legend", catalog=self._locale_catalog, default="Legenda celle:")).grid(row=0, column=0, padx=(0, 8))
|
||||
self._legend(leg, 1, "Vuota", COLOR_EMPTY)
|
||||
self._legend(leg, 3, "Piena", COLOR_FULL)
|
||||
self._legend(leg, 5, "Doppia UDC", COLOR_DOUBLE)
|
||||
@@ -1348,7 +1350,13 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
p_dbl = float(rows[0][1] or 0.0) if rows else 0.0
|
||||
self._draw_bar(self.tot_canvas, p_full)
|
||||
self.tot_text.configure(text=pct_text(p_full, p_dbl))
|
||||
self._async.run(self.db.query_json(sql_tot, {}), _ok, lambda e: None, busy=None, message=None)
|
||||
self._async.run(
|
||||
self.db.query_json(sql_tot, {}),
|
||||
_ok,
|
||||
lambda e: None,
|
||||
busy=self._busy,
|
||||
message="Aggiorno statistiche globali...",
|
||||
)
|
||||
|
||||
# selezionata dalla matrice in memoria
|
||||
if self.matrix_state:
|
||||
|
||||
Reference in New Issue
Block a user