Commit Graph

4260 Commits

Author SHA1 Message Date
Jeff Young 848873d87e Add some protection against newlines sneaking into the file.
Fixes: lp:1842943
* https://bugs.launchpad.net/kicad/+bug/1842943
2019-09-07 02:32:56 +01:00
Jeff Young 75bb864237 Workaround wxWidgets inability to find the default PDF viewer.
Fixes: lp:1843061
* https://bugs.launchpad.net/kicad/+bug/1843061

(cherry picked from commit d55f4d05b4)
2019-09-07 00:07:06 +01:00
Wayne Stambaugh 6d4dd3e17a Pcbnew: fix size of graphics import warning dialog.
Use the HTML_MESSAGE_BOX window to present the warning messages rather
than wxMessageBox which would overflow the display when there were a lot
of graphic items that could not be parsed.

Fixes lp:1839565

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

(cherry picked from commit 24454f5105)
2019-09-06 14:59:40 -04:00
Ian McInerney 649c22a34e wxWidgets compatibility fixes
* Remove unneeded check
* Fix WX_GRID since upstream renamed a variable in 3.1.3

(cherry picked from commit 8d86d94a4d)
2019-09-06 08:48:03 -04:00
Jeff Young 1ed8912f57 Workaround an issue where a throw terminates (even when there's a catch for it).
You can trigger it before this fix by running Cvpcb when a .kicad_mod file is
incorrectly set as "Legacy" in your footprint table.

(cherry picked from commit e269b5d1b9)
2019-09-01 12:37:58 +01:00
Seth Hillbrand fccce265aa pcbnew: Retain 45° constraint
This also finishes the polygon with 45° lines when chosen as a create
option.

Fixes: lp:1833673
* https://bugs.launchpad.net/kicad/+bug/1833673
2019-08-26 14:33:30 -07:00
Jeff Young dd8610fd5c Don't apply GTK fix to OSX as it causes a hang.
Fixes: lp:1841379
* https://bugs.launchpad.net/kicad/+bug/1841379

(cherry picked from commit de8f97be6b)
2019-08-26 00:50:54 +01:00
Seth Hillbrand efc0325e14 Handle wx scrollbar thumbs in system-independent way
The thumb size changes between system versions and (on GTK) render
managers, so hard-coded wasn't working.  This gets the actual value from
the system and uses to adjust the range.  Changes in the range can also
trigger the refresh.

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

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

(cherry picked from commit 85df994eda)
2019-08-22 10:16:25 -07:00
Seth Hillbrand 213547f545 SVG: Correct plot fills for arcs/polylines
When plotting in Eeschema, various elements may be filled with either
the foreground or background colors.  The fill mode is rather unique,
requiring un-stroked pie wedges for arcs and both closed and open filled
polylines.

Fixes: lp:1840769
* https://bugs.launchpad.net/kicad/+bug/1840769
2019-08-20 12:01:00 -07:00
Seth Hillbrand ebba15fe67 Alphabetize Library Table returns
KiCad is case sensitive but we need to be consistent in displaying sort
order as case insensitive (same as file systems)

Fixes: lp:1836911
* https://bugs.launchpad.net/kicad/+bug/1836911
2019-08-19 15:23:29 -07:00
Jeff Young c1cd3339fa Fix assertion in new Duplicate Hotkey warning message. 2019-08-19 14:24:26 +01:00
Seth Hillbrand dc0aed5b16 Allow EDA_RECT to properly be uninitialized
The base initialization of EDA_RECT sets a 0/0/0/0 rectangle that
prevents merging properly with valid EDA_RECT.  This sets the default to
be uninitialized until the internal data are set.

(cherry picked from commit 46feb76aba)
2019-08-16 11:01:01 -07:00
Simon Schubert a68a442bbb SVG plot: output invisible text in addition to plotting
Fixes: lp:1544918
* https://bugs.launchpad.net/kicad/+bug/1544918

(cherry picked from commit 176fe80425)
2019-08-15 14:32:32 -07:00
Shawn Anastasio f6a42a36d6 Fix libcontext on PPC64 ELFv2
libcontext currently restores and saves the FPSCR register
on ppc64. This behavior is fine (though unnecessary) on the
ELFv1 ABI which designates the register as volatile, but has
been observed to cause crashes on ELFv2 systems.

The ELFv2 ABI designates the FPSCR register as Limited-access
and specifies specific conditions that must be met to clobber
it. It does not seem that a context swap function meets these
conditions (and indeed, the save/restore register example in the
ABI document does not modify FPSCR).

This patch fixes ELFv2 ABI compliance by removing the FPSCR
save/restore code in libcontext entirely. This fixes observed
crashes on the platform and should have no consequence for
ELFv1 support.

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

(cherry picked from commit 3e22b75948)
2019-08-14 11:18:25 -07:00
jean-pierre charras 8373e91a1b Python scripting: fix missing definition of uint32_t (and some other similar defs).
Fixes: lp:1837867
https://bugs.launchpad.net/kicad/+bug/1837867
2019-07-27 08:22:10 +02:00
Stefan Hamminga e7f3851212 Rebased LTO fix for coroutines
Fixes: lp:1793329
* https://bugs.launchpad.net/kicad/+bug/1793329

(cherry picked from commit e58d9606dd)
2019-07-25 12:17:11 -07:00
Seth Hillbrand b6fe4ff637 eeschema: Clean up backup name
This fixes the last suffix that was missed by 168fa09f5.  The schematic
backup files should have the suffix .sch-bak to distinguish from
.kicad_pcb-bak or other backups.
2019-07-23 10:47:15 -07:00
Jeff Young 16f9e697ab Allow edits to self-intersecting polygons.
1) Intermediate states might be self-intersecting, and we shouldn't
be policing our users on what order to do things in
2) The polygon might already be self-intersecting, at which point we're
preventing the user from fixing it.

