MCPcopy Create free account
hub / github.com/VCVRack/Rack / removeAction

Method removeAction

src/app/ModuleWidget.cpp:923–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921}
922
923void ModuleWidget::removeAction() {
924 history::ComplexAction* h = new history::ComplexAction;
925 h->name = string::translate("ModuleWidget.history.deleteModule");
926
927 // Disconnect cables
928 appendDisconnectActions(h);
929
930 // Unset module position from rack.
931 APP->scene->rack->updateModuleOldPositions();
932 if (settings::squeezeModules)
933 APP->scene->rack->unsqueezeModulePos(this);
934 h->push(APP->scene->rack->getModuleDragAction());
935
936 // history::ModuleRemove
937 history::ModuleRemove* moduleRemove = new history::ModuleRemove;
938 moduleRemove->setModule(this);
939 h->push(moduleRemove);
940
941 APP->history->push(h);
942
943 // This removes the module and transfers ownership to caller
944 APP->scene->rack->removeModule(this);
945 delete this;
946
947 APP->scene->rack->updateExpanders();
948}
949
950
951// Create ModulePresetPathItems for each patch in a directory.

Callers 1

createContextMenuMethod · 0.80

Calls 8

translateFunction · 0.85
unsqueezeModulePosMethod · 0.80
getModuleDragActionMethod · 0.80
updateExpandersMethod · 0.80
pushMethod · 0.45
setModuleMethod · 0.45
removeModuleMethod · 0.45

Tested by

no test coverage detected