Commit Graph

184 Commits

Author SHA1 Message Date
Seth Hillbrand 7d1adff071 Store group id rather than group
We only need the group storage id for lookup.  Storing the KIID instead
of a copy of the group avoids unneeded overhead

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17175
2024-02-28 13:27:08 -08:00
Jeff Young 995c4af51d Deleted items must have their ownership changed to undo/redo. 2024-01-28 11:13:48 +00:00
Jeff Young eacebe63f1 We do undo on individual footprint children now.
Adding a commit record for the parent means we replace the
parent first on undo and then if a child was added we can't
find it to remove it.
2024-01-27 20:26:50 +00:00
Jeff Young 07cefa7883 More active tracking of undo/redo items. 2024-01-27 20:02:40 +00:00
Jeff Young f4e123f57e !m_isBoardEditor != m_isFootprintEditor.
(There's also python, cli, etc.)
2024-01-26 12:47:01 +00:00
Marek Roszko a282762686 Fix pcb drc in cli due to awkward !m_isBoardEditor logic with more awkward logic
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16744
2024-01-25 22:09:29 -05:00
Jeff Young 9d88a9f60a Fix typo causing OnItemsChanged() to get called too often.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16657
2024-01-24 11:36:56 +00:00
Jon Evans d50e0811fb Fix QA build 2024-01-23 22:50:53 -05:00
Jon Evans a46d409ec6 Make sure grouping commits follow board editor path 2024-01-23 21:22:23 -05:00
Jeff Young d6b39c672e Footprint editor items always get added to footprint.
Also fixes an unrelated crash when assuming the current
editor is the board editor.
2024-01-21 22:51:36 +00:00
Jeff Young e55ec85e19 Remove added items from group on revert.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16562
2024-01-10 17:36:31 +00:00
Jeff Young 1f627a3a75 Fix two unrelated bugs in ungroup.
1) Don't double-remove the members from the group.
2) Don't auto-recurse BOARD_COMMIT::Stage for non-modify
changes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16419
2023-12-21 22:47:23 +00:00
Jeff Young 08a00633b1 Make sure child items get edit flags cleared in commit.
In the footprint editor, in particular, we often just
add the parent footprint to the commit rather than the
actual modified item(s).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16389
2023-12-17 21:55:29 +00:00
Jeff Young 1b0cc82c56 Move a couple of stragglers to BOARD_COMMIT. 2023-12-17 21:01:31 +00:00
Jeff Young b29a56530c Remove undo-of-ungroup hack.
The hack assumed that the parent group would be the first
deleted item of type group in the undo list.  While this
will be true when undoing a user ungroup command, it will
not be when undoing an ungroup side-effect, such as when a
member of a group is deleted during UpdateFromPCB.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16384
2023-12-17 15:35:35 +00:00
Jeff Young 9fb06f95a0 Fix msys2 build. 2023-12-16 16:17:24 +00:00
Jeff Young ea3c87f243 Move group/ungroup to COMMIT infrastructure. 2023-12-16 14:17:25 +00:00
Jeff Young ca8cb5a206 Fix typo.
We want recursion into descendants here.  Alternatively we could
change the caller to RunOnDescendents(), but it seemed cleaner to
omit the scoping of the Stage() call....

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16077
2023-11-14 14:23:23 +00:00
Jeff Young cc721c4907 Improve encapsulation of group internals.
(It's still leaking into BOARD_COMMIT and some other places, but at
least it no longer leaks into all the edit tools.)