Also includes better const management for SHAPE_POLY_SET API.

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

(cherry picked from commit a3c74051c2)
2019-07-14 18:36:47 +01:00
Jeff Young 6ba2c44e88 Add FootprintExists() which can be more careful about FS differences.
(And in particular, MSW's case-insensitive FS.)

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

(cherry picked from commit 20036f8105)
2019-07-11 23:01:25 +01:00
Seth Hillbrand 85f88b6b05 Fix case-sensitive import using KiCad std
Fixes: lp:1832853
* https://bugs.launchpad.net/kicad/+bug/1832853

(cherry picked from commit 79e2000af4)
2019-07-10 10:33:03 -07:00
Ian McInerney 40ba502853 pcbnew: Clean up warnings with unit handling in the DXF export
(cherry picked from commit ff9d899ae0)
2019-07-10 12:42:54 -04:00
Jeff Young 85220591e2 Fix bugs in keyboard cursor movement.
1) Generate refreshPreview events so the modern toolset doesn't
fall behind by one event (see LP:1818667)
2) In the legacy toolset don't call unimplemented routines and don't
snap to grid on the non-movement axis.
2019-07-05 01:32:15 +01:00
Seth Hillbrand 3974c6fd89 Enforcing rational limits on length tuner
The length tuning dialog needed validators on close to prevent negative
and percentages >100%

Fixes: lp:1834734
* https://bugs.launchpad.net/kicad/+bug/1834734
2019-06-29 09:37:47 -07:00
jean-pierre charras 032bda223e Gerber drill file: Modify a aperture attribute for oblong holes (slots).
Oblong holes (slots) use now a aperture attribute similar to round holes.
(The previous attribute "slot" is now deprecated)
However they have a specific aperture, and a comment is added in drill files for these apertures.
2019-06-26 17:53:09 +02:00
Tomasz Włostowski 3bf7ab910f TestSegmentHit: add corner case for null segment (start == end)
Fixes: lp:1833059
* https://bugs.launchpad.net/kicad/+bug/1833059

