From fc0af420c64c703b06c165ce347375eb88a76aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20=C5=9Eafak?= Date: Fri, 9 Jan 2026 01:19:39 +0300 Subject: [PATCH] Handle empty voice list initially --- abogen/pyqt/voice_formula_gui.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/abogen/pyqt/voice_formula_gui.py b/abogen/pyqt/voice_formula_gui.py index 11f717d..b6fb06f 100644 --- a/abogen/pyqt/voice_formula_gui.py +++ b/abogen/pyqt/voice_formula_gui.py @@ -554,9 +554,6 @@ class VoiceFormulaDialog(QDialog): ok_button.setDefault(True) ok_button.setFocus() - # Connect buttons - clear_all_button.clicked.connect(self.clear_all_voices) - ok_button.clicked.connect(self.accept) # Connect buttons clear_all_button.clicked.connect(self.clear_all_voices) ok_button.clicked.connect(self.accept) @@ -590,6 +587,9 @@ class VoiceFormulaDialog(QDialog): for vm in self.voice_mixers: vm.spin_box.valueChanged.connect(self.mark_profile_modified) vm.checkbox.stateChanged.connect(lambda *_: self.mark_profile_modified()) + + # Update profile colors on initialization to show status + self.update_profile_list_colors() def keyPressEvent(self, event): # Bind Delete key to delete_profile when a profile is selected @@ -877,6 +877,8 @@ class VoiceFormulaDialog(QDialog): else: state = profiles.get(name, {}) voices = state.get("voices") if isinstance(state, dict) else state + if voices is None: + voices = [] lang = state.get("language") if isinstance(state, dict) else None # apply language selection if lang: