Skip to content

Commit fb6e5ea

Browse files
committed
Improves voice settings loading by moving ElevenLabs cache check and initial loading to VoiceSettingsWindow
1 parent be91071 commit fb6e5ea

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

gui.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -880,24 +880,9 @@ def open_settings_window(self):
880880
else:
881881
self.menubar.entryconfig("Settings", state="disabled")
882882

883-
# If the ElevenLabs voice cache is not yet populated, wait for it.
884-
# This prevents a race condition in the settings window where a late
885-
# arrival of the voice list could trigger a buggy UI refresh.
886-
if self.provider_var.get() == "elevenlabs" and not self.elevenlabs_voices_cache:
887-
self.log_status("Loading available voices from ElevenLabs...")
888-
889-
def _wait_for_cache():
890-
if self.elevenlabs_voices_cache:
891-
self.log_status("Voices loaded. Opening settings...")
892-
self._show_settings_window()
893-
else:
894-
# Check again in 200ms
895-
self.root.after(200, _wait_for_cache)
896-
897-
_wait_for_cache()
898-
else:
899-
# If not using ElevenLabs or cache is ready, open immediately.
900-
self._show_settings_window()
883+
# Always open the window immediately. VoiceSettingsWindow handles
884+
# asynchronous loading of ElevenLabs voices internally (see settings_window.py:110-111).
885+
self._show_settings_window()
901886

902887
def _show_settings_window(self):
903888
"""Creates and displays the actual settings window."""

settings_window.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ def _load_more_elevenlabs_voices(self):
334334
command=self._load_more_elevenlabs_voices
335335
)
336336
self.load_more_btn.pack(pady=10)
337+
338+
# Enable the newly added buttons
339+
self.after(100, self._enable_play_buttons)
340+
337341
elif not self.elevenlabs_voices_loaded:
338342
# Afficher un message de chargement seulement si rien n'est affiché
339343
if not self._elevenlabs_voices_displayed:

0 commit comments

Comments
 (0)