diff options
Diffstat (limited to 'source/blender/windowmanager/intern')
4 files changed, 34 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index a6b8eb9d3fd..ee0c7df99e7 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1736,7 +1736,7 @@ void WM_event_remove_handlers(bContext *C, ListBase *handlers) wmWindow *win = CTX_wm_window(C); if (handler->is_fileselect) { - /* Exit File Browsers refering to this handler/operator. */ + /* Exit File Browsers referring to this handler/operator. */ LISTBASE_FOREACH (wmWindow *, temp_win, &wm->windows) { ScrArea *file_area = ED_fileselect_handler_area_find(temp_win, handler->op); if (!file_area) { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 19e4adde19c..4706287a3a9 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -2482,7 +2482,7 @@ void WM_OT_open_mainfile(wmOperatorType *ot) FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_boolean( ot->srna, "load_ui", true, "Load UI", "Load user interface setup in the .blend file"); @@ -2804,7 +2804,7 @@ void WM_OT_save_as_mainfile(wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_boolean(ot->srna, "compress", false, "Compress", "Write compressed .blend file"); RNA_def_boolean(ot->srna, "relative_remap", @@ -2874,7 +2874,7 @@ void WM_OT_save_mainfile(wmOperatorType *ot) FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); RNA_def_boolean(ot->srna, "compress", false, "Compress", "Write compressed .blend file"); RNA_def_boolean(ot->srna, "relative_remap", diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index cfbc037d19c..49ac250d9a3 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -598,7 +598,7 @@ void WM_OT_link(wmOperatorType *ot) WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_RELPATH | WM_FILESEL_FILES | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); wm_link_append_properties_common(ot, true); } @@ -622,7 +622,7 @@ void WM_OT_append(wmOperatorType *ot) WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_FILES | WM_FILESEL_SHOW_PROPS, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); wm_link_append_properties_common(ot, false); RNA_def_boolean(ot->srna, @@ -1172,7 +1172,7 @@ void WM_OT_lib_relocate(wmOperatorType *ot) WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_FILES | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); } static int wm_lib_reload_exec(bContext *C, wmOperator *op) @@ -1202,7 +1202,7 @@ void WM_OT_lib_reload(wmOperatorType *ot) WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, - FILE_SORT_ALPHA); + FILE_SORT_DEFAULT); } /** \} */ diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 62294d70306..87716a61c39 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -48,6 +48,30 @@ void WM_operator_properties_confirm_or_exec(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } +/** + * Extends rna_enum_fileselect_params_sort_items with a default item for operators to use. + */ +static const EnumPropertyItem *wm_operator_properties_filesel_sort_items_itemf( + struct bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) +{ + EnumPropertyItem *items; + const EnumPropertyItem default_item = { + FILE_SORT_DEFAULT, + "DEFAULT", + 0, + "Default", + "Automatically determine sort method for files", + }; + int totitem = 0; + + RNA_enum_item_add(&items, &totitem, &default_item); + RNA_enum_items_add(&items, &totitem, rna_enum_fileselect_params_sort_items); + RNA_enum_item_end(&items, &totitem); + *r_free = true; + + return items; +} + /* default properties for fileselect */ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, @@ -204,8 +228,8 @@ void WM_operator_properties_filesel(wmOperatorType *ot, prop = RNA_def_enum(ot->srna, "display_type", file_display_items, display, "Display Type", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - prop = RNA_def_enum( - ot->srna, "sort_method", rna_enum_file_sort_items, sort, "File sorting mode", ""); + prop = RNA_def_enum(ot->srna, "sort_method", DummyRNA_NULL_items, sort, "File sorting mode", ""); + RNA_def_enum_funcs(prop, wm_operator_properties_filesel_sort_items_itemf); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } |