diff --git a/.gitignore b/.gitignore index ae6087e..4c90a36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .vscode/ bin/ examples/ -cpms.exe \ No newline at end of file + +cpms.exe +config.yaml \ No newline at end of file diff --git a/config.yaml b/config.yaml index 2ba6c9c..bdb2be6 100644 --- a/config.yaml +++ b/config.yaml @@ -1,2 +1,2 @@ -profiles_root: "" -archive_root: "" +profiles_root: E:/GoWork/cpms/examples/profiles +archive_root: E:/GoWork/cpms/examples/archive diff --git a/cpms.exe b/cpms.exe index 7d68bf6..291d8f4 100644 Binary files a/cpms.exe and b/cpms.exe differ diff --git a/main.go b/main.go index 023835c..d48f743 100644 --- a/main.go +++ b/main.go @@ -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() {