Commit Graph

15815 Commits

Author SHA1 Message Date
jean-pierre charras 4ae5a006d0 Viewlib: fix minor issues. 2019-05-24 12:54:11 +02:00
jean-pierre charras e3815381ab Viewlib: register missing EE_SELECTION_TOOL.
This tool is needed to manage the View menu.
2019-05-24 11:28:39 +02:00
jean-pierre charras e957fb403b eda_draw_frame.cpp: fix missing EVT_MENU_CLOSE capture, that can create crashes.
in this case the crash can happens because a menu pointer used in EVT_MENU_HIGHLIGHT
is not cleared when closing the menu
2019-05-24 10:22:09 +02:00
Jon Evans 4c33320cbc Stop erroneously accepting bus alias labels without curly braces 2019-05-23 23:06:51 -04:00
Jon Evans 4e6c9ac7b1 Remove defunct junction code that left some isolated
Fixes: lp:1828716
* https://bugs.launchpad.net/kicad/+bug/1828716
2019-05-23 22:58:46 -04:00
Jon Evans 8c89847627 Properly handle tildes at the end of bus vector names
Fixes: lp:1825532
* https://bugs.launchpad.net/kicad/+bug/1825532
2019-05-23 22:47:01 -04:00
Jon Evans ab3ada5200 Clear moving flag for second-click-placed items
Fixes: lp:1830227
* https://bugs.launchpad.net/kicad/+bug/1830227
2019-05-23 21:51:14 -04:00
John Beard 3afea91088 Revert "QA: Tweak boost print helper macro"
This reverts commit 593b7cd6a1.

This causes breakage on MSVC. I am not sure sure why, but
this is not that important, so just back it out.
2019-05-23 23:31:03 +01:00
Jeff Young 924736c6f3 Make sure PCBNew is open when running F8.
Fixes: lp:1830256
* https://bugs.launchpad.net/kicad/+bug/1830256
2019-05-23 22:57:53 +01:00
Jeff Young 39bb4b639f Fix crash with opening find dialog twice.
Fixes: lp:1830224
* https://bugs.launchpad.net/kicad/+bug/1830224
2019-05-23 22:57:53 +01:00
Jeff Young ebd8c44eee Don't confuse SCH_ITEMs and LIB_ITEMs.
Fixes: lp:1829826
* https://bugs.launchpad.net/kicad/+bug/1829826
2019-05-23 22:57:53 +01:00
John Beard 241127788e Format: add some formatting aliases, improve dev docs
The aliases are easier than calling check_coding.sh manually,
and we already provide an alias file for the fixes alias, so
do the same for these.
2019-05-23 21:28:42 +01:00
John Beard 073c03e61f Common: declare COLOR4D inside KIGFX
Forward declaring as just COLOR4D is no right, though can
work due to people putting using directives in headers.
2019-05-23 19:35:20 +01:00
jean-pierre charras ce93934f08 Pcbnew, ZONE_FILLER: fix incorrect test to remove filled areas outside the board edge cuts.
This incorrect test was only for zones with no net.
2019-05-23 20:22:03 +02:00
John Beard 2c55091a74 QA: Adjust bitmap test bitmap
For some reason, older WXs on Linux (e.g. Ubuntu 16.04) would
segfault on loading the 4-tile test image. Change one tile to
a circle to fix this (presumably an old and fixed image library
function).
2019-05-23 18:59:20 +01:00
Ian McInerney 0daf14f9c3 pcbnew: Fixed listing of 3D libraries in the github wizard
Fixes: lp:1830137
* https://bugs.launchpad.net/kicad/+bug/1830137
2019-05-23 09:50:05 -07:00
Seth Hillbrand 1a56dfe342 Plotter: Ensure group style is respected in SVG
Graphics Changed is cleared when setting graphics for a group but needs
to be reset when the group ends.

Fixes: lp:1830245
* https://bugs.launchpad.net/kicad/+bug/1830245
2019-05-23 09:40:35 -07:00
John Beard 2dd5757eb5 Common: Fix copy-construction of empty BITMAP_BASE
The bitmap pointer is not checked at copy construct. This is
an instant segfault if you copy an empty bitmap.

