Commit Graph

4981 Commits

Author SHA1 Message Date
Jeff Young 87e163945e Items added to a selection for a drag should only be temporary.
After the drag, cancel, or undo, only the originally-selected items
should remain selected.
2019-12-28 11:58:33 +00:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +00:00
Wayne Stambaugh c67a52ffd8 Symbol editor: fix various crash and behavior bugs.
Abandon the previous behavior of always creating a new copy of the
buffered symbol which required a re-parenting of every derived symbol
to prevent accidentally orphaning a derived symbol parent symbol
pointers.

This change required something that should have been done a long time
ago by adding an assignment operator to LIB_PART.  The assignment
operator makes it possible to create a single copy of the symbol to
buffer which gets updated rather than deleting the last copy and
replacing it with a new copy.

Add a clear method to the MULTIVECTOR class so that existing LIB_PART
object draw items can be removed before assigning the draw items from
the part being assigned.

Fixes #3672

https://gitlab.com/kicad/code/kicad/issues/3672
2019-12-26 10:28:51 -05:00
Mark Roszko d3edeaec50 Fix "Properties" not appearing in right click menu for graphic line. 2019-12-26 15:15:34 +00:00
Ian McInerney 25a302758e Fix macos plist version string generation
Generate these resource files similar to how it is done one Linux.

Fixes mac-builder issue https://gitlab.com/kicad/packaging/kicad-mac-builder/issues/275
2019-12-26 12:42:25 +00:00
Ian McInerney e6e2cf47fd eeschema: Fix return ID check in annotate dialog
Fixes https://gitlab.com/kicad/code/kicad/issues/3708
2019-12-25 23:17:00 +00:00
jean-pierre charras 034b87dec0 Eeschema: connection_graph.cpp: clear old pointers to avoid using outdated or deleted data.
m_connected_bus_item and m_connected_bus_items pointers were not cleared when
rebuilding connection data.
So in some cases these pointers were not updated, and created a crash
once the old data was no longer available (deleted)
2019-12-23 14:55:47 +01:00
jean-pierre charras 7b80b2dc7b Eeschema: fix a crash that sometimes happens with bus entries,
connected to the same point on a bus.
The pointers used in previous code could be null, but they were not tested.
The pointer validity is now tested.
2019-12-22 16:19:05 +01:00
jean-pierre charras b53501d8cf Eeschema: very minor change: make a string shorter to reduce the panel size
This is not noticeable in English, but noticeable in translated language.
Frequently, strings are longer once translated.
2019-12-21 11:19:08 +01:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney b24fc4e2e1 Remove unused variables 2019-12-19 15:38:15 +00:00
Ian McInerney b9d8849b28 Unify unsaved changes detection logic in all frames
Create an IsContentModified() function in each frame
that provides if the content has been modified, and
use that instead of always copying the checks.
2019-12-19 15:34:01 +00:00
Mark Roszko 686b768a3d Add shutdown blocking on Windows for pcbnew, eeschema and pleditor
ADDED: Block shutdown/logoff on Windows when contents have been modified
2019-12-19 14:11:11 +00:00
Ian McInerney 3ca231aa78 Rename lib viewer frame files to use the class name 2019-12-19 14:05:46 +00:00
jean-pierre charras d9de28de35 Eeschema: usability enhancement.
ADDED: a config option to select (when clicking on a pin) the parent symbol
or only the pin.

Previously, when cliking on a pin, the parent symbol was selected.

Allowing the pin selection is mandatory in cross probing, and to display the pin
characteristics in some cases, for instance if a pin is flagged by the ERC tooL.
2019-12-19 12:41:51 +01:00
jean-pierre charras a049348576 Eeschema: fix null pointer use.
Fixes #3694 | https://gitlab.com/kicad/code/kicad/issues/3694
2019-12-19 09:11:34 +01:00
Wayne Stambaugh 879ec7d8e6 KiCad: fix crash bug when editing symbol library table.
Do not check the connection graph when editing the symbol library table
from KiCad because the connection graph object is no valid when the
schematic editor is not open.

Fixes kicad/code/kicad#3682
2019-12-17 18:42:43 -05:00
Ian McInerney 0c63936aed Initialize starting value in libedit deduplicate function 2019-12-17 16:09:59 +00:00
Wayne Stambaugh 2b920ffa04 Symbol editor: inheritance symbol editing bug fixes.
There is no need to create a new root symbol and re-parent all derived
symbols when renaming a root symbol.  Just rename the buffered root
symbol.

Test for duplicate symbol names when validating the properties dialog
information to prevent broken symbol pointers.

Fix a field drawing bug when editing derived symbols.

