diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-03-12 20:48:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-12 20:48:32 +0100 |
commit | 71da4c4132904d8efb793010c5b5301085e8e917 (patch) | |
tree | f95164efcb6dc4361b916d2bcc3045e003666eee | |
parent | d7019de7e3c416e5492d1508b39c9b25adc2483a (diff) | |
parent | 2ad6e11b787fe03994197477033b62ac95cde762 (diff) |
Merge pull request #54399 from Calinou/filedialog-current-properties-hint-no-editor
Don't store and show current file/directory/path FileDialog properties
-rw-r--r-- | doc/classes/EditorFileDialog.xml | 6 | ||||
-rw-r--r-- | doc/classes/FileDialog.xml | 6 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 6 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 0474cbd387..b1fd7b4e76 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -40,13 +40,13 @@ <member name="access" type="int" setter="set_access" getter="get_access" enum="EditorFileDialog.Access" default="0"> The location from which the user may select a file, including [code]res://[/code], [code]user://[/code], and the local file system. </member> - <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default=""res://""> + <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir"> The currently occupied directory. </member> - <member name="current_file" type="String" setter="set_current_file" getter="get_current_file" default=""""> + <member name="current_file" type="String" setter="set_current_file" getter="get_current_file"> The currently selected file. </member> - <member name="current_path" type="String" setter="set_current_path" getter="get_current_path" default=""res://""> + <member name="current_path" type="String" setter="set_current_path" getter="get_current_path"> The file system path in the address bar. </member> <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" overrides="AcceptDialog" default="false" /> diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index 05d90390f8..db536a738a 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -56,13 +56,13 @@ The file system access scope. See enum [code]Access[/code] constants. [b]Warning:[/b] Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url]. </member> - <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir" default=""res://""> + <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir"> The current working directory of the file dialog. </member> - <member name="current_file" type="String" setter="set_current_file" getter="get_current_file" default=""""> + <member name="current_file" type="String" setter="set_current_file" getter="get_current_file"> The currently selected file of the file dialog. </member> - <member name="current_path" type="String" setter="set_current_path" getter="get_current_path" default=""res://""> + <member name="current_path" type="String" setter="set_current_path" getter="get_current_path"> The currently selected file path of the file dialog. </member> <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" overrides="AcceptDialog" default="false" /> diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index a45792022c..236910eee7 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1471,9 +1471,9 @@ void EditorFileDialog::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access"); ADD_PROPERTY(PropertyInfo(Variant::INT, "display_mode", PROPERTY_HINT_ENUM, "Thumbnails,List"), "set_display_mode", "get_display_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "file_mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"), "set_file_mode", "get_file_mode"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir", PROPERTY_HINT_DIR), "set_current_dir", "get_current_dir"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file", PROPERTY_HINT_FILE, "*"), "set_current_file", "get_current_file"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path"), "set_current_path", "get_current_path"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir", PROPERTY_HINT_DIR, "", PROPERTY_USAGE_NONE), "set_current_dir", "get_current_dir"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file", PROPERTY_HINT_FILE, "*", PROPERTY_USAGE_NONE), "set_current_file", "get_current_file"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_current_path", "get_current_path"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_hidden_files"), "set_show_hidden_files", "is_showing_hidden_files"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_overwrite_warning"), "set_disable_overwrite_warning", "is_overwrite_warning_disabled"); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 75bed61042..e71ab64535 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -919,9 +919,9 @@ void FileDialog::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"), "set_access", "get_access"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "filters"), "set_filters", "get_filters"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_hidden_files"), "set_show_hidden_files", "is_showing_hidden_files"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir"), "set_current_dir", "get_current_dir"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file"), "set_current_file", "get_current_file"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path"), "set_current_path", "get_current_path"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_dir", PROPERTY_HINT_DIR, "", PROPERTY_USAGE_NONE), "set_current_dir", "get_current_dir"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_file", PROPERTY_HINT_FILE, "*", PROPERTY_USAGE_NONE), "set_current_file", "get_current_file"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "current_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_current_path", "get_current_path"); ADD_SIGNAL(MethodInfo("file_selected", PropertyInfo(Variant::STRING, "path"))); ADD_SIGNAL(MethodInfo("files_selected", PropertyInfo(Variant::PACKED_STRING_ARRAY, "paths"))); |