stuff
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
bin/
|
bin/
|
||||||
examples/
|
examples/
|
||||||
cpms.exe
|
|
||||||
|
cpms.exe
|
||||||
|
config.yaml
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
profiles_root: ""
|
profiles_root: E:/GoWork/cpms/examples/profiles
|
||||||
archive_root: ""
|
archive_root: E:/GoWork/cpms/examples/archive
|
||||||
|
|||||||
25
main.go
25
main.go
@@ -11,7 +11,6 @@ import (
|
|||||||
"fyne.io/fyne/v2/app"
|
"fyne.io/fyne/v2/app"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
"fyne.io/fyne/v2/dialog"
|
"fyne.io/fyne/v2/dialog"
|
||||||
"fyne.io/fyne/v2/storage"
|
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
@@ -84,7 +83,7 @@ func main() {
|
|||||||
container := container.NewVBox(
|
container := container.NewVBox(
|
||||||
widget.NewForm(widget.NewFormItem("Profiles Directory", profilesrootentry)),
|
widget.NewForm(widget.NewFormItem("Profiles Directory", profilesrootentry)),
|
||||||
widget.NewButtonWithIcon("Select", theme.FolderIcon(), func() {
|
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 {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
@@ -95,19 +94,11 @@ func main() {
|
|||||||
cfg.ProfilesRoot = lu.Path()
|
cfg.ProfilesRoot = lu.Path()
|
||||||
saveConfig(*cfg)
|
saveConfig(*cfg)
|
||||||
fillGrid(grid, wp)
|
fillGrid(grid, wp)
|
||||||
}, wp)
|
}, wp).Show()
|
||||||
l, err := storage.ListerForURI(storage.NewFileURI("."))
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
}
|
|
||||||
if l != nil {
|
|
||||||
d.SetLocation(l)
|
|
||||||
}
|
|
||||||
d.Show()
|
|
||||||
}),
|
}),
|
||||||
widget.NewForm(widget.NewFormItem("Archive Directory", archiverootentry)),
|
widget.NewForm(widget.NewFormItem("Archive Directory", archiverootentry)),
|
||||||
widget.NewButtonWithIcon("Select", theme.FolderIcon(), func() {
|
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 {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
@@ -118,15 +109,7 @@ func main() {
|
|||||||
cfg.ArchiveRoot = lu.Path()
|
cfg.ArchiveRoot = lu.Path()
|
||||||
saveConfig(*cfg)
|
saveConfig(*cfg)
|
||||||
fillGrid(grid, wp)
|
fillGrid(grid, wp)
|
||||||
}, wp)
|
}, wp).Show()
|
||||||
l, err := storage.ListerForURI(storage.NewFileURI("."))
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
}
|
|
||||||
if l != nil {
|
|
||||||
d.SetLocation(l)
|
|
||||||
}
|
|
||||||
d.Show()
|
|
||||||
}),
|
}),
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
widget.NewButton("Reload Profiles", func() {
|
widget.NewButton("Reload Profiles", func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user