Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix key error when loading output formats from settings #482

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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