1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #108146 from KoBeWi/singleton_favrec

Expose methods to access FileDialog's favorite/recent lists
This commit is contained in:
Thaddeus Crews
2025-09-30 18:35:26 -05:00
3 changed files with 97 additions and 0 deletions

View File

@@ -47,6 +47,12 @@
Clear all currently selected items in the dialog.
</description>
</method>
<method name="get_favorite_list" qualifiers="static">
<return type="PackedStringArray" />
<description>
Returns the list of favorite directories, which is shared by all [FileDialog] nodes. Useful to store the list of favorites between project sessions. This method can be called only from the main thread.
</description>
</method>
<method name="get_line_edit">
<return type="LineEdit" />
<description>
@@ -75,6 +81,12 @@
Returns an array of values of the [OptionButton] with index [param option].
</description>
</method>
<method name="get_recent_list" qualifiers="static">
<return type="PackedStringArray" />
<description>
Returns the list of recent directories, which is shared by all [FileDialog] nodes. Useful to store the list of recents between project sessions. This method can be called only from the main thread.
</description>
</method>
<method name="get_selected_options" qualifiers="const">
<return type="Dictionary" />
<description>
@@ -111,6 +123,14 @@
Toggles the specified customization [param flag], allowing to customize features available in this [FileDialog]. See [enum Customization] for options.
</description>
</method>
<method name="set_favorite_list" qualifiers="static">
<return type="void" />
<param index="0" name="favorites" type="PackedStringArray" />
<description>
Sets the list of favorite directories, which is shared by all [FileDialog] nodes. Useful to restore the list of favorites saved with [method get_favorite_list]. This method can be called only from the main thread.
[b]Note:[/b] [FileDialog] will update its internal [ItemList] of favorites when its visibility changes. Be sure to call this method earlier if you want your changes to have effect.
</description>
</method>
<method name="set_option_default">
<return type="void" />
<param index="0" name="option" type="int" />
@@ -135,6 +155,14 @@
Sets the option values of the [OptionButton] with index [param option].
</description>
</method>
<method name="set_recent_list" qualifiers="static">
<return type="void" />
<param index="0" name="recents" type="PackedStringArray" />
<description>
Sets the list of recent directories, which is shared by all [FileDialog] nodes. Useful to restore the list of recents saved with [method set_recent_list]. This method can be called only from the main thread.
[b]Note:[/b] [FileDialog] will update its internal [ItemList] of recent directories when its visibility changes. Be sure to call this method earlier if you want your changes to have effect.
</description>
</method>
</methods>
<members>
<member name="access" type="int" setter="set_access" getter="get_access" enum="FileDialog.Access" default="0">