UI: expose the custom directory as a path property

Support changing the directory from the new repository dialog since it
no longer crashes.
This commit is contained in:
Campbell Barton
2024-02-06 14:40:16 +11:00
parent f1a440abb6
commit 2bbb460c10

View File

@@ -375,14 +375,12 @@ static void PREFERENCES_OT_extension_repo_add(wmOperatorType *ot)
prop = RNA_def_boolean(ot->srna, "use_custom_directory", false, "Custom Directory", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* WARNING: `RNA_def_string_dir_path` should be used but the file selector crashes from
* #WM_operator_props_popup_confirm as it closes the popup before showing the file-selector. */
prop = RNA_def_string(ot->srna,
"custom_directory",
nullptr,
sizeof(bUserExtensionRepo::remote_path),
"Directory",
"");
prop = RNA_def_string_dir_path(ot->srna,
"custom_directory",
nullptr,
sizeof(bUserExtensionRepo::remote_path),
"Directory",
"");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
ot->prop = RNA_def_enum(