diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2021-03-30 15:42:50 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-07-12 22:36:24 +0300 |
commit | 4790da7900bac721cb6650dfa873800d53a67739 (patch) | |
tree | 8a37a5b72fa7a8b441ad1d6adba3bbda19b3d75e /platform/macos/export | |
parent | 60f3b7967cbd00b4e1f52d33d372646f7bec02f6 (diff) | |
download | redot-engine-4790da7900bac721cb6650dfa873800d53a67739.tar.gz |
[macOS] Implement optional native file selection dialog support for sandboxed apps.
Diffstat (limited to 'platform/macos/export')
-rw-r--r-- | platform/macos/export/export_plugin.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 0dc6d0dcee..a3ba31a5d9 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -425,6 +425,7 @@ void EditorExportPlatformMacOS::get_export_options(List<ExportOption> *r_options r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/entitlements/app_sandbox/files_pictures", PROPERTY_HINT_ENUM, "No,Read-only,Read-write"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/entitlements/app_sandbox/files_music", PROPERTY_HINT_ENUM, "No,Read-only,Read-write"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/entitlements/app_sandbox/files_movies", PROPERTY_HINT_ENUM, "No,Read-only,Read-write"), 0)); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/entitlements/app_sandbox/files_user_selected", PROPERTY_HINT_ENUM, "No,Read-only,Read-write"), 0)); r_options->push_back(ExportOption(PropertyInfo(Variant::ARRAY, "codesign/entitlements/app_sandbox/helper_executables", PROPERTY_HINT_ARRAY_TYPE, itos(Variant::STRING) + "/" + itos(PROPERTY_HINT_GLOBAL_FILE) + ":"), Array())); r_options->push_back(ExportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "codesign/custom_options"), PackedStringArray())); @@ -1922,6 +1923,14 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p ent_f->store_line("<key>com.apple.security.files.movies.read-write</key>"); ent_f->store_line("<true/>"); } + if ((int)p_preset->get("codesign/entitlements/app_sandbox/files_user_selected") == 1) { + ent_f->store_line("<key>com.apple.security.files.user-selected.read-only</key>"); + ent_f->store_line("<true/>"); + } + if ((int)p_preset->get("codesign/entitlements/app_sandbox/files_user_selected") == 2) { + ent_f->store_line("<key>com.apple.security.files.user-selected.read-write</key>"); + ent_f->store_line("<true/>"); + } } ent_f->store_line("</dict>"); |