MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / loadDialog

Function loadDialog

src/CardinalCommon.cpp:969–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967#endif
968
969void 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
994void loadPathDialog(const std::string& path, const bool asTemplate)
995{

Callers

nothing calls this directly

Calls 5

c_strMethod · 0.80
openFileBrowserMethod · 0.80
promptClearFunction · 0.70
homeDirFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected