From 0cc1488f70da0f4febc659dc864d0fa0c5e72133 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Wed, 10 Dec 2025 15:22:26 -0500 Subject: [PATCH] Prompt before overwriting existing outputs --- main.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.go b/main.go index 3e53d30..d887fa7 100644 --- a/main.go +++ b/main.go @@ -6402,6 +6402,21 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But outPath = filepath.Join(outDir, "converted-"+outName) } + // Guard against overwriting an existing file without confirmation + if _, err := os.Stat(outPath); err == nil { + confirm := make(chan bool, 1) + fyne.CurrentApp().Driver().DoFromGoroutine(func() { + msg := fmt.Sprintf("Output file already exists:\n%s\n\nOverwrite it?", outPath) + dialog.ShowConfirm("Overwrite File?", msg, func(ok bool) { + confirm <- ok + }, s.window) + }, false) + if ok := <-confirm; !ok { + setStatus("Cancelled (existing output)") + return + } + } + args := []string{ "-y", "-hide_banner",