mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 10:50:53 -07:00
Support OpenDialog
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ""
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user