diff options
author | Nick White <git@njw.name> | 2022-03-21 17:31:32 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2022-03-21 17:31:32 +0000 |
commit | e2b8e8fd0be69ffb3256696b534cc226660aa7b3 (patch) | |
tree | 478158ac8b55342238e03ad57be0612808633b0d /cmd/rescribe/gui.go | |
parent | 63b6942f6b2649c70c30cdced6c033ff2607724f (diff) |
rescribe: fix bug in gui where choosing "other" then cancelling would leave the "other" training selected
Diffstat (limited to 'cmd/rescribe/gui.go')
-rw-r--r-- | cmd/rescribe/gui.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go index a9d5fbb..f96a342 100644 --- a/cmd/rescribe/gui.go +++ b/cmd/rescribe/gui.go @@ -128,6 +128,7 @@ func trainingSelectOnChange(sel *widget.Select, parent fyne.Window) func(string) } d := dialog.NewFileOpen(func(uri fyne.URIReadCloser, err error) { if err != nil || uri == nil { + sel.SetSelectedIndex(0) return } defer uri.Close() @@ -136,12 +137,14 @@ func trainingSelectOnChange(sel *widget.Select, parent fyne.Window) func(string) f, err := os.Create(newpath) if err != nil { // TODO: surface error somewhere, prob with a dialog box + sel.SetSelectedIndex(0) return } defer f.Close() _, err = io.Copy(f, uri) if err != nil { // TODO: surface error somewhere, prob with a dialog box + sel.SetSelectedIndex(0) return } |