Fix bug to insure duplicate symbol names cannot exist in a library.

Fixes kicad/code/kicad#3654

Fixes kicad/code/kicad#3672
2019-12-16 10:11:06 -05:00
Wayne Stambaugh 965478365a Eeschema: minor fix loading inherited symbol fields. 2019-12-14 08:28:43 -05:00
jean-pierre charras 74caf3b7cb Sch validator: make error messages translatable.
The fix avoid ridiculous sentences, once translated.
2019-12-14 11:40:37 +01:00
Wayne Stambaugh 3e431d0d39 Symbol editor: fix inherited symbol editing bug.
The library manager update part function was orphaning the root symbol
of derived symbols when the root symbol was edited.  Re-parent the
inherited symbols when updating a root symbol.

Update the mandatory field attributes whenever the parent is set for
derived parts.  This will show the fields with the correct attributes
in the symbol editor and viewer.

Using std::unique_ptr to hold the current symbols was deleting the
pointer on symbol selection changes causing the pointer in the library
manager buffer to be stale in some cases.  Revert back to using a
simple pointer and manual clean up as required.

Prevent derived symbols from being saved to a different library to
prevent orphaned symbols.

Fixes kicad/code/kicad#3649
2019-12-13 16:51:59 -05:00
Seth Hillbrand e9323fff82 Eeschema: Move SCH_LINE_WIRE_BUS_TOOL to class
The remaining static elements of SCH_LINE_WIRE_BUS_TOOL are moved into
the class and passed elements eliminated in favor of held class
elements.
2019-12-13 12:41:57 -08:00
Seth Hillbrand cda291adae eeschema: Clean bits of DLIST
Removes the extra DLIST manipulation from SCH_LINE_WIRE_BUS_TOOL and
moves the static storage into class storage
2019-12-13 11:22:18 -08:00
Seth Hillbrand ac7538cc22 Add default VECTOR2D constructor for SCH_LINE 2019-12-13 11:22:18 -08:00
Wayne Stambaugh b66ecf141f Eeschema: fix sheet file name case sensitivity test.
Fix overzealous test if the new file name is the same as an existing
file name.

Fix a potential comparison bug due to missing file extension.
2019-12-12 15:36:57 -05:00
Wayne Stambaugh 20836261d7 Fix minor coding policy violations. 2019-12-12 14:55:35 -05:00
Wayne Stambaugh c4d1cebbdd Symbol editor: fix a compiler warning in the library manager code.
Fixes kicad/code/kicad#3651
2019-12-12 14:36:29 -05:00
Wayne Stambaugh bcaa15e54c Eeschema: fix yet another symbol inheritance crash.
The schematic symbol swap function still had the old pin map swapping
code which overwrote the correct pin maps that were rebuild after the
library symbol was update.  Duh!

Fixes kicad/code/kicad#3661
2019-12-12 12:59:01 -05:00
Wayne Stambaugh a18d7a8495 Eeschema: fix a selection bug created in commit bec87864.
Apparently the schematic and symbol library editors now have common
selection filtering so checking for a valid LIB_EDIT_FRAME when
filtering for the  schematic editor frame prevented all schematic
object from being selected.
2019-12-12 11:42:11 -05:00
Wayne Stambaugh bec878640c Symbol editor: fix crash caused by broken root symbol name.
The symbol editor selection criteria did not include LIB_FIELD objects
which allowed the root symbol name to be changed causing broken derived
symbol links.  Disable the symbols fields from being edited when a
derived part is shown in the editor to prevent this.

Add a missing warning that deleting a root symbol used to derive other
symbols would also delete all derived symbols from a library.  Give the
user a chance to cancel the delete operation in this case.

Fixes kicad/code/kicad#3654
2019-12-12 10:45:12 -05:00
Wayne Stambaugh ed025972ab Eeschema: fix crash caused by stale symbol library object pointers.
The new symbol library changes left stale pointers in the connection
graph because the SCH_COMPONENT object pins were not always getting
updated when a new copy of the library symbol was updated.

Force a full update of the connection graph whenever the schematic
library symbol links are refreshed.  This seems like overkill but it
ensures that there a no stale libraries items left in the connection
graph.

Fixes kicad/code/kicad#3658
2019-12-11 18:53:29 -05:00
Jeff Young c5df98a170 Clean up spacing in Eeschema Display Options.
Also adds a note for editing highlight color.
2019-12-11 20:50:38 +00:00
Jonatan Liljedahl 90d2ea5dd5 Eeschema: simulator: add keyboard shortcuts for add signal, etc
(cherry picked from commit bc4caa8913ceff15391f6347a9edb8acbc60172e)
2019-12-11 04:34:22 +00:00
Seth Hillbrand e39586e157 Eeschema: Catch error on init
Some windows systems will not fall back correctly on our standard
initialization step, so we need the additional std:: error fall back to
catch them.

