Squash merge audio-player-component into main

This commit is contained in:
2026-02-13 20:39:23 -06:00
parent 9b7cfd5bd1
commit d78c0584e2
122 changed files with 11750 additions and 1175 deletions
+38
View File
@@ -0,0 +1,38 @@
// Package frontendutil provides Go functions bound to the frontend.
package frontendutil
import (
"context"
"fmt"
"github.com/wailsapp/wails/v2/pkg/runtime"
)
// FrontendUtil provides frontend-bound Go functions.
type FrontendUtil struct {
ctx context.Context
}
// NewFrontendUtil creates a new FrontendUtil instance.
func NewFrontendUtil() (*FrontendUtil, error) {
return &FrontendUtil{}, nil
}
// SetContext sets the Wails runtime context.
func (fe *FrontendUtil) SetContext(ctx context.Context) {
fe.ctx = ctx
}
// DirectoryPicker opens a directory selection dialog.
func (fe *FrontendUtil) DirectoryPicker() (string, error) {
runtime.LogInfo(fe.ctx, "selecting a directory")
dir, err := runtime.OpenDirectoryDialog(
fe.ctx,
runtime.OpenDialogOptions{})
if err != nil {
return "", fmt.Errorf("could not open directory dialog\n%w", err)
}
return dir, nil
}