Skip to content

Clone your own voice on your own computer: speak any text in 60+ languages and dub videos into another language in your voice. Fully local. Early version.

fix(app): Redub's settings cannot be changed while a job runs (#158)

Taras Hevlich4e440c68fd23
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 360ac28..549fbe3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,9 @@
## Unreleased
+* **Redub's settings cannot be opened while a job runs:** *Change* on Transcription, Output and Accent is gone until
+ it ends, and an open popover closes.
+
* **Redub remembers your work:** the file, the transcript with your edits, its language and the photos come back after
the app restarts.
* **Subtitle times can be edited** in Video with subtitles: each line's start and end are fields (`0:29.4`), and its
diff --git a/crates/desktop/src/ui/redub.rs b/crates/desktop/src/ui/redub.rs
index f862428..43d100f 100644
--- a/crates/desktop/src/ui/redub.rs
+++ b/crates/desktop/src/ui/redub.rs
@@ -675,7 +675,10 @@ fn fold_key(r: &RedubState) -> &'static str {
pub fn fold_overlay(s: &AppState, p: Palette) -> Option<El> {
let r = &s.redub;
- let which = r.fold.filter(|_| s.screen == Screen::Redub && r.file.is_some() && r.mode != RedubMode::Convert)?;
+ // While a job runs its settings cannot change: an open popover closes.
+ let which = r
+ .fold
+ .filter(|_| s.screen == Screen::Redub && r.file.is_some() && r.mode != RedubMode::Convert && !r.busy())?;
let key = fold_key(r);
let (anchor, body) = match which {
Fold::Accent => (format!("{key}-accent-head"), speak::accent_block(s, p, &format!("{key}-accent"))),
@@ -768,7 +771,7 @@ fn accent_section(s: &AppState, p: Palette, key: &str) -> El {
"Accent",
&speak::accent_summary(s),
s.redub.fold == Some(Fold::Accent),
- false,
+ s.redub.busy(),
Fold::Accent,
)
}
@@ -791,7 +794,7 @@ fn output_section(s: &AppState, p: Palette, key: &str) -> El {
"Output",
&what.join(" · "),
r.fold == Some(Fold::Output),
- false,
+ r.busy(),
Fold::Output,
)
}
@@ -2243,7 +2246,7 @@ fn respeak_block(s: &AppState, p: Palette) -> El {
"Transcription",
&summary,
r.fold == Some(Fold::Transcription),
- pinned,
+ pinned || r.busy(),
Fold::Transcription,
));
if pinned {
@@ -2293,7 +2296,7 @@ fn subtitles_only_block(s: &AppState, p: Palette) -> El {
"Transcription",
&heard_label(r),
r.fold == Some(Fold::Transcription),
- pinned,
+ pinned || r.busy(),
Fold::Transcription,
));
if pinned {