(cherry picked from commit 6180687bbd)
2019-06-25 08:45:27 -04:00
Seth Hillbrand b124599de3 Don't skip handled events in GTK
Now that our tool framework handles the hotkeys, we need to skip the
passed handling work-around for actions that are already handled in the
event.

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

(cherry picked from commit b876309999)

Fixes: lp:1819210
* https://bugs.launchpad.net/kicad/+bug/1819210
2019-06-18 22:06:10 -07:00
Wayne Stambaugh 43579f4c02 Minor library identifier validator change.
Use the wxTextValidator style flag to allow the user to clear the library
identifier string.  Use wxTextValidator::SetStyle( wxFILTER_EMPTY ) to
prevent empty library identifier strings which is the current behavior.

(cherry picked from commit 9f9e87f11f)
2019-06-18 12:16:51 -04:00
Seth Hillbrand b32439a694 Plotting: Handle mask transparency
This handles images with transparent colors by mapping the transparent
color to white.  This only works when plotted into the background.
2019-06-17 13:27:58 -07:00
Seth Hillbrand b075886b19 DC printing: Place worksheet behind schematic
And place bitmaps behind other items.  This ensures they are drawn in
the background of the page rather than covering schematic elements.

This also hacks around the buggy wxPostScriptDC implementation that
resets the page to print an image.

Fixes: lp:1819934
* https://bugs.launchpad.net/kicad/+bug/1819934
2019-06-17 13:03:00 -07:00
Seth Hillbrand 77f0799750 Print bitmaps using BW setting
When selecting the "Print in B&W", all items on the schematic should be
printed using black and white.  This converts the embedded images
greyscale before outputting to the printer
2019-06-17 09:54:52 -07:00
Wayne Stambaugh 8002692f3e CvPcb: fix save changes dialog layout issue.
DIALOG_EXIT was not being laid out correctly after setting the dialog
message.  Rather than fix our custom DIALOG_EXIT, wxMessageDialog and
wxRichMessageDialog were substituted as direct replacements for all
of the variants of DIALOG_EXIT.  This make message dialogs appear more
consistent because wxMessageDialog uses the default platform message
dialog and wxRichMessageDialog uses the default platform rich message
dialog on windows.

Remove DIALOG_EXIT_BASE as it is no longer required.

Fixes lp:1832899

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

(cherry picked from commit 3f665318f4ab5c02b7d3c29b5233a273fdac2e4e)
2019-06-16 12:28:35 -04:00
Seth Hillbrand 9496b57b01 tool_mgr: Don't invalidate our own iterators
Re-arranging the stack will invalidate the iterator that is removed and
inserted (begin()).  Because this is not a threaded operation, we can
only do it to ourselves, so check that the operation isn't a NOP before
performing.

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

(cherry picked from commit 552815d486)
2019-06-15 17:49:52 -07:00
jean-pierre charras a5cd5844ec Fix invalid wxImageList build.
Fixes: lp:1832905
https://bugs.launchpad.net/kicad/+bug/1832905
2019-06-15 16:08:07 +02:00
Ian McInerney da16b479a0 Make DXF monochrome output only contain Black layer
Fixes: lp:1832359
* https://bugs.launchpad.net/kicad/+bug/1832359

(cherry picked from commit dc56678289)
2019-06-13 16:10:17 -07:00
Ian McInerney 44f1059000 Allow DXF to be exported in either inches or millimeters
Fixes: lp:1832188
* https://bugs.launchpad.net/kicad/+bug/1832188

(cherry picked from commit d5f680ecd2)
2019-06-13 16:10:12 -07:00
Seth Hillbrand a84ca5b147 cmake: Further petting dependencies
eeschema cpp files consume generated header files that have targets in
the common directory, so no dependencies get created from eeschema.  We
add the dependencies in common to force the setting through libraries.

