fix: winfo_viewable durch explizites Flag ersetzen, unbenutzte Imports entfernen
This commit is contained in:
@@ -99,7 +99,10 @@ def load_model_with_progress(
|
||||
pct_var = tk.StringVar(value="0 %")
|
||||
ttk.Label(frame, textvariable=pct_var).pack(anchor=tk.E, pady=(2, 0))
|
||||
|
||||
_dialog_shown = False
|
||||
|
||||
def poll() -> None:
|
||||
nonlocal _dialog_shown
|
||||
try:
|
||||
while True:
|
||||
msg = q.get_nowait()
|
||||
@@ -107,8 +110,9 @@ def load_model_with_progress(
|
||||
root.quit()
|
||||
return
|
||||
# Erste echte Meldung → Dialog anzeigen
|
||||
if not root.winfo_viewable():
|
||||
if not _dialog_shown:
|
||||
root.deiconify()
|
||||
_dialog_shown = True
|
||||
# UI aktualisieren
|
||||
file_var.set(msg["file"])
|
||||
if msg["total"] > 0:
|
||||
|
||||
Reference in New Issue
Block a user