Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 29681) +++ trunk/src/gui_act.c (revision 29682) @@ -856,7 +856,7 @@ gid = pcb_layergrp_id(PCB, g); } - PCB_ACT_IRES(pcb_layergrp_del(PCB, gid, 1)); + PCB_ACT_IRES(pcb_layergrp_del(PCB, gid, 1, 1)); return 0; } Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 29681) +++ trunk/src/layer.c (revision 29682) @@ -1013,7 +1013,7 @@ } -int pcb_layer_move(pcb_board_t *pcb, pcb_layer_id_t old_index, pcb_layer_id_t new_index, pcb_layergrp_id_t new_in_grp) +int pcb_layer_move(pcb_board_t *pcb, pcb_layer_id_t old_index, pcb_layer_id_t new_index, pcb_layergrp_id_t new_in_grp, pcb_bool undoable) { /* sanity checks */ if (old_index < -1 || old_index >= pcb->Data->LayerN) { @@ -1038,9 +1038,9 @@ if (old_index == -1) /* append new layer at the end of the logical layer list, put it in the current group */ - return pcb_layer_move_append(pcb, new_index, new_in_grp, 1); + return pcb_layer_move_append(pcb, new_index, new_in_grp, undoable); if (new_index == -1) /* Delete the layer at old_index */ - return pcb_layer_move_delete(pcb, old_index, 1); + return pcb_layer_move_delete(pcb, old_index, undoable); pcb_message(PCB_MSG_ERROR, "Logical layer move is not supported any more. This function should have not been called. Please report this error.\n"); Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 29681) +++ trunk/src/layer.h (revision 29682) @@ -295,7 +295,7 @@ /* index is 0..PCB_MAX_LAYER-1. If old_index is -1, a new layer is inserted at that index. If new_index is -1, the specified layer is deleted. Returns non-zero on error, zero if OK. */ -int pcb_layer_move(pcb_board_t *pcb, pcb_layer_id_t old_index, pcb_layer_id_t new_index, pcb_layergrp_id_t new_in_grp); +int pcb_layer_move(pcb_board_t *pcb, pcb_layer_id_t old_index, pcb_layer_id_t new_index, pcb_layergrp_id_t new_in_grp, pcb_bool undoable); /* set up dst to be a bound layer with the right offset in the stack; src_pcb Index: trunk/src/layer_grp.c =================================================================== --- trunk/src/layer_grp.c (revision 29681) +++ trunk/src/layer_grp.c (revision 29682) @@ -517,7 +517,7 @@ return 0; } -int pcb_layergrp_del(pcb_board_t *pcb, pcb_layergrp_id_t gid, int del_layers) +int pcb_layergrp_del(pcb_board_t *pcb, pcb_layergrp_id_t gid, int del_layers, pcb_bool undoable) { int n; pcb_layer_stack_t *stk = &pcb->LayerGroups; @@ -529,7 +529,7 @@ pcb_layer_t *l = pcb_get_layer(pcb->Data, stk->grp[gid].lid[n]); if (l != NULL) { if (del_layers) { - pcb_layer_move(pcb, stk->grp[gid].lid[n], -1, -1); + pcb_layer_move(pcb, stk->grp[gid].lid[n], -1, -1, undoable); n = -1; /* restart counting because the layer remove code may have changed the order */ } else { @@ -591,7 +591,7 @@ pcb_layergrp_t *g = pcb_get_grp(LayerGroup, PCB_LYT_ANYWHERE, PCB_LYT_BOUNDARY); if ((g != NULL) && (g[1].ltype & PCB_LYT_SUBSTRATE)) { pcb_layergrp_id_t gid = g - LayerGroup->grp + 1; - pcb_layergrp_del(pcb, gid, 0); + pcb_layergrp_del(pcb, gid, 0, 0); } } Index: trunk/src/layer_grp.h =================================================================== --- trunk/src/layer_grp.h (revision 29681) +++ trunk/src/layer_grp.h (revision 29682) @@ -114,7 +114,7 @@ /* Remove a layer group; if del_layers is zero, layers are kept but detached (.grp = -1), else layers are deleted too */ -int pcb_layergrp_del(pcb_board_t *pcb, pcb_layergrp_id_t gid, int del_layers); +int pcb_layergrp_del(pcb_board_t *pcb, pcb_layergrp_id_t gid, int del_layers, pcb_bool undoable); /* Remove a layer from a group */ int pcb_layergrp_del_layer(pcb_board_t *pcb, pcb_layergrp_id_t gid, pcb_layer_id_t lid); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 29681) +++ trunk/src/object_act.c (revision 29682) @@ -974,11 +974,11 @@ new_index = 0; } else if (strcmp(a1, "gi") == 0) { - PCB_ACT_IRES(pcb_layer_move(pcb, -1, 0, pcb_actd_EditGroup_gid)); + PCB_ACT_IRES(pcb_layer_move(pcb, -1, 0, pcb_actd_EditGroup_gid, 1)); return 0; } else if (strcmp(a1, "ga") == 0) { - PCB_ACT_IRES(pcb_layer_move(pcb, -1, 1, pcb_actd_EditGroup_gid)); + PCB_ACT_IRES(pcb_layer_move(pcb, -1, 1, pcb_actd_EditGroup_gid, 1)); return 0; } else if (strcmp(a1, "group") == 0) { @@ -1033,7 +1033,7 @@ } } - PCB_ACT_IRES(pcb_layer_move(pcb, old_index, new_index, -1)); + PCB_ACT_IRES(pcb_layer_move(pcb, old_index, new_index, -1, 1)); return 0; } Index: trunk/src_plugins/draw_csect/draw_csect.c =================================================================== --- trunk/src_plugins/draw_csect/draw_csect.c (revision 29681) +++ trunk/src_plugins/draw_csect/draw_csect.c (revision 29682) @@ -769,11 +769,11 @@ } else if (drag_delgrp) { if (gactive >= 0) { - pcb_layergrp_del(PCB, gactive, 1); + pcb_layergrp_del(PCB, gactive, 1, 1); if (pcb_layergrp_flags(PCB, gactive) & PCB_LYT_SUBSTRATE) - pcb_layergrp_del(PCB, gactive, 1); + pcb_layergrp_del(PCB, gactive, 1, 1); else if (pcb_layergrp_flags(PCB, gactive-1) & PCB_LYT_SUBSTRATE) - pcb_layergrp_del(PCB, gactive-1, 1); + pcb_layergrp_del(PCB, gactive-1, 1, 1); } drag_delgrp = 0; gactive = -1; Index: trunk/src_plugins/io_mentor_cell/read.c =================================================================== --- trunk/src_plugins/io_mentor_cell/read.c (revision 29681) +++ trunk/src_plugins/io_mentor_cell/read.c (revision 29682) @@ -1181,7 +1181,7 @@ const pcb_dflgmap_t *m; while(ctx->pcb->LayerGroups.len > 0) - pcb_layergrp_del(ctx->pcb, 0, 1); + pcb_layergrp_del(ctx->pcb, 0, 1, 0); for(m = pcb_dflg_top_noncop; m->name != NULL; m++) map[len++] = *m; Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 29681) +++ trunk/src_plugins/io_pcb/file.c (revision 29682) @@ -1147,7 +1147,7 @@ /* remove empty layer groups */ for(n = 0; n < pcb->LayerGroups.len; n++) { if (pcb->LayerGroups.grp[n].len == 0) { - pcb_layergrp_del(pcb, n, 0); + pcb_layergrp_del(pcb, n, 0, 0); n--; } }