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:
@@ -3,15 +3,18 @@ package window
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/application"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/utils"
|
||||
)
|
||||
|
||||
type MainWindowContract interface {
|
||||
type WindowContract interface {
|
||||
SetContent(content fyne.CanvasObject)
|
||||
Show()
|
||||
InitLayout()
|
||||
NewFileOpen(callback func(fyne.URIReadCloser, error), location fyne.ListableURI) *dialog.FileDialog
|
||||
}
|
||||
|
||||
type mainWindow struct {
|
||||
@@ -20,7 +23,7 @@ type mainWindow struct {
|
||||
progressBarService application.ProgressBarContract
|
||||
}
|
||||
|
||||
func NewMainWindow(fyneWindow fyne.Window, progressBarService application.ProgressBarContract) MainWindowContract {
|
||||
func NewMainWindow(fyneWindow fyne.Window, progressBarService application.ProgressBarContract) WindowContract {
|
||||
fyneWindow.Resize(fyne.Size{Width: 1039, Height: 599})
|
||||
fyneWindow.CenterOnScreen()
|
||||
|
||||
@@ -40,6 +43,16 @@ func (w *mainWindow) InitLayout() {
|
||||
})
|
||||
}
|
||||
|
||||
func (w *mainWindow) NewFileOpen(callback func(fyne.URIReadCloser, error), location fyne.ListableURI) *dialog.FileDialog {
|
||||
fileDialog := dialog.NewFileOpen(callback, w.fyneWindow)
|
||||
utils.FileDialogResize(fileDialog, w.fyneWindow)
|
||||
fileDialog.Show()
|
||||
if location != nil {
|
||||
fileDialog.SetLocation(location)
|
||||
}
|
||||
return fileDialog
|
||||
}
|
||||
|
||||
func (w *mainWindow) SetContent(content fyne.CanvasObject) {
|
||||
fyne.Do(func() {
|
||||
if w.layout == nil {
|
||||
|
Reference in New Issue
Block a user