This commit is contained in:
2023-07-28 15:42:37 -05:00
parent 08c2a4de57
commit 6dcdd7875f
4 changed files with 9 additions and 24 deletions

25
main.go
View File

@@ -11,7 +11,6 @@ import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"gopkg.in/yaml.v3"
@@ -84,7 +83,7 @@ func main() {
container := container.NewVBox(
widget.NewForm(widget.NewFormItem("Profiles Directory", profilesrootentry)),
widget.NewButtonWithIcon("Select", theme.FolderIcon(), func() {
d := dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) {
dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) {
if err != nil {
fmt.Println(err)
}
@@ -95,19 +94,11 @@ func main() {
cfg.ProfilesRoot = lu.Path()
saveConfig(*cfg)
fillGrid(grid, wp)
}, wp)
l, err := storage.ListerForURI(storage.NewFileURI("."))
if err != nil {
fmt.Println(err)
}
if l != nil {
d.SetLocation(l)
}
d.Show()
}, wp).Show()
}),
widget.NewForm(widget.NewFormItem("Archive Directory", archiverootentry)),
widget.NewButtonWithIcon("Select", theme.FolderIcon(), func() {
d := dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) {
dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) {
if err != nil {
fmt.Println(err)
}
@@ -118,15 +109,7 @@ func main() {
cfg.ArchiveRoot = lu.Path()
saveConfig(*cfg)
fillGrid(grid, wp)
}, wp)
l, err := storage.ListerForURI(storage.NewFileURI("."))
if err != nil {
fmt.Println(err)
}
if l != nil {
d.SetLocation(l)
}
d.Show()
}, wp).Show()
}),
widget.NewSeparator(),
widget.NewButton("Reload Profiles", func() {