| 623 | } |
| 624 | |
| 625 | void ModuleWidget::loadAction(std::string filename) { |
| 626 | // history::ModuleChange |
| 627 | history::ModuleChange* h = new history::ModuleChange; |
| 628 | h->name = "load module preset"; |
| 629 | h->moduleId = module->id; |
| 630 | h->oldModuleJ = toJson(); |
| 631 | |
| 632 | try { |
| 633 | load(filename); |
| 634 | } |
| 635 | catch (Exception& e) { |
| 636 | delete h; |
| 637 | throw; |
| 638 | } |
| 639 | |
| 640 | // TODO We can use `moduleJ` here instead to save a toJson() call. |
| 641 | h->newModuleJ = toJson(); |
| 642 | APP->history->push(h); |
| 643 | } |
| 644 | |
| 645 | void ModuleWidget::loadTemplate() { |
| 646 | std::string templatePath = system::join(model->getUserPresetDirectory(), "template.vcvm"); |
no test coverage detected