Skip to content

Commit

Permalink
Fix key error when loading output formats from settings (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidiwilliams authored Jun 5, 2023
1 parent 162c203 commit d63ccb9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions buzz/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ def __init__(self, file_paths: List[str], parent: Optional[QWidget] = None,
default_value=DEFAULT_WHISPER_TEMPERATURE),
word_level_timings=self.settings.value(key=Settings.Key.FILE_TRANSCRIBER_WORD_LEVEL_TIMINGS,
default_value=False))
default_export_format_states: List[str] = self.settings.value(key=Settings.Key.FILE_TRANSCRIBER_EXPORT_FORMATS,
default_value=[])
self.file_transcription_options = FileTranscriptionOptions(
file_paths=self.file_paths)
file_paths=self.file_paths,
output_formats=set([OutputFormat(output_format) for output_format in default_export_format_states]))

layout = QVBoxLayout(self)

Expand All @@ -221,11 +224,9 @@ def __init__(self, file_paths: List[str], parent: Optional[QWidget] = None,
file_transcription_layout.addRow('', self.word_level_timings_checkbox)

export_format_layout = QHBoxLayout()
default_export_format_states: List[str] = self.settings.value(key=Settings.Key.FILE_TRANSCRIBER_EXPORT_FORMATS,
default_value=[])
for output_format in OutputFormat:
export_format_checkbox = QCheckBox(f'{output_format.value.upper()}', parent=self)
export_format_checkbox.setChecked(output_format.value in default_export_format_states)
export_format_checkbox.setChecked(output_format in self.file_transcription_options.output_formats)
export_format_checkbox.stateChanged.connect(self.get_on_checkbox_state_changed_callback(output_format))
export_format_layout.addWidget(export_format_checkbox)

Expand Down

0 comments on commit d63ccb9

Please sign in to comment.