Commit Graph

299 Commits

Author SHA1 Message Date
Jeff Young 1e9da7f57b Remove CurItem() architecture and legacy routers and drawing code. 2019-05-29 00:26:30 +01:00
Jeff Young 323bb0f8e1 Moving PageLayout editor to GAL canvas and modern toolset. 2019-05-24 19:49:09 +01:00
Jeff Young 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +01:00
Jeff Young fbb807f3bb Move some more menu & toolbar items to modern toolset. 2019-05-16 19:57:06 +01:00
Jeff Young 69afa27a5f Implement ACTION_TOOLBAR and update some of the menus to ACTION_MENU.
This gives us better separation of MVC in line with the design of
the modern toolset.  It also reduces a whole bunch of duplicated
data.
2019-05-15 17:50:52 +01:00
Jeff Young eb3a201d39 Move some PCBNew and GerbView actions to their COMMON equivalents. 2019-05-15 17:50:52 +01:00
Jeff Young f602ccd814 Insert EE_TOOL_BASE under SchEdit and LibEdit tools, and fix errant rename scope which clobbered PCBNew's PICKER_TOOL. 2019-05-12 13:47:08 +01:00
Jeff Young 7995b5cc3c Restore selection on abort and undo/redo.
Also includes a related bug fix to not create an undo record for
the initial schematic cleanup.

Fixes: lp:1825975
* https://bugs.launchpad.net/kicad/+bug/1825975
2019-05-11 15:38:49 +01:00
Jeff Young c1539ae014 Naming changes to reflect sharing between SchEdit and LibEdit. 2019-05-10 19:56:20 +01:00
Jeff Young ea0941cab3 Implement modern tools for LibEdit. 2019-05-10 16:11:57 +01:00
Jeff Young fd546da640 Homogenize hit testing and selection return types.
Prep work for sharing SCH_SELECTION_TOOL with LibEdit.
2019-05-05 17:14:30 +01:00
Jeff Young 42383ae871 Build out some of the modern toolkit context menus. 2019-05-05 17:12:59 +01:00
Jeff Young 4e0208dfba Move duplicate item and block to modern toolset. 2019-05-05 17:12:59 +01:00
Seth Hillbrand c8118e3ce4 pcbnew: Allow click+drag of tracks
This behavior existed in 5.0.x but did not properly exit the edit tool
in 5.1.  This removes stops the edit tool when we begin dragging a track
using the interactive router.

Fixes: lp:1820312
* https://bugs.launchpad.net/kicad/+bug/1820312
2019-04-07 20:59:06 -07:00
jean-pierre charras 26acd39129 Fix a few Coverity warnings. 2019-03-07 20:01:47 +01:00
Seth Hillbrand 1be759c5c1 pcbnew: Force rotation to grid
When setting the modification point of a group, we get the grid-snapped
coordinate

Fixes: lp:1674835
* https://bugs.launchpad.net/kicad/+bug/1674835
2019-02-23 14:48:12 -08:00
Seth Hillbrand b461fc44ef pcbnew: Ensure source snapping
Choosing the drag origin should not be dependent on the snap settings in
pcbnew.  Snap settings are sensible when you are designating a target
only.  Additionally, when dragging a module, we do not want the
footprint's pads to be used as targets for snapping.

Fixes: lp:1814402
* https://bugs.launchpad.net/kicad/+bug/1814402
2019-02-03 04:23:24 +01:00
Seth Hillbrand 7551613826 pcbnew: Don't duplicate TOOL_EVENT
There is some odd interaction in the default copy constructor for
TOOL_EVENT using boost::optional under gcc.  Avoid this by explicitly
constructing the event needed for cut

Fixes: lp:1812848
* https://bugs.launchpad.net/kicad/+bug/1812848
2019-01-22 08:36:56 -08:00
Seth Hillbrand 4cf4600a23 pcbnew: Discard delete action when routing
Prevent the action from being handled on the next transition.

Fixes: lp:1810611
* https://bugs.launchpad.net/kicad/+bug/1810611
2019-01-17 19:38:01 -08:00
Seth Hillbrand e270b5d266 modedit: Mirror custom pads
Fixes mirror command to correctly handle custom pads.

Fixes: lp:1808135
* https://bugs.launchpad.net/kicad/+bug/1808135
2019-01-17 08:55:59 -08:00
Tomasz Włostowski d50bc6a85f EDIT_TOOL: correctly handle locked items in Rotate/Flip/Mirror functions when the selection is already being dragged
Fixes: lp:1812009
* https://bugs.launchpad.net/kicad/+bug/1812009
2019-01-16 17:00:51 +01:00
Seth Hillbrand 0f1a11ef38 pcbnew: Cut only copied objects
Fixes a bug where objects where accessed after being freed by the cut

Fixes: lp:1811456
* https://bugs.launchpad.net/kicad/+bug/1811456
2019-01-11 17:27:29 -08:00
Seth Hillbrand 994be43782 ratsnest: Calculate ratsnest per pad
The local/dynamic ratsnest needs to calculate on a per-pad basis as the
module is always listed as having a visible ratsnest.  This fixes the
finalized ratsnest viewed when routing as well as the show local
ratsnest regression.

Fixes: lp:1811010
* https://bugs.launchpad.net/kicad/+bug/1811010
2019-01-08 17:19:30 -08:00
Seth Hillbrand aeedb3543b pcbnew: Update strings
Moving pcbnew error strings that may be seen by the user to translated
strings.  Strings that denote unexpected cases are moved to debug logs
as they are essentially asserts that should never be shown.  The
exceptions are the messages shown when files are loaded.  All unknown
items should show an error here.
2019-01-02 14:43:55 -08:00
Seth Hillbrand daee58a0ab pcbnew: Do not show dynamic ratsnest after most mods
Marking the selection modified should not show the local ratsnest unless
we are currently dragging

Fixes: lp:1809921
* https://bugs.launchpad.net/kicad/+bug/1809921
2019-01-02 12:27:48 -08:00
Seth Hillbrand 0a26388901 pcbnew: Break track in edit mode
Enables the ability to break a track into two segments when operating in
the edit mode rather than in router.

Fixes: lp:1779788
* https://bugs.launchpad.net/kicad/+bug/1779788
2018-12-14 09:59:25 -08:00
Seth Hillbrand 1c99784e92 pcbnew: Locked deletion prompting
Instead of a nag screen for locked items, we allow first the unlocked
items to be deleted and then, with a repeated request, the locked items.

This adds a popup cursor window informing the user of the option for
repeating the delete

Fixes: lp:1806507
* https://bugs.launchpad.net/kicad/+bug/1806507
2018-12-13 12:32:58 -08:00
Seth Hillbrand 4ff9d2f5e4 pcbnew: Update Alt Delete Name/hint
Simply calling it Alternative Delete was hiding its behavior. This gives
a descriptive tooltip and command name allowing users to more easily
find the equivalent to the "Ripup" command
2018-12-12 17:23:27 -08:00
Seth Hillbrand 3d98c82217 pcbnew: Disable capture cursor in measure tool
When starting the measure tool, the cursor should not be captured until
we begin the measurement.

Fixes: lp:1806486
* https://bugs.launchpad.net/kicad/+bug/1806486
2018-12-05 19:59:01 -08:00
Seth Hillbrand 4a0467bbd0 Selection: allow optional locked item edit
When looping main, we should not exclude locked items without prompting
the user first.

Fixes: lp:1804979
* https://bugs.launchpad.net/kicad/+bug/1804979
2018-11-25 11:54:29 -08:00
Jeff Young f71998b34e Remove repetitive calls to other cancel operations. 2018-11-19 16:03:30 +00:00
Seth Hillbrand 940353afde GRID_HELPER: Keep edited items out of snap
Distinguish between the snap-from and snap-to items.  Previously, we
used the SELECTED or DRAGGED flags but the flagging arcitecture was
inherently fragile.  This specifies items directly that should not be
used as snap targets.

Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
2018-11-16 10:05:31 -08:00
Seth Hillbrand c15c64e991 GRID_HELPER: Don't snap to sub elements being moved
Fixes: lp:1802795
* https://bugs.launchpad.net/kicad/+bug/1802795
2018-11-12 06:53:33 -08:00
Seth Hillbrand c24f70ba1e GRID_HELPER: Filter targets based on dragging
Filtering based on selection ignores the use case where we are measuring
to a selected item.  This utilizes the dragged flag to prevent snapping
based on the current state of the item drag.

Fixes: lp:1801089
* https://bugs.launchpad.net/kicad/+bug/1801089
2018-11-11 11:30:36 -08:00
Seth Hillbrand 4b931aeb57 pcbnew: Force cursor position when snapping
This places the crosshairs (confusingly named here) at the snap
position, either one of the snap points or the grid, depending on the
status of the hotkeys SHIFT/ALT.

