Skip to content

Commit

Permalink
Will start translation on settings dialog close
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus committed Dec 15, 2024
1 parent 4e46e41 commit d52d38a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,16 @@ def on_translate_button_clicked(self):
return

if self.transcription_options.llm_model == "" or self.transcription_options.llm_prompt == "":
self.transcription_options_dialog.accepted.connect(self.run_translation)

Check warning on line 286 in buzz/widgets/transcription_viewer/transcription_viewer_widget.py

View check run for this annotation

Codecov / codecov/patch

buzz/widgets/transcription_viewer/transcription_viewer_widget.py#L286

Added line #L286 was not covered by tests
self.transcription_options_dialog.show()
return

self.run_translation()

Check warning on line 290 in buzz/widgets/transcription_viewer/transcription_viewer_widget.py

View check run for this annotation

Codecov / codecov/patch

buzz/widgets/transcription_viewer/transcription_viewer_widget.py#L290

Added line #L290 was not covered by tests

def run_translation(self):
if self.transcription_options.llm_model == "" or self.transcription_options.llm_prompt == "":
return

Check warning on line 294 in buzz/widgets/transcription_viewer/transcription_viewer_widget.py

View check run for this annotation

Codecov / codecov/patch

buzz/widgets/transcription_viewer/transcription_viewer_widget.py#L293-L294

Added lines #L293 - L294 were not covered by tests

segments = self.table_widget.segments()
for segment in segments:
self.translator.enqueue(segment.value("text"), segment.value("id"))
Expand Down

0 comments on commit d52d38a

Please sign in to comment.