Browse Source

Implement RackWidget::cloneSelectedModulesAction().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
fe4191f9e5
2 changed files with 5 additions and 5 deletions
  1. +1
    -4
      src/app/ModuleWidget.cpp
  2. +4
    -1
      src/app/RackWidget.cpp

+ 1
- 4
src/app/ModuleWidget.cpp View File

@@ -775,10 +775,7 @@ void ModuleWidget::cloneAction() {

// JSON serialization is the obvious way to do this
json_t* moduleJ = toJson();
// Don't use IDs from JSON
json_object_del(moduleJ, "id");
json_object_del(moduleJ, "leftModuleId");
json_object_del(moduleJ, "rightModuleId");
cleanupModuleJson(moduleJ);

// Clone Module
engine::Module* clonedModule = model->createModule();


+ 4
- 1
src/app/RackWidget.cpp View File

@@ -901,7 +901,10 @@ void RackWidget::disconnectSelectedModulesAction() {
}

void RackWidget::cloneSelectedModulesAction() {
// TODO
json_t* rootJ = selectedModulesToJson();
DEFER({json_decref(rootJ);});
// TODO The Action name is incorrect here.
pasteJsonAction(rootJ);
}

void RackWidget::bypassSelectedModulesAction(bool bypassed) {


Loading…
Cancel
Save