Unifica finestre errori con testo completo, copia ed esportazione
This commit is contained in:
@@ -10,7 +10,8 @@ import json
|
||||
import logging
|
||||
import sys
|
||||
import tkinter as tk
|
||||
from tkinter import Menu, messagebox, filedialog, simpledialog
|
||||
import error_dialog as messagebox
|
||||
from tkinter import Menu, filedialog, simpledialog
|
||||
import customtkinter as ctk
|
||||
from datetime import datetime
|
||||
from functools import wraps
|
||||
@@ -750,7 +751,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
target=target_barcode_cella,
|
||||
details={"barcode_pallet": barcode_pallet, "error": str(ex)},
|
||||
)
|
||||
messagebox.showerror("Movimento UDC", f"Operazione fallita:\n{ex}", parent=self)
|
||||
messagebox.showerror("Movimento UDC", f"Operazione fallita:\n{ex}", parent=self, exception=ex)
|
||||
|
||||
self._async.run(
|
||||
move_pallet_async(
|
||||
@@ -838,7 +839,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
target=self._cell_label(r, c),
|
||||
details={"idcella": idcella, "stato": int(stato), "error": str(ex)},
|
||||
)
|
||||
messagebox.showerror("Prenotazione", f"Aggiornamento fallito:\n{ex}", parent=self)
|
||||
messagebox.showerror("Prenotazione", f"Aggiornamento fallito:\n{ex}", parent=self, exception=ex)
|
||||
|
||||
self._async.run(
|
||||
self.db.exec(SQL_SET_CELL_PRENOTAZIONE, params, commit=True),
|
||||
@@ -899,7 +900,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
target=self._cell_label(r, c),
|
||||
details={"idcella": idcella, "stato": int(stato), "error": str(ex)},
|
||||
)
|
||||
messagebox.showerror("Stato cella", f"Aggiornamento fallito:\n{ex}", parent=self)
|
||||
messagebox.showerror("Stato cella", f"Aggiornamento fallito:\n{ex}", parent=self, exception=ex)
|
||||
|
||||
self._async.run(
|
||||
self.db.exec(SQL_SET_CELL_PRENOTAZIONE, params, commit=True),
|
||||
@@ -1000,7 +1001,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
return
|
||||
self._busy.hide()
|
||||
_MODULE_LOGGER.exception(f"Errore caricamento corsie: {ex}")
|
||||
messagebox.showerror("Errore", f"Caricamento corsie fallito:\n{ex}")
|
||||
messagebox.showerror("Errore", f"Caricamento corsie fallito:\n{ex}", exception=ex)
|
||||
self._async.run(self.db.query_json(sql, {}), _ok, _err, busy=self._busy, message="Carico corsie…")
|
||||
|
||||
@_log_call()
|
||||
@@ -1179,7 +1180,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
return
|
||||
self._busy.hide()
|
||||
_MODULE_LOGGER.exception(f"Errore caricamento matrice corsia={corsia}: {ex}")
|
||||
messagebox.showerror("Errore", f"Caricamento matrice {corsia} fallito:\n{ex}")
|
||||
messagebox.showerror("Errore", f"Caricamento matrice {corsia} fallito:\n{ex}", exception=ex)
|
||||
self._async.run(self.db.query_json(sql, {"corsia": corsia}), _ok, _err, busy=self._busy, message=f"Carico corsia {corsia}…")
|
||||
|
||||
# ---------------- SEARCH ----------------
|
||||
@@ -1233,7 +1234,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
if search_req_id < self._last_req:
|
||||
return
|
||||
_MODULE_LOGGER.exception(f"Errore ricerca UDC barcode={barcode}: {ex}")
|
||||
messagebox.showerror("Ricerca", f"Errore ricerca UDC:\n{ex}", parent=self)
|
||||
messagebox.showerror("Ricerca", f"Errore ricerca UDC:\n{ex}", parent=self, exception=ex)
|
||||
|
||||
self._async.run(self.db.query_json(sql, {"barcode": barcode}), _ok, _err, busy=self._busy, message="Cerco UDC…")
|
||||
|
||||
@@ -1283,7 +1284,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
from openpyxl import Workbook
|
||||
from openpyxl.styles import PatternFill, Alignment, Font
|
||||
except Exception as ex:
|
||||
messagebox.showerror("Export", f"Manca openpyxl: {ex}\nInstalla con: pip install openpyxl")
|
||||
messagebox.showerror("Export", f"Manca openpyxl: {ex}\nInstalla con: pip install openpyxl", exception=ex)
|
||||
return
|
||||
rows = len(self.matrix_state)
|
||||
cols = len(self.matrix_state[0]) if self.matrix_state else 0
|
||||
@@ -1317,7 +1318,7 @@ class LayoutWindow(ctk.CTkToplevel):
|
||||
wb.save(path)
|
||||
self._toast(f"Esportato: {path}")
|
||||
except Exception as ex:
|
||||
messagebox.showerror("Export", f"Salvataggio fallito:\n{ex}")
|
||||
messagebox.showerror("Export", f"Salvataggio fallito:\n{ex}", exception=ex)
|
||||
|
||||
# ---------------- STATS ----------------
|
||||
def _refresh_stats(self):
|
||||
|
||||
Reference in New Issue
Block a user