Fixes #2620 | https://gitlab.com/kicad/code/kicad/issues/2620
2019-12-10 13:48:13 -08:00
Jonatan Liljedahl 25abdd9e9c eeschema: Fix refreshing of selection shadow on text fields when zooming.
Fixes #3652 | https://gitlab.com/kicad/code/kicad/issues/3652
2019-12-10 13:10:26 +01:00
Wayne Stambaugh 30da2b31ea Eeschema: fix multiple symbol rescue bug caused by commit 54f066fe.
Use the root symbol when comparing against the cached symbol when
checking to see if a symbol changed.  When the original symbol is
a derived symbol, the test will always fail.

Force a symbol link refresh on a rescue to prevent stale links from
crashing the connection graph refresh when running the project rescue
on demand.

Force a symbol link refresh on project load to prevent stale links from
symbol link changes from crashing the connection graph when the project
rescue in invoked.

Fixes kicad/code/kicad#3645
2019-12-09 14:47:29 -05:00
Mark Roszko a130ed9968 Fix improper SetValue usage on radio buttons 2019-12-09 00:40:08 -05:00
Jonatan Liljedahl 034bfb0919 eeschema: More work on selection highlight thickness
Bring back old zoom-level factor scaling constant and
change selection width to absolute unit instead of
floating point multiplier.
2019-12-07 09:33:32 +00:00
Jonatan Liljedahl 681f6bc707 Eeschema: Add option for selection highlight thickness
ADDED new option to set selection highlight thickness.
Also change selection shadow width constants to
make the selection thickness change less drastically
with the zoom level.
2019-12-07 09:33:32 +00:00
Jean-Pierre Charras 97b0b20a65 Fix properties dialog bug in symbol library editor.
Remove unused panel rather than calling Hide() method which draws the
hidden page as a background of the shown page.
2019-12-06 11:33:52 -05:00
Wayne Stambaugh 9fe2c4b21f Fix a few more symbol library inheritance bugs.
Replace some C casts with C++ dynamic_cast.

Fix iterator bug when deleting inherited symbols from legacy file format
symbol library cache.

Remove unnecessary const when return wxString object instead of reference.
2019-12-06 11:33:52 -05:00
Wayne Stambaugh 8e150521a2 Fix a few minor symbol library inheritance bugs.
Don't clobber value file when load aliases in legacy symbol library cache
parser.

Use actual symbol library LIB_PART pointer rather than a flattened copy
of the symbol.  This fixed a bug when displaying the parent field in the
message panel for derived symbols.

Simplify the flatten code by copying the parent and updating the lesser
information from the inherited symbol.
2019-12-06 11:33:52 -05:00
Wayne Stambaugh 54f066fed7 Implement simple inheritance for library symbols.
This change completely removes the LIB_ALIAS design pattern an replaces
it by allowing LIB_PART objects to inherit from other LIB_PART objects.
The initial implementation only allows for single inheritance and only
supports the mandatory fields in the derived part because that is all
that the current symbol library file format will support.  Once the new
file format is implemented and saving to the old file format is deprecated,
more complex inheritance will be added.  The LIB_ALIAS information saved
in the document files was move into the LIB_PART object.  This change
impacts virtually every part of the schematic and symbol library editor
code so this commit message is woefully incomplete.

REMOVE: Removed the symbol aliases concept from the schematic and symbol
editors and the symbol viewer.

NEW: Replace the symbol alias concept with simple inheritance that allows
a library symbol to be derived from another library symbol.
2019-12-06 11:33:52 -05:00
Seth Hillbrand 6983c56cf8 Use const references where possible
This avoids copy cost on local vars where we only read.
2019-12-05 14:40:22 -08:00
Seth Hillbrand c6f5df134c Minor speed cleanup
This adjusts iterators to use const reference when only used for
copy.  It also ensures pre-allocation of vectors when size is known
ahead of time.
2019-12-05 14:20:59 -08:00
Seth Hillbrand b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
Seth Hillbrand 4d2e953f42 Cleanup: Replace C-only deprecated headers
This replaces headers deprecated by C++14 with their equivalent
replacement
2019-12-05 11:03:15 -08:00
Jeff Young 089ce90de3 Fix some issues with the previous commit. 2019-12-02 23:35:19 +00:00
Jeff Young 9b36489270 Make sure that libraries are always sorted consistently.
Fixes #1847481 | https://gitlab.com/kicad/code/kicad/issues/1847481
2019-12-02 21:52:50 +00:00