Also fixes some bugs when moving/copying/pasting multiple selections
containing length-tuning patterns.
2023-11-09 14:05:35 +00:00
Jeff Young 791aa64950 Functionally it's a "reference image".
The implementation happens to be a "bitmap".

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15932
2023-10-24 15:44:21 +01:00
Jeff Young 504652b972 Regularize RunOnChildren() at the BOARD_ITEM level.
BOARD_ITEM sub-classes which don't have children simply don't
overrid it.
2023-10-14 15:04:18 +01:00
Alex Shvartzkop be72e07e61 Introduce PCB_GENERATOR. 2023-10-08 02:41:17 +00:00
Jeff Young 2d762acc7d Remove accidentally-checked-in debugging code. 2023-09-02 10:11:38 +01:00
Jeff Young 69a1b30b8a Implement undo/redo around Pad Edit Mode changes. 2023-09-01 18:48:46 +01:00
Mike Williams 3cd25f0045 PCB: add ratsnest to search pane
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15338
2023-08-17 10:25:40 -04:00
Jeff Young b986391a04 Remove stale teardrops before rebuilding connectivity.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15398
2023-08-15 12:13:34 +01:00
Marek Roszko 812143ac69 ADDED: Run PCB DRC via cli 2023-08-10 20:20:40 -04:00
Jeff Young e2aa3aae8a Don't delete items out from under undo lists.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15253
2023-08-03 10:48:44 +01:00
Jeff Young a09a5cb641 More undo cleanup.
The symbol editor has few enough items that it will still be performant
if we always send a selected-item-modifed event.  (As it turns out we
were doing that anyway as the check for child-modified flags didn't
also check for selected.)
2023-07-16 14:43:29 +01:00
Jeff Young 1218f61d0a Implement undo/redo for footprint children.
Our special-cases to handle the fact that we didn't do this had far
outgrown the code necessary to actually handle it.
2023-07-15 17:37:31 +01:00
Jeff Young c3222b0652 Clear edit flags on footprint children in footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15199
2023-07-14 22:16:11 +01:00
Jeff Young d02e94805a Store original boardItem (before promoting ent.m_item to parent footprint). 2023-07-14 20:43:13 +01:00
Jeff Young cf8294b5c2 Remove a bunch of blind (and a few redundant) static_casts. 2023-07-13 14:14:45 +01:00
Jeff Young 67c9d3932b Another attempt to fix qa error. 2023-07-03 16:26:20 +01:00
Jeff Young 9ff33e5ec6 Remove BOARD_COMMIT( TOOL_MANAGER ).
It initializes both m_isFootprintEditor and m_isBoardEditor to false,
causing all sorts of trouble.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15072
2023-07-01 11:52:46 +01:00
Jeff Young 1411b09178 Remove EDIT_TOOL's quasi-global BOARD_COMMIT.
It had several encapsulation leakage issues, as well as poorly-defined
behaviour of undo for chained-actions (append-to-board, and then rotate
while moving, for instance).
2023-06-27 17:04:18 +01:00
Ian McInerney 2fb6f19a84 Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2023-06-27 00:57:59 +01:00
Mike Williams 993bb84240 PCB_FIELD: bug fixes 2023-06-20 18:34:52 +00:00
Mike Williams 6d93950dcc PCB: abolish TEXT_TYPE::TEXT_is_*
PCB_TEXT is now always what was formerly TEXT_is_DIVERS and PCB_FIELDs
now what mandatory field type they are already.
2023-06-20 18:34:52 +00:00
Jeff Young d5b5a3eaf4 Add action info to Undo/Redo menus.
Note that this only works where a BOARD_COMMIT or SCHEMATIC_COMMIT is used.
(BOARD_COMMIT is used almost universally in PCBNew, but SCHEMATIC_COMMIT
has very little adoption in EEschema so far.)
2023-06-07 14:37:34 +01:00
Jeff Young ff9a5b8373 Remove change from teardrop merge that wasn't needed for final impl. 2023-05-21 16:39:18 +01:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.

Add updating of teardrops on BOARD_COMMIT::Push().

Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
2023-05-19 18:02:03 +01:00
Seth Hillbrand f4b43617e7 Add COMMIT structure to Schematic and Symbol editors
Provides a single-point access for modifying the schematic and symbol
elements that allows chaining updates and reverting partial changes.
Standardizes the undo hierarchy between pcb and schematic editors

As this is another layer on the existing undo/redo structure, the
initial commit does not replace all undo/redo calls currently existing.
These will be handled in a series of follow-on commits
2023-04-28 17:05:47 -07:00
Jeff Young bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Wayne Stambaugh 789bf6455a Coverity fixes and code cleaning. 2023-03-02 09:04:47 -05:00
Jeff Young 0ff8ba1d8c Stage group children when staging group.
Many operations such as move, rotate, etc. are applied directly to the
group's children, so it's the children that need staging.

Fixes https://gitlab.com/kicad/code/kicad/issues/13999
2023-02-28 16:51:23 +00:00
Jon Evans f7d59f2e89 Enable properties panel in footprint editor 2023-02-17 20:35:56 -05:00
Jeff Young 40e1296a8b Clear dirty flags after a move.
Fixes https://gitlab.com/kicad/code/kicad/issues/11362
2023-02-15 14:50:31 +00:00
Jeff Young 509b39e9e4 Propagate nets within non-conflicting clusters immediately.
Fixes https://gitlab.com/kicad/code/kicad/issues/13601
2023-01-23 16:25:29 +00:00
Jeff Young ea4c3a267b Be more discerning about dirtying zones for auto-refill.
In particular, record which children caused a parent footprint to be
added to the commit so we can determine if they have intersecting
bounding boxes and/or layers.

Fixes https://gitlab.com/kicad/code/kicad/issues/13512
2023-01-13 19:09:22 +00:00