diff --git a/tests/test_download_progress.py b/tests/test_download_progress.py index ecc0494..f123e3b 100644 --- a/tests/test_download_progress.py +++ b/tests/test_download_progress.py @@ -1,5 +1,4 @@ import queue -from unittest.mock import MagicMock, patch import tqdm as tqdm_module diff --git a/whisper_local/tray/_download_progress.py b/whisper_local/tray/_download_progress.py index 0b5c8c0..bd5918a 100644 --- a/whisper_local/tray/_download_progress.py +++ b/whisper_local/tray/_download_progress.py @@ -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: