| 967 | #endif |
| 968 | |
| 969 | void loadDialog() |
| 970 | { |
| 971 | #ifndef HEADLESS_BEHAVIOUR |
| 972 | promptClear("The current patch is unsaved. Clear it and open a new patch?", []() { |
| 973 | std::string dir; |
| 974 | if (! APP->patch->path.empty()) |
| 975 | dir = system::getDirectory(APP->patch->path); |
| 976 | else |
| 977 | dir = homeDir(); |
| 978 | |
| 979 | CardinalPluginContext* const pcontext = static_cast<CardinalPluginContext*>(APP); |
| 980 | DISTRHO_SAFE_ASSERT_RETURN(pcontext != nullptr,); |
| 981 | |
| 982 | CardinalBaseUI* const ui = static_cast<CardinalBaseUI*>(pcontext->ui); |
| 983 | DISTRHO_SAFE_ASSERT_RETURN(ui != nullptr,); |
| 984 | |
| 985 | DISTRHO_NAMESPACE::FileBrowserOptions opts; |
| 986 | opts.saving = ui->saving = false; |
| 987 | opts.startDir = dir.c_str(); |
| 988 | opts.title = "Open patch"; |
| 989 | ui->openFileBrowser(opts); |
| 990 | }); |
| 991 | #endif |
| 992 | } |
| 993 | |
| 994 | void loadPathDialog(const std::string& path, const bool asTemplate) |
| 995 | { |
nothing calls this directly
no test coverage detected