| 1015 | } |
| 1016 | |
| 1017 | void loadSelectionDialog() |
| 1018 | { |
| 1019 | app::RackWidget* const w = APP->scene->rack; |
| 1020 | |
| 1021 | std::string selectionDir = asset::user("selections"); |
| 1022 | system::createDirectories(selectionDir); |
| 1023 | |
| 1024 | async_dialog_filebrowser(false, nullptr, selectionDir.c_str(), "Import selection", [w](char* pathC) { |
| 1025 | if (!pathC) { |
| 1026 | // No path selected |
| 1027 | return; |
| 1028 | } |
| 1029 | |
| 1030 | try { |
| 1031 | w->loadSelection(pathC); |
| 1032 | } |
| 1033 | catch (Exception& e) { |
| 1034 | async_dialog_message(e.what()); |
| 1035 | } |
| 1036 | |
| 1037 | std::free(pathC); |
| 1038 | |
| 1039 | #ifdef DISTRHO_OS_WASM |
| 1040 | syncfs(); |
| 1041 | #endif |
| 1042 | |
| 1043 | if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote()) |
| 1044 | if (remoteDetails->autoDeploy) |
| 1045 | remoteUtils::sendFullPatchToRemote(remoteDetails); |
| 1046 | }); |
| 1047 | } |
| 1048 | |
| 1049 | void loadTemplate(const bool factory) |
| 1050 | { |
nothing calls this directly
no test coverage detected