P4.2: Add Browse button for Command field in job dialog
Add chooseFile helper (dialog.NewFileOpen) in settings_view.go and wrap the Command entry in job_dialog.go with a Browse button so users can pick an executable from a file picker instead of typing the path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -172,6 +172,17 @@ func mustParseURL(raw string) *url.URL {
|
||||
return parsed
|
||||
}
|
||||
|
||||
func chooseFile(w fyne.Window, target *widget.Entry) {
|
||||
fileDialog := dialog.NewFileOpen(func(uri fyne.URIReadCloser, err error) {
|
||||
if err != nil || uri == nil {
|
||||
return
|
||||
}
|
||||
target.SetText(uri.URI().Path())
|
||||
}, w)
|
||||
fileDialog.Resize(fyne.NewSize(900, 640))
|
||||
fileDialog.Show()
|
||||
}
|
||||
|
||||
func chooseFolder(w fyne.Window, target *widget.Entry) {
|
||||
folderDialog := dialog.NewFolderOpen(func(uri fyne.ListableURI, err error) {
|
||||
if err != nil || uri == nil {
|
||||
|
||||
Reference in New Issue
Block a user