Fixes: lp:1831643
* https://bugs.launchpad.net/kicad/+bug/1831643
2019-06-13 16:09:45 -07:00
Ian McInerney 2aa8e444ee Added hotkey validity checking to the preferences menu 2019-06-13 13:53:04 -04:00
Steven A. Falco cfa187f477 Show the current grid setting. 2019-06-13 12:14:41 -04:00
Seth Hillbrand 0ee38653f7 Fix default User Template location
When we assign a string to the wxFilename, it takes the last section as
the filename (unless there is a trailing '/').  So on Linux, we got
/home/user for the Documents dir and /home/ was the directory while
'user' was the filename.  Appending directories 'kicad/templates' made
the final directory '/home/kicad/templates'.  Forcing this to be a
directory restores correct behavior.
2019-06-11 13:46:10 -07:00
jean-pierre charras 407301a28c Fix issue in cairo_gal when drawing a 360 deg arc (in fact a circle). It was due to a angle normalization between -360 and 360 degrees. So, in arcs, if the start angle and end angle diff is n*360 deg, this normalization gives start angle = end angle. The fix forces end angle = start angle+360deg in this case.
Fixes: lp:1832096
https://bugs.launchpad.net/kicad/+bug/1832096
2019-06-09 11:09:43 +02:00
jean-pierre charras 1113e18c40 Fix incorrect initialization of some menuitems IDs.
Although is is currently working, it is a potential issue.
2019-06-06 08:01:24 +02:00
Jon Evans 02947345e8 Mathplot: properly set foreground color when saving screenshots
Fixes: lp:1810914
* https://bugs.launchpad.net/kicad/+bug/1810914

(cherry picked from commit 27a5ed1a9f)
2019-06-05 22:44:18 -04:00
Seth Hillbrand 63f18f0b03 CMake: Handle custom_target indirection
Building custom targets that depend on custom commands such as our
keyword lexer requires two layers of indirection to pick up changes
properly and not overwrite the same file in parallel builds.

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

(cherry picked from commit c6af38477d)
2019-06-05 13:10:00 -07:00
Jon Evans 64b71644bb Zoom to fit: only consider worksheet if there are no other items
(cherry picked from commit 04d6ec7de7e7f90482310311fcee416e8ed6410f)
2019-05-29 20:52:07 -04:00
Ian McInerney b485e78030 gal: Decoupled X and Y grid step sizes
Made the X and Y step sizes for the grid separate in the GAL.

Cleaned up the types inside the DrawGrid functions.

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

(cherry picked from commit 45f10fcff1)
2019-05-28 20:37:07 -07:00
Jon Evans 4adf89b40b Improve image alpha handling in PDF and PS plotters
Fixes: lp:1825276
* https://bugs.launchpad.net/kicad/+bug/1825276
2019-05-27 12:35:12 -04:00
Seth Hillbrand b4e70e56a6 Eagle: Fix crash when importing Eagle V6
This fixes multiple issues when importing Eagle V6 files.

Crashes occured when arcs of 0-length were found and when parts were
referenced in the schematic that were not found in the library.  This
could happen if the library and schematic were different cases.

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

(cherry picked from commit 0e5cc54ec9)
2019-05-26 20:34:05 -07:00
Jon Evans 720b26d11e Eeschema: fix worksheet and background color for printing
Fixes: lp:1820611
* https://bugs.launchpad.net/kicad/+bug/1820611
2019-05-26 14:25:57 -04:00
Jon Evans e35be13b23 Eeschema: use worksheet color when plotting
Fixes: lp:1825568
* https://bugs.launchpad.net/kicad/+bug/1825568
2019-05-26 12:21:08 -04:00
Jon Evans ba19d93df9 GerbView: Fix selection of the last two grid settings
Fixes: lp:1827642
* https://bugs.launchpad.net/kicad/+bug/1827642
2019-05-25 17:14:35 -04:00