Compare commits

...

3 Commits

3 changed files with 71 additions and 4 deletions

71
main.go
View File

@ -3566,7 +3566,48 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
})
autoCompareCheck.SetChecked(state.autoCompare)
leftControls := container.NewHBox(resetBtn, autoCompareCheck)
// Load/Save config buttons
loadCfgBtn := widget.NewButton("Load Config", func() {
dialog.ShowFileOpen(func(reader fyne.URIReadCloser, err error) {
if err != nil || reader == nil {
return
}
path := reader.URI().Path()
reader.Close()
data, err := os.ReadFile(path)
if err != nil {
dialog.ShowError(fmt.Errorf("failed to read config: %w", err), state.window)
return
}
var cfg convertConfig
if err := json.Unmarshal(data, &cfg); err != nil {
dialog.ShowError(fmt.Errorf("failed to parse config: %w", err), state.window)
return
}
state.convert = cfg
state.showConvertView(state.source)
}, state.window)
})
saveCfgBtn := widget.NewButton("Save Config", func() {
dialog.ShowFileSave(func(writer fyne.URIWriteCloser, err error) {
if err != nil || writer == nil {
return
}
path := writer.URI().Path()
defer writer.Close()
data, err := json.MarshalIndent(state.convert, "", " ")
if err != nil {
dialog.ShowError(fmt.Errorf("failed to serialize config: %w", err), state.window)
return
}
if err := os.WriteFile(path, data, 0o644); err != nil {
dialog.ShowError(fmt.Errorf("failed to save config: %w", err), state.window)
return
}
}, state.window)
})
leftControls := container.NewHBox(resetBtn, loadCfgBtn, saveCfgBtn, autoCompareCheck)
centerStatus := container.NewHBox(activity, statusLabel)
rightControls := container.NewHBox(cancelBtn, viewLogBtn, addQueueBtn, convertBtn)
actionInner := container.NewBorder(nil, nil, leftControls, rightControls, centerStatus)
@ -7410,7 +7451,33 @@ func buildInspectView(state *appState) fyne.CanvasObject {
)
// Bottom bar with module color
bottomBar := ui.TintedBar(inspectColor, container.NewHBox(layout.NewSpacer()))
queueBtn := widget.NewButton("View Queue", func() {
state.showQueue()
})
statusLabel := widget.NewLabel("Idle")
statusLabel.Alignment = fyne.TextAlignCenter
updateInspectStatus := func() {
if state.convertBusy {
statusLabel.SetText(fmt.Sprintf("Active: %s", state.convertStatus))
} else {
statusLabel.SetText("Idle")
}
}
updateInspectStatus()
go func() {
ticker := time.NewTicker(500 * time.Millisecond)
defer ticker.Stop()
for range ticker.C {
fyne.CurrentApp().Driver().DoFromGoroutine(func() {
updateInspectStatus()
}, false)
// Optional stop condition could be added if needed
}
}()
bottomBar := ui.TintedBar(inspectColor, container.NewHBox(queueBtn, layout.NewSpacer(), statusLabel))
// Main content
content := container.NewBorder(

View File

@ -68,6 +68,6 @@ else
echo "Help: check the Go error messages above."
echo " - Undefined symbol/identifier: usually a missing variable or typo in source; see the referenced file:line."
echo " - \"C compiler not found\": install a C toolchain (e.g., build-essential on Ubuntu, Xcode CLT on macOS)."
echo " - Cache permission denied: run 'rm -rf ~/.cache/go-build' or 'chown -R $USER ~/.cache/go-build'."
echo " - Cache permission denied: run scripts/clear-go-cache.sh or 'rm -rf ~/.cache/go-build' / 'chown -R $USER ~/.cache/go-build'."
exit 1
fi

View File

@ -101,7 +101,7 @@ case "$OS" in
echo "Help: check the Go error messages above."
echo " - Undefined symbol/identifier: usually a missing variable or typo in source; see the referenced file:line."
echo " - \"C compiler not found\": install MinGW-w64 or MSYS2 toolchain so gcc is in PATH."
echo " - Cache permission denied: delete or chown the Go build cache (e.g., %LOCALAPPDATA%\\go-build on Windows)."
echo " - Cache permission denied: run scripts/clear-go-cache.sh or delete/chown the Go build cache (e.g., %LOCALAPPDATA%\\go-build on Windows)."
exit 1
fi
;;