|
@@ -1018,7 +1018,7 @@ int OPINV_AddNodesRack(laOperator* a, laEvent *e){
|
|
|
|
|
|
laBaseNode* la_CreateNode(laNodeRack* ir, laBaseNodeType* NodeType){
|
|
|
laBaseNode* bn=memAcquire(NodeType->NodeSize);
|
|
|
- bn->Type=NodeType; NodeType->Init(bn, 0); bn->InitDone=1; lstAppendItem(&ir->Nodes, bn); bn->InRack=ir;
|
|
|
+ bn->Type=NodeType; NodeType->Init(bn, 0); bn->InitDone=1; lstAppendItem(&ir->Nodes, bn); memAssignRef(bn,&bn->InRack,ir);
|
|
|
laNotifyInstanceUsers(ir); laRecordInstanceDifferences(ir->ParentPage,"la_rack_page"); laPushDifferences("Add Node", 0);
|
|
|
return bn;
|
|
|
}
|
|
@@ -1068,6 +1068,10 @@ laNodeRack* la_NewRackAfter(laRackPage* parent,laNodeRack* rr){
|
|
|
r->ParentPage=parent; r->RackType=parent->RackType;
|
|
|
return r;
|
|
|
}
|
|
|
+
|
|
|
+int OPCHK_MoveNodeToRack(laPropPack *This, laStringSplitor *Instructions){
|
|
|
+ return !MAIN.InitArgs.DisableUnsupportedUndo;
|
|
|
+}
|
|
|
int OPINV_MoveNodeToRack(laOperator* a, laEvent *e){
|
|
|
laBaseNode* n=a->This?a->This->EndInstance:0; if(!n||!n->InRack) return LA_CANCELED;
|
|
|
laBaseNodeType* bnt=0; laNodeRack* target;
|
|
@@ -1078,9 +1082,9 @@ int OPINV_MoveNodeToRack(laOperator* a, laEvent *e){
|
|
|
else{ target=n->InRack->Item.pNext; if(!target){ target=la_NewRackAfter(n->InRack->ParentPage,n->InRack->ParentPage->Racks.pLast); } }
|
|
|
if(!target) return LA_CANCELED;
|
|
|
|
|
|
- lstRemoveItem(&n->InRack->Nodes, n); lstAppendItem(&target->Nodes,n); n->InRack=target;
|
|
|
+ lstRemoveItem(&n->InRack->Nodes, n); lstAppendItem(&target->Nodes,n); memAssignRef(n,&n->InRack,target);
|
|
|
|
|
|
- laNotifyInstanceUsers(n->InRack->ParentPage); laRecordInstanceDifferences(n->InRack->ParentPage,"la_node_page"); laPushDifferences("Move Node", 0);
|
|
|
+ laNotifyInstanceUsers(n->InRack->ParentPage); laRecordInstanceDifferences(n->InRack->ParentPage,"la_rack_page"); laPushDifferences("Move Node", 0);
|
|
|
|
|
|
return LA_FINISHED;
|
|
|
}
|
|
@@ -1215,7 +1219,7 @@ void la_RegisterBasicNodes(){
|
|
|
laCreateOperatorType("LA_add_rack", "Add Rack", "Add a rack for nodes", 0,0,0,OPINV_AddNodesRack,0,'+',0);
|
|
|
at=laCreateOperatorType("OPINV_AddNode", "Add Node", "Add a node to the rack",0,0,0,OPINV_AddNode,OPMOD_AddNode,'+',0);
|
|
|
at->UiDefine=laui_AddNode;
|
|
|
- laCreateOperatorType("LA_move_node_to_rack", "Move Node", "Move node to another rack",0,0,0,OPINV_MoveNodeToRack,0,0,0);
|
|
|
+ laCreateOperatorType("LA_move_node_to_rack", "Move Node", "Move node to another rack",OPCHK_MoveNodeToRack,0,0,OPINV_MoveNodeToRack,0,0,0);
|
|
|
laCreateOperatorType("LA_delete_node", "Delete Node", "Delete this node",0,0,0,OPINV_DeleteNode,0,0,0);
|
|
|
laCreateOperatorType("LA_move_rack", "Move Rack", "Move this rack",0,0,0,OPINV_MoveRack,0,0,0);
|
|
|
laCreateOperatorType("LA_insert_rack", "Insert Rack", "Insert a new rack",0,0,0,OPINV_InsertRack,0,0,0);
|
|
@@ -1625,7 +1629,7 @@ laRackPage* laDuplicateRackPage(laRackPage* new_optional, laRackPage* from){
|
|
|
nnr->ParentPage=nr; nnr->RackType=r->RackType;
|
|
|
for(laBaseNode* n=r->Nodes.pFirst;n;n=n->Item.pNext){
|
|
|
laBaseNode* nn=memAcquire(n->Type->NodeSize);
|
|
|
- nn->Type=n->Type; nn->InitDone=1; lstAppendItem(&nnr->Nodes, nn); nn->InRack=nnr; n->Duplicated=nn;
|
|
|
+ nn->Type=n->Type; nn->InitDone=1; lstAppendItem(&nnr->Nodes, nn); memAssignRef(nn,&nn->InRack,nnr); n->Duplicated=nn;
|
|
|
nn->Type->Init(nn, 0); nn->Type->Copy(nn,n,0);
|
|
|
}
|
|
|
}
|