Add FFmpeg utilities configuration UI and automated downloading
Introduce a new UI for configuring FFmpeg, FFprobe, and FFplay paths with file selection and error handling. Add platform-specific logic for downloading and extracting FFmpeg binaries directly within the application, improving user experience.
This commit is contained in:
11
internal/utils/dialog.go
Normal file
11
internal/utils/dialog.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
)
|
||||
|
||||
func FileDialogResize(fileDialog *dialog.FileDialog, w fyne.Window) {
|
||||
contentSize := w.Content().Size()
|
||||
fileDialog.Resize(fyne.Size{Width: contentSize.Width - 50, Height: contentSize.Height - 50})
|
||||
}
|
8
internal/utils/path_separator.go
Normal file
8
internal/utils/path_separator.go
Normal file
@@ -0,0 +1,8 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package utils
|
||||
|
||||
func PathSeparator() string {
|
||||
return "/"
|
||||
}
|
8
internal/utils/path_separator_window.go
Normal file
8
internal/utils/path_separator_window.go
Normal file
@@ -0,0 +1,8 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package utils
|
||||
|
||||
func PathSeparator() string {
|
||||
return "\\"
|
||||
}
|
12
internal/utils/prepare_background_command.go
Normal file
12
internal/utils/prepare_background_command.go
Normal file
@@ -0,0 +1,12 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func PrepareBackgroundCommand(cmd *exec.Cmd) {
|
||||
|
||||
}
|
13
internal/utils/prepare_background_command_windows.go
Normal file
13
internal/utils/prepare_background_command_windows.go
Normal file
@@ -0,0 +1,13 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func PrepareBackgroundCommand(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
|
||||
}
|
21
internal/utils/text.go
Normal file
21
internal/utils/text.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
"image/color"
|
||||
)
|
||||
|
||||
func SetStringErrorStyle(text *canvas.Text) {
|
||||
fyne.Do(func() {
|
||||
text.Color = color.RGBA{R: 255, G: 0, B: 0, A: 255}
|
||||
text.Refresh()
|
||||
})
|
||||
}
|
||||
|
||||
func SetStringSuccessStyle(text *canvas.Text) {
|
||||
fyne.Do(func() {
|
||||
text.Color = color.RGBA{R: 49, G: 127, B: 114, A: 255}
|
||||
text.Refresh()
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user