@@ -70,7 +70,7 @@ struct RackWidget : widget::OpaqueWidget { | |||||
std::vector<ModuleWidget*> getModules(); | std::vector<ModuleWidget*> getModules(); | ||||
bool hasModules(); | bool hasModules(); | ||||
void updateModuleOldPositions(); | void updateModuleOldPositions(); | ||||
history::ComplexAction* getModuleMoveAction(); | |||||
history::ComplexAction* getModuleDragAction(); | |||||
// Module selection methods | // Module selection methods | ||||
@@ -95,7 +95,7 @@ static ModuleWidget* chooseModel(plugin::Model* model) { | |||||
APP->scene->rack->updateModuleOldPositions(); | APP->scene->rack->updateModuleOldPositions(); | ||||
APP->scene->rack->addModuleAtMouse(moduleWidget); | APP->scene->rack->addModuleAtMouse(moduleWidget); | ||||
h->push(APP->scene->rack->getModuleMoveAction()); | |||||
h->push(APP->scene->rack->getModuleDragAction()); | |||||
// Load template preset | // Load template preset | ||||
moduleWidget->loadTemplate(); | moduleWidget->loadTemplate(); | ||||
@@ -442,7 +442,7 @@ void ModuleWidget::onDragEnd(const DragEndEvent& e) { | |||||
// The next time the module is dragged, it should always move immediately | // The next time the module is dragged, it should always move immediately | ||||
internal->dragEnabled = true; | internal->dragEnabled = true; | ||||
history::ComplexAction* h = APP->scene->rack->getModuleMoveAction(); | |||||
history::ComplexAction* h = APP->scene->rack->getModuleDragAction(); | |||||
if (!h->isEmpty()) | if (!h->isEmpty()) | ||||
APP->history->push(h); | APP->history->push(h); | ||||
else | else | ||||
@@ -818,7 +818,7 @@ void ModuleWidget::cloneAction(bool cloneCables) { | |||||
ModuleWidget* clonedModuleWidget = model->createModuleWidget(clonedModule); | ModuleWidget* clonedModuleWidget = model->createModuleWidget(clonedModule); | ||||
APP->scene->rack->updateModuleOldPositions(); | APP->scene->rack->updateModuleOldPositions(); | ||||
APP->scene->rack->addModuleAtMouse(clonedModuleWidget); | APP->scene->rack->addModuleAtMouse(clonedModuleWidget); | ||||
h->push(APP->scene->rack->getModuleMoveAction()); | |||||
h->push(APP->scene->rack->getModuleDragAction()); | |||||
// history::ModuleAdd | // history::ModuleAdd | ||||
history::ModuleAdd* hma = new history::ModuleAdd; | history::ModuleAdd* hma = new history::ModuleAdd; | ||||
@@ -543,7 +543,7 @@ void RackWidget::pasteModuleJsonAction(json_t* moduleJ) { | |||||
updateModuleOldPositions(); | updateModuleOldPositions(); | ||||
addModuleAtMouse(mw); | addModuleAtMouse(mw); | ||||
h->push(getModuleMoveAction()); | |||||
h->push(getModuleDragAction()); | |||||
// history::ModuleAdd | // history::ModuleAdd | ||||
history::ModuleAdd* ha = new history::ModuleAdd; | history::ModuleAdd* ha = new history::ModuleAdd; | ||||
@@ -822,7 +822,7 @@ void RackWidget::updateModuleOldPositions() { | |||||
} | } | ||||
} | } | ||||
history::ComplexAction* RackWidget::getModuleMoveAction() { | |||||
history::ComplexAction* RackWidget::getModuleDragAction() { | |||||
history::ComplexAction* h = new history::ComplexAction; | history::ComplexAction* h = new history::ComplexAction; | ||||
h->name = "move modules"; | h->name = "move modules"; | ||||