Fix the constructor and remove the expected test failure, from the
previous commit.
2019-05-23 16:58:08 +01:00
John Beard d642ac39ae Common: Bitmap base: catch copy segfault
Copying an empty image is not checked for nullity,
so it will segfault. Introduce a test for this case,
for fixing as a follow-up.
2019-05-23 16:58:08 +01:00
jean-pierre charras 872c8ca37b Remove a duplicate icon. 2019-05-23 16:21:06 +02:00
John Beard 94b46ce176 QA common: add some BITMAP_BASE tests
Also:

* Init wx image handlers for qa_common
* Break out COLOR4D test predicates
* Fix some bitmap_base.h headers/forwards
2019-05-23 15:19:51 +01:00
John Beard 593b7cd6a1 QA: Tweak boost print helper macro
By making the caller use the "namespace" keyword, the formatter
is given the right indentation hints.

Also makes it clearer synatactically. One day, this will be a
namespace alias (needs GCC 7).
2019-05-23 14:37:35 +01:00
Wayne Stambaugh c52ff1ca23 Symbol Editor: fix datasheet field bug loading old symbol libraries.
This only applies to the root symbol when the datasheet field is not
empty and the datasheet for root symbol alias in the document file is
empty.  Use the root symbol datasheet field value when adding a new
symbol that meets this criteria.

The root symbol datasheet field gets copied to the root symbol alias
datasheet member variable so if the symbol is modified and saved, the
datasheet information is saved in the .dcm file.

https://bugs.launchpad.net/kicad/+bug/1830078

Fixes lp:1830078
2019-05-23 09:00:50 -04:00
John Beard a045642b7e Sexpr: Do not leak memory on parse exception
Use std::unique_ptr to guard against leaking the new'd pointers
in SEXPR lists if there is an exception during parse.

This was noticable during the Sexpr/ParseExceptions unit test.

Fixes: lp:1830209
* https://bugs.launchpad.net/kicad/+bug/1830209
2019-05-23 13:52:39 +01:00
jean-pierre charras 83e08c9277 Fix crash in Eeschema when clicking on a menubar item.
It happens if an other frame (libedit) was opened, a menubar clicked, an this frame was closed.
2019-05-23 13:35:12 +02:00
Wayne Stambaugh 300f5cb082 Eeschema: fix datasheet field bug loading old symbol libraries.
This only applies to the root symbol when the datasheet field is not
empty and the datasheet for root symbol alias in the document file is
empty.  Use the root symbol datasheet field value when adding a new
symbol that meets this criteria.

https://bugs.launchpad.net/kicad/+bug/1830083

Fixes lp:1830083
2019-05-23 07:25:16 -04:00
John Beard 840e08fa78 QA eeschema: add some tests
This adds a few tests on:

* LIB_PART
* SCH_PIN
* SCH_SHEET
* SCH_SHEET_PATH

These tests exercise some of the basic code paths in these classes
and show some of the expected behaviours.

None of these tests are particularly ground-breaking, but they
provide a starting point to build out further tests, and to ensure
the already-covered behaviour is stable.

It does expose some places where SCH_SHEET could probably use const.
2019-05-23 11:29:28 +01:00
John Beard 0617bffce0 Eeschema: build with object libraries
This is done to allow access to the eeschema library
internals for purposes of test and script access, as the
DLL library has highly restrictive -fvisibility settings
that otherwise prevent the tests being able to access 99.9%
of the eeschema library functions (only a single function
is APIEXPORT'ed, therefore that's the only test we can do).

Using object libraries is a bit of a hack, and makes for
a slower link when done for multiple targets, but with the currently
supported CMake versions, it's about as good as we can get.

A better solution in the longer term may be to break eeschema_kiface(_objects)
into many smaller libraries, each of which has a much more defined scope,
rather than one big interlinked amorphous lump. This has the advantage that
each module is testable in isolation, and we get better organisation of
inter-dependencies in the codebase.

Then, the kiface DLL will gather these sub-libs and present what
is needed on the visible DLL API. Thus, we get both a testable
suite of library functions, and a restricted kiface DLL interface.
2019-05-23 11:29:28 +01:00
John Beard e1f6230e8c Do not statically construct wxTimer
If you construct wxTimer statically, it will be constructed
before WX init, which means you might get assertions about
missing m_impl's within the timer class.

