IDK man, changes I guess

This commit is contained in:
2026-11-06 17:57:01 +00:00
parent f6ac9c2f34
commit 8e9bc500fa
15 changed files with 785 additions and 61 deletions

View File

@@ -98,7 +98,7 @@ $owner.ShowInTaskbar = $false
const psOpenDialog = psDialogPrelude + `
$d = New-Object System.Windows.Forms.OpenFileDialog
$d.Title = $env:VIBEDIT_TITLE
$d.Multiselect = $true
$d.Multiselect = ($env:VIBEDIT_MULTI -eq '1')
$d.Filter = $env:VIBEDIT_FILTER
if ($env:VIBEDIT_DIR -and (Test-Path -LiteralPath $env:VIBEDIT_DIR -PathType Container)) { $d.InitialDirectory = $env:VIBEDIT_DIR }
if ($d.ShowDialog($owner) -eq [System.Windows.Forms.DialogResult]::OK) {
@@ -148,18 +148,23 @@ func runPowerShell(script string, env map[string]string) ([]string, error) {
return lines, nil
}
func videoFilter() string {
func fileFilter(k fileKind) string {
var pats []string
for _, e := range mediaExts {
for _, e := range k.Exts {
pats = append(pats, "*."+e)
}
return "Video files|" + strings.Join(pats, ";") + "|All files|*.*"
return k.Label + "|" + strings.Join(pats, ";") + "|All files|*.*"
}
func nativeOpenDialog(title, dir string) ([]string, error) {
func nativeOpenDialog(k fileKind, dir string) ([]string, error) {
multi := "0"
if k.Multiple {
multi = "1"
}
return runPowerShell(psOpenDialog, map[string]string{
"VIBEDIT_TITLE": title,
"VIBEDIT_FILTER": videoFilter(),
"VIBEDIT_TITLE": k.Title,
"VIBEDIT_FILTER": fileFilter(k),
"VIBEDIT_MULTI": multi,
"VIBEDIT_DIR": dir,
})
}