mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 00:09:56 +08:00
[v2] Remove AllowFiles
& AllowDirectories
This commit is contained in:
parent
5884b7a87c
commit
efdcfe9985
@ -84,7 +84,7 @@ func (f *Frontend) openDialog(options *frontend.OpenDialogOptions, multiple bool
|
|||||||
|
|
||||||
// OpenFileDialog prompts the user to select a file
|
// OpenFileDialog prompts the user to select a file
|
||||||
func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, error) {
|
func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, error) {
|
||||||
results, err := f.openDialog(&options, false, options.AllowFiles, options.AllowDirectories)
|
results, err := f.openDialog(&options, false, true, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ func (f *Frontend) OpenFileDialog(options frontend.OpenDialogOptions) (string, e
|
|||||||
|
|
||||||
// OpenMultipleFilesDialog prompts the user to select a file
|
// OpenMultipleFilesDialog prompts the user to select a file
|
||||||
func (f *Frontend) OpenMultipleFilesDialog(options frontend.OpenDialogOptions) ([]string, error) {
|
func (f *Frontend) OpenMultipleFilesDialog(options frontend.OpenDialogOptions) ([]string, error) {
|
||||||
return f.openDialog(&options, true, options.AllowFiles, options.AllowDirectories)
|
return f.openDialog(&options, true, true, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveFileDialog prompts the user to select a file
|
// SaveFileDialog prompts the user to select a file
|
||||||
|
@ -19,8 +19,6 @@ type OpenDialogOptions struct {
|
|||||||
DefaultFilename string
|
DefaultFilename string
|
||||||
Title string
|
Title string
|
||||||
Filters []FileFilter
|
Filters []FileFilter
|
||||||
AllowFiles bool
|
|
||||||
AllowDirectories bool
|
|
||||||
ShowHiddenFiles bool
|
ShowHiddenFiles bool
|
||||||
CanCreateDirectories bool
|
CanCreateDirectories bool
|
||||||
ResolvesAliases bool
|
ResolvesAliases bool
|
||||||
|
@ -69,8 +69,6 @@ type OpenDialogOptions struct {
|
|||||||
DefaultFilename string
|
DefaultFilename string
|
||||||
Title string
|
Title string
|
||||||
Filters []FileFilter
|
Filters []FileFilter
|
||||||
AllowFiles bool
|
|
||||||
AllowDirectories bool
|
|
||||||
ShowHiddenFiles bool
|
ShowHiddenFiles bool
|
||||||
CanCreateDirectories bool
|
CanCreateDirectories bool
|
||||||
ResolvesAliases bool
|
ResolvesAliases bool
|
||||||
@ -83,8 +81,6 @@ type OpenDialogOptions struct {
|
|||||||
| DefaultFilename | The default filename | ✅ | ✅ |
|
| DefaultFilename | The default filename | ✅ | ✅ |
|
||||||
| Title | Title for the dialog | ✅ | ✅ |
|
| Title | Title for the dialog | ✅ | ✅ |
|
||||||
| [Filters](#filefilter) | A list of file filters | ✅ | ✅ |
|
| [Filters](#filefilter) | A list of file filters | ✅ | ✅ |
|
||||||
| AllowFiles | Allow files to be selected | | ✅ |
|
|
||||||
| AllowDirectories | Allow directories to be selected | | ✅ |
|
|
||||||
| ShowHiddenFiles | Show files hidden by the system | | ✅ |
|
| ShowHiddenFiles | Show files hidden by the system | | ✅ |
|
||||||
| CanCreateDirectories | Allow user to create directories | | ✅ |
|
| CanCreateDirectories | Allow user to create directories | | ✅ |
|
||||||
| ResolvesAliases | If true, returns the file not the alias | | ✅ |
|
| ResolvesAliases | If true, returns the file not the alias | | ✅ |
|
||||||
|
@ -63,8 +63,6 @@ type OpenDialogOptions struct {
|
|||||||
DefaultFilename string
|
DefaultFilename string
|
||||||
Title string
|
Title string
|
||||||
Filters []FileFilter
|
Filters []FileFilter
|
||||||
AllowFiles bool
|
|
||||||
AllowDirectories bool
|
|
||||||
ShowHiddenFiles bool
|
ShowHiddenFiles bool
|
||||||
CanCreateDirectories bool
|
CanCreateDirectories bool
|
||||||
ResolvesAliases bool
|
ResolvesAliases bool
|
||||||
@ -78,8 +76,6 @@ type OpenDialogOptions struct {
|
|||||||
| DefaultFilename | 默认文件名 | ✅ | ✅ |
|
| DefaultFilename | 默认文件名 | ✅ | ✅ |
|
||||||
| Title | 对话框的标题 | ✅ | ✅ |
|
| Title | 对话框的标题 | ✅ | ✅ |
|
||||||
| [Filters](#文件过滤) | 文件过滤器列表 | ✅ | ✅ |
|
| [Filters](#文件过滤) | 文件过滤器列表 | ✅ | ✅ |
|
||||||
| AllowFiles | 允许选择文件 | | ✅ |
|
|
||||||
| AllowDirectories | 允许选择目录 | | ✅ |
|
|
||||||
| ShowHiddenFiles | 显示系统隐藏的文件 | | ✅ |
|
| ShowHiddenFiles | 显示系统隐藏的文件 | | ✅ |
|
||||||
| CanCreateDirectories | 允许用户创建目录 | | ✅ |
|
| CanCreateDirectories | 允许用户创建目录 | | ✅ |
|
||||||
| ResolvesAliases | 如果为 true,则返回文件而不是别名 | | ✅ |
|
| ResolvesAliases | 如果为 true,则返回文件而不是别名 | | ✅ |
|
||||||
|
Loading…
Reference in New Issue
Block a user