Support OpenDialog

This commit is contained in:
Lea Anthony
2020-09-26 16:08:55 +10:00
parent bed5619d4e
commit 9b0f58ddf5
6 changed files with 15 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ type Renderer interface {
// Dialog Runtime
SelectFile(title string, filter string) string
SelectDirectory() []string
OpenDialog() []string
SelectSaveFile(title string, filter string) string
// Window Runtime

View File

@@ -119,10 +119,10 @@ func (h *Bridge) SelectFile(title string, filter string) string {
return ""
}
// SelectDirectory is unsupported for Bridge but required
// OpenDialog is unsupported for Bridge but required
// for the Renderer interface
func (h *Bridge) SelectDirectory() string {
h.log.Warn("SelectDirectory() unsupported in bridge mode")
func (h *Bridge) OpenDialog() string {
h.log.Warn("OpenDialog() unsupported in bridge mode")
return ""
}

View File

@@ -263,8 +263,8 @@ func (w *WebView) SelectFile(title string, filter string) string {
return result
}
// SelectDirectory opens a dialog that allows the user to select a directory
func (w *WebView) SelectDirectory() []string {
// OpenDialog opens a dialog that allows the user to select a directory
func (w *WebView) OpenDialog() []string {
var result string
// We need to run this on the main thread, however Dispatch is
// non-blocking so we launch this in a goroutine and wait for