Fixes: lp:1801373
* https://bugs.launchpad.net/kicad/+bug/1801373

Fixes: lp:1801369
* https://bugs.launchpad.net/kicad/+bug/1801369
2018-11-07 14:36:46 -08:00
Jeff Young adfe2fc267 Make sure user isn't surprised by Match All setting.
If they selected the dialog with a footprint selected, they're
probably not expecting Match All.
2018-10-23 20:54:42 +01:00
Seth Hillbrand 4460313104 pcbnew: Separating connectivity to subdir 2018-10-12 16:31:09 -07:00
Jeff Young ab67d2f81a Another go at fixing units changes for rulers.
The previous fix only worked for hot-key changes.  This should
include using the toolbar, menu, etc.
2018-10-10 10:59:50 +01:00
Seth Hillbrand 821b10a37e pcbnew: Drawing tool's crosshairs follow the element
When drawing the crosshair should track the element while the mouse
provides the position to calculate the next snap.

Fixes: lp:1796524
* https://bugs.launchpad.net/kicad/+bug/1796524
2018-10-06 20:27:18 -07:00
Seth Hillbrand ee676b74d5 pcbnew: Move measure tool to common GRID_HELPER
This removes the last of the Magnetize legacy code from GAL,
standardizing the key bindings and magnetic effects in the GAL canvas
2018-10-04 21:31:57 -07:00
Seth Hillbrand 4c6b84bfdb GRID_HELPER: enable/disable grid in editor with ALT
Apply optional grid while editing
2018-10-04 21:31:28 -07:00
Seth Hillbrand 853b9d06ad pcbnew: Fix snapping while moving on pads
When requesting to move a footprint based on the pad, the pad layers
should determine the snapping.  This extracts layers from the selected
pad before allowing the filtering for locked pads

Fixes: lp:1787627
* https://bugs.launchpad.net/kicad/+bug/1787627
2018-10-04 15:53:41 -07:00
Seth Hillbrand 03e642a8db pcbnew: Implement consistent graphical snapping
This creates a standard snapping framework in the GRID_HELPER class that
allows snapping to items on the same layer as the object being
created/moved as well as consistent toggling of this using the Shift key
modifier.

Fixes: lp:806260
* https://bugs.launchpad.net/kicad/+bug/806260

Fixes: lp:1604616
* https://bugs.launchpad.net/kicad/+bug/1604616
2018-10-03 17:23:56 -07:00
Jeff Young f06bf81651 Don't deselected items that have been deleted.
De-referencing freed memory is never a good idea.

Fixes: lp:1795195
* https://bugs.launchpad.net/kicad/+bug/1795195
2018-09-30 15:47:18 +01:00
Seth Hillbrand a81e3c2b13 pcbnew: Avoid double-separators in context menu 2018-09-29 15:09:15 -07:00
Jeff Young 6764cda34d Fix issues with pad locking.
Fixes: lp:1794548
* https://bugs.launchpad.net/kicad/+bug/1794548
2018-09-26 21:57:35 +01:00
Jeff Young 37f7faf433 Move lock checks to CLIENT_SELECTION_FILTER.
Also checks render item visibility as well as layer visibility
when making selections.

Fixes: lp:1066220
* https://bugs.launchpad.net/kicad/+bug/1066220

Fixes: lp:1541756
* https://bugs.launchpad.net/kicad/+bug/1541756
2018-09-25 17:56:38 +01:00
Seth Hillbrand e0316af69c pcbnew: Prevent redo while moving items
Fixes: lp:1793948
* https://bugs.launchpad.net/kicad/+bug/1793948

(cherry picked from commit c5c89fd216)
2018-09-23 06:03:41 -07:00
Seth Hillbrand 7470d5ba98 pcbnew: retain selection between edits
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.

( cherry-picked from 2c6d0ffe2 )
Fixes: lp:1765774
* https://bugs.launchpad.net/kicad/+bug/1765774

Fixes: lp:1775946
* https://bugs.launchpad.net/kicad/+bug/1775946
2018-09-17 10:58:42 -07:00
Jeff Young a40ab768fc Allow deletion of non-Reference/non-Value module text items.
Fixes: lp:1781226
* https://bugs.launchpad.net/kicad/+bug/1781226
2018-09-17 18:01:08 +01:00