| 46 | namespace app { |
| 47 | |
| 48 | static void CardinalModuleWidget__saveSelectionDialog(RackWidget* const w) |
| 49 | { |
| 50 | std::string selectionDir = asset::user("selections"); |
| 51 | system::createDirectories(selectionDir); |
| 52 | |
| 53 | async_dialog_filebrowser(true, "selection.vcvs", selectionDir.c_str(), |
| 54 | #ifdef DISTRHO_OS_WASM |
| 55 | "Save selection", |
| 56 | #else |
| 57 | "Save selection as...", |
| 58 | #endif |
| 59 | [w](char* pathC) { |
| 60 | if (!pathC) { |
| 61 | // No path selected |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | std::string path = pathC; |
| 66 | std::free(pathC); |
| 67 | |
| 68 | // Automatically append .vcvs extension |
| 69 | if (system::getExtension(path) != ".vcvs") |
| 70 | path += ".vcvs"; |
| 71 | |
| 72 | w->saveSelection(path); |
| 73 | }); |
| 74 | } |
| 75 | |
| 76 | } |
| 77 | } |
no test coverage detected