We had been deselecting items after calling edits to be safe in case the
item was deleted/exchanged by the edit. The item pointer itself remains
valid even when deleting as it is assigned to the undo stack. But it
should not remain visible or selected on the schematic if it is removed.
This tests for removed items by checking whether it (in the case of
first-level BOARD_ITEMS) or its parent (in the case of footprint item
components) remain in the view list after editing. If they are still in
the view list, then we re-select them.
Fixes: lp:1765774
* https://bugs.launchpad.net/kicad/+bug/1765774
Fixes: lp:1775946
* https://bugs.launchpad.net/kicad/+bug/1775946
When changing elements in the module editor, each element shares the
same parent. Undo commits store a copy of the parent as it existed
before the change. For footprints with many elements, this creates
large, slow undo commits as a copy of the full footprint is stored for
each element being edited.
This keeps a single copy of the footprint in the undo stack per edit.
Fixes: lp:1780526
* https://bugs.launchpad.net/kicad/+bug/1780526
There's no risk in measuring an empty footprint but there's no benefit
either. This matches the measure tool to the other, deactivated
footprint tools.
New items just being placed on the board are still temporary. Although
we can modify their orientations/positions, we can't stage these changes
for undo/redo without corrupting the undo stack.
Fixes: lp:1776312
* https://bugs.launchpad.net/kicad/+bug/1776312
Also fixes a bug where a FOOTPRINT_EDIT_FRAME was being passed
in to a PCB_EDIT_FRAME.
Also tidies up Modedit settings handling for settings which can't
be edited in Modedit's preferences dialog. They're now copied
from Pcbnew.
Fixes: lp:1768477
* https://bugs.launchpad.net/kicad/+bug/1768477
This really needs to get put into the VIEW_CONTROLS for all the
tools, but that's probably a bit too risky for 5.0 at this
point.
Fixes: lp:1766547
* https://bugs.launchpad.net/kicad/+bug/1766547
When multiple cut commands were issued, the cut command handler would
restart multiple times and keep running until the handler that was
invoked first finishes. As all handlers kept a selection copy, they
would try to save the deleted items to the clipboard resulting in a
crash.
Fixes: lp:1761221
* https://bugs.launchpad.net/kicad/+bug/1761221
CTRL+{X,C,V} used to be handled both by the legacy hotkey system that
generated ID_EDIT_{CUT,COPY,PASTE} wxCommandEvent, and the Tool Framework
hotkey system.
Fixes: lp:1749549
* https://bugs.launchpad.net/kicad/+bug/1749549
Tools preserve their state between runs, so it could happen that
activating a tool restores the state when autopanning is enabled, even
though it should not be.
Commit complementary to 4f0c9b6b. In case there were multiple tracks
under the cursor, disambiguation was shown twice because
SELECTION_TOOL::selectConnection() cleared the selection and requested
it again.
Also adds Cancel context menu items for Place Footprint,
Place Target, Place Drill Origin and Place Grid Origin tools,
as well as the standard Zoom and Grid choices.
Removes the Paste context menu item from the Place Drill
and Place Grid Origin tools.
Fixes: lp:1568396
* https://bugs.launchpad.net/kicad/+bug/1568396
Second disambiguation menu was caused by another call to
SELECTION_TOOL::RequestSelection() meant to get the list of
connected tracks. When there were only footprints under the cursor,
it asked the user again to pick an item to remove.
Fixes: lp:1748521
* https://bugs.launchpad.net/kicad/+bug/1748521
This commit also adds a no-selection-mode, which allows the user
to specify what gets update (through the various match modes).
The no-selection-mode is accessed via the Edit menu, although
it could also be applied to the context menu.
Fixes: lp:1466857
* https://bugs.launchpad.net/kicad/+bug/1466857
Some actions, such as select trivial connection, don't need the
user to choose which trace at a corner to start from -- either
one will do. Same for moving a simple trace corner.
Likewise, Edit in Footprint Editor shouldn't ask if you mean the
footprint or the pad. Obviously it's the footprint.
This change adds a CLIENT_SELECTION_FILTER which allows clients
to do tool- or action-specific filtering of the selection before
the disambiguation menu is run.
It also removes some tool- and action-specific code which was
in the selection_tool and shouldn't have been.
Fixes: lp:1708869
* https://bugs.launchpad.net/kicad/+bug/1708869
Opening Properties dialog normally does not ask the user to confirm the
action, even for locked items. The exception was a case when there was
nothing selected and Properties dialog was invoked via its hot key -
then SELECTION_TOOL::RequestSelection() tried to get the item under the
cursor, verifying the lock flag.
Fixes: lp:1734537
* https://bugs.launchpad.net/kicad/+bug/1734537
A change in commit 5731000135 caused kicad to stop allowing users
to move items like footprints, arcs and lines using anchors other
than the center point.
This was caused by the new code that stores reference points for
clipboard pasting, a call to updateModificationPoint() prevented
some old code paths from executing, which caused the selection to
snap into the cursor, always using the center anchor.
This fix moves the call within the if-cases that need it, and adds
a ClearReferencePoint call when the selection is "dropped" to allow
the user to grab the same selection again from a different anchor.
Fixes: lp:1722512
* https://bugs.launchpad.net/kicad/+bug/1722512
- renamed connectivity.[h|cpp] to connectivity_data [.h|.cpp] so that the file name matches the main class name.
- GetNetItems() now returns a vector instead of a list
- fixed netcode propagation bug
- factored out EDIT_TOOL::m_offset, now selection offset is stored in SELECTION class
- added VECTOR2I-based Move/Flip/Rotate methods in BOARD_ITEM
- added selection of reference point
- added snapping when pasting
- some minor code refactoring
- disabled pasting between footprint and pcb editors due to model incompatibility
- support for background color setting
- removed several global config settings (such as g_Drc_On)
- wrapped most of global config settings in PCB_GENERAL_SETTINGS class
- reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
- new GAL feature for legacy users: double-click (or E) to change track width available as an option.
Fixes: lp:1530543
* https://bugs.launchpad.net/kicad/+bug/1530543
Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145