The solution is to construct the wxTimer at run time. In this
case, static within the function will be constructed only after
the function is called (and actually the scope only needed to be
this function anyway).
2019-05-23 11:28:11 +01:00
jean-pierre charras 75cea18f07 Pcbnew, toolbars: fix incorrect icons 2019-05-23 11:07:55 +02:00
Jeff Young d3777eaddf Don't double-launch selection tool.
Fixes: lp:1829741
* https://bugs.launchpad.net/kicad/+bug/1829741
2019-05-23 01:56:06 +01:00
Jeff Young 1f2bdf895e Not all SCH_DRAW_PANELs have a selection tool.
Fixes: lp:1829981
* https://bugs.launchpad.net/kicad/+bug/1829981
2019-05-23 00:27:53 +01:00
Jeff Young 0047f88f82 Mark unfold bus menu as clean so it doesn't get generated a second time.
Fixes: lp:1829878
* https://bugs.launchpad.net/kicad/+bug/1829878
2019-05-23 00:27:53 +01:00
Jeff Young 1636405b66 Set a reference point for all selection sizes.
Fixes: lp:1829833
* https://bugs.launchpad.net/kicad/+bug/1829833
2019-05-23 00:27:53 +01:00
Tomasz Włostowski ecb81426a4 eemodern: fixed use-after-free in SCH_DRAWING_TOOLS::DrawSheet(). 2019-05-23 00:28:58 +02:00
Seth Hillbrand ac435ecd68 Moving further arc approximations down
This corrects an issue with fill segments-per-circle and moves the error
to segmetns calculation down in a number of functions to expose the
single value for approximation
2019-05-22 14:35:17 -07:00
Jeff Young 323ecada8d Generate refresh preview events when objects are moving.
Fixes: lp:1829683
* https://bugs.launchpad.net/kicad/+bug/1829683
2019-05-22 21:48:04 +01:00
Jeff Young fbffb9ae1e Don't put KICAD_T arrays on stack and expect them to be there when you need them.
Fixes: lp:1829748
* https://bugs.launchpad.net/kicad/+bug/1829748
2019-05-22 21:48:04 +01:00
Jeff Young 67f7571f04 Don't call VIEW::Redraw() from within the tool.
Fixes: lp:1828824
* https://bugs.launchpad.net/kicad/+bug/1828824
2019-05-22 21:48:04 +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
Michael Kavanagh 07b82d19e3 Allow setting cursor and aux items colour in footprint editor
Fixes: lp:1829850
* https://bugs.launchpad.net/kicad/+bug/1829850
2019-05-22 15:46:15 -04:00
Tomasz Włostowski 2b38b23a5e eemodern: fixed use-after-free crash in LIB_EDIT_TOOL::DoDelete() 2019-05-22 21:35:03 +02:00
Tomasz Włostowski 37e057173c CMakeLists: temporarily disable --no-undefined which breaks builds with ASan 2019-05-22 16:37:16 +02:00
jean-pierre charras f18807ea0f Eeschema: Ensure axis are always drawn in libedit and viewlib
Fixes: lp:1822408
https://bugs.launchpad.net/kicad/+bug/1822408
2019-05-22 10:04:34 +02:00
jean-pierre charras 459a972116 Remove unused vars. 2019-05-22 08:27:48 +02:00
Seth Hillbrand 06b22594ca libedit: Prevent null dereference in popup
Lack of tool manager can happen when the popup is not connected to the
main tool.

Fixes: lp:1829825
* https://bugs.launchpad.net/kicad/+bug/1829825
2019-05-21 19:59:43 -07:00
Seth Hillbrand e1373d70ae libedit: Ensure proper dereference in shared tools
Fixes: lp:1829826
* https://bugs.launchpad.net/kicad/+bug/1829826
2019-05-21 19:43:15 -07:00
Seth Hillbrand b53b29399d eeschema: Ensure conn is updated after import
After importing Eagle files, we need to make sure that the connectivity
network is updated before the system requests a new netlist.  Otherwise,
we end up with different results from the first to second updates.
2019-05-21 19:31:59 -07:00
Seth Hillbrand 6f7475dcd3 pcbnew: Prevent no-connects from driving clusters
The no-connect net (0) should never drive the net of a cluster.
Otherwise, tracks connecting between unconnected pads and connected pads
can acquire net 0 incorrectly.
2019-05-21 19:29:29 -07:00
Seth Hillbrand 68451a2a9c eeschema: Don't free pointers held by undo stack 2019-05-21 16:19:48 -07:00