Commit Graph

3541 Commits

Author SHA1 Message Date
Jeff Young 2bcf38d2b6 Add try/catch block around writing a new library.
Fixes: lp:1825203
* https://bugs.launchpad.net/kicad/+bug/1825203
2019-04-18 22:00:32 +01:00
Jeff Young 0772b54845 Move eeschema zoom-selection to modern toolset.
Fixes: lp:1825164
* https://bugs.launchpad.net/kicad/+bug/1825164
2019-04-17 21:49:50 +01:00
Jeff Young c88fd514a0 Implement drawing tools in modern toolset.
Fixes: lp:1825192
* https://bugs.launchpad.net/kicad/+bug/1825192
2019-04-17 21:49:50 +01:00
Seth Hillbrand 2a00fc962b Fix error in contour check
Correct mistake in bool() that prevented checking correct contour for
end of vertex list.
2019-04-16 20:21:04 -07:00
Seth Hillbrand 8cc3c6f159 Prevent iteration over empty polygon
When utilizing the standard iterator container, we may have polygons
with an empty outline (these are generated by gerbview to pcbnew).  This
should register as the end of the iterator to prevent dereferencing
2019-04-16 17:26:58 -07:00
Jeff Young 460909ea9a Move click-to-place tools to modern toolset. 2019-04-16 16:20:52 +01:00
jean-pierre charras ad5a1fd963 SIM_PLOT_FRAME: cosmetic enhancement: add icons in main menu.
Fix also Upeer/lower case issues in main menu strings.
2019-04-14 15:31:46 +02:00
Jeff Young 91bf08df1a Move ZoomFitScreen from GetBoundingBox to GetDocumentExtents. 2019-04-14 01:44:47 +01:00
Jeff Young 94a948fdd1 Move grid selection for both Eeschema and Pcbnew to COMMON_TOOLS. 2019-04-13 18:43:35 +01:00
Jeff Young fc7f5630c7 Move eeschema zoom operations to modern toolset. 2019-04-13 18:43:26 +01:00
Jon Evans dec5d80180 Veto mouse warping from DRC dialog
Fixes: lp:1824630
* https://bugs.launchpad.net/kicad/+bug/1824630
2019-04-13 11:23:57 -04:00
Seth Hillbrand 822cd9c6ef eeschema: Remove UR_WIRE_IMAGE
The wire image undo/redo option required special handling and was only
used in a single location.  Replacing with single change handling
reduces the code complexity
2019-04-13 07:11:24 -07:00
Jeff Young dae41b7460 Remove legacy segment-based zones.
Give the user the option of cancelling a file open if there are
segment zones; otherwise they're converted to polygon fills.

Fixes: lp:1823087
* https://bugs.launchpad.net/kicad/+bug/1823087
2019-04-12 20:19:23 +01:00
Seth Hillbrand d70ae19cb8 eeschema: Move realtime connectivity to adv config
This allows realtime connectivity testing by modifying the
kicad_advanced setting rather than recompiling
2019-04-12 08:37:44 -07:00
John Beard ab2281d26f GAL opts: move config reading into GAL_DISPLAY_OPTIONS
Move repeated GAL config reading routines into GAL_DISPLAY_OPTIONS.
THe app-level config is in here already, do the same for the
common config.

This means that the configs are loaded consistently, which fixes
the symbol-chooser preview window, which previously didn't use the
same config routine as other GAL canvases.

Future work could move these functions to free functions that
act on the public interface of GAL_DISPLAY_OPTIONS to avoid
GAL_DISPLAY_OPTIONS having to know about wxConfig and wxWindow.

Fixes: lp:1824524
* https://bugs.launchpad.net/kicad/+bug/1824524
2019-04-12 16:08:11 +01:00
jean-pierre charras c162ff9076 Curved airwires: set the default to straight lines (i.e. the legacy behavior)
Add also missing comments.
2019-04-12 14:17:55 +02:00
MaPePeR e7d32c54b9 pcbnew: Draw Ratsnest with arcs to avoid overlap
Adds a toggle button that allows switching between straight lines and
curves for the ratsnest lines.

Fixes: lp:1766597
* https://bugs.launchpad.net/kicad/+bug/1766597
2019-04-12 00:28:58 +01:00
Jeff Young 3c11b89e4c Hook up refresh buttons to library tree synchronisation.
Fixes: lp:1820057
* https://bugs.launchpad.net/kicad/+bug/1820057
2019-04-11 19:45:10 +01:00
Seth Hillbrand 8c9244e677 Revert "eeschema: Connectivity threading"
This reverts commit 1a031e771f.

Some nets broken in commit.
2019-04-10 20:08:42 -07:00
Seth Hillbrand 1a031e771f eeschema: Connectivity threading
This threads the first step (update item) in the connectivity routine.
Also eliminates the duplicate call for multiple copies of the same
sheet.
2019-04-10 15:04:22 -07:00
Jeff Young b7c12b238f Increase GervView layers to 51.
This also makes its use of LSET consistent with PCBNew.

Fixes: lp:1809019
* https://bugs.launchpad.net/kicad/+bug/1809019
2019-04-10 21:21:00 +01:00
Seth Hillbrand 257d9b5fe9 Allow setting the kicad config dir
This allows setting the config dir at build time, providing packagers a
method of controlling where the configuration files are placed.

Fixes: lp:1780601
* https://bugs.launchpad.net/kicad/+bug/1780601
2019-04-08 12:33:49 -07:00
Jeff Young adf3637476 Allow dialogs to veto mouse-warping when called from context menu.
Fixes: lp:1745731
* https://bugs.launchpad.net/kicad/+bug/1745731
2019-04-08 20:07:40 +01:00
Jeff Young a1c162e59f Reimplement footprint checking on top of DRC architecture.
This allows Import Netlist and Update PCB from Schematic to
share the same checking code, and expose it through the DRC
dialog.

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

Fixes: lp:1809293
* https://bugs.launchpad.net/kicad/+bug/1809293
2019-04-08 13:26:17 +01:00
Jeff Young 77f15eeeaf Support synchronous messaging over KIWAY EXPRESS.
This allows us to make the various netlist and pcb update routines
more atomic and less reliant on carefully sequenced asynchronous
messages.

This is also a prelude to adding support for footprint testing
without a netlist.
2019-04-08 13:26:09 +01:00
Seth Hillbrand 24bf838392 pcbnew: Allow arc editing via midpoint
This permits changing the radius of the arc by adjusting the center
point of the arc.  The arc end points are fixed in this operation.
2019-04-07 06:50:25 -07:00
Jeff Young 684bb62fd8 Escape slashes in labels and netnames.
Also re-allows spaces, as they can already come in through sheet
names.

Fixes: lp:1798621
* https://bugs.launchpad.net/kicad/+bug/1798621
2019-04-07 00:24:10 +01:00
Jeff Young 1ae47b6069 Implement a copper-to-edge-clearance setting.
For legacy boards, the setting is picked up from the board outline
thickness.  If the board outline has mixed thicknesses, then the
max is used and a warning is displayed.

Fixes: lp:1797787
* https://bugs.launchpad.net/kicad/+bug/1797787
2019-04-05 22:18:44 +01:00
Jeff Young 2aad4a5e57 Remove dead code from removal of eeschema legacy canvas. 2019-04-05 15:54:31 +01:00
Jeff Young 5ac96c6127 More mutex locking for SCH_FIELDs.
Fixes: lp:1822678
* https://bugs.launchpad.net/kicad/+bug/1822678
2019-04-03 17:04:59 +01:00
Jeff Young 3ace73fbdd Fold various SCH pin shadow data structures into SCH_PIN. 2019-04-03 10:18:11 +01:00
John Beard 6f1c3f5ef8 Eeschema: construct simulator cursors on demand
Statically constructing wxCursors as used for the probe
and tune cursors crashes the qa_eagle_plugin test
instantly.

Fix this by introducing a new class CURSOR_STORE,
which allows to abstract the platform wierdness of wxCursors
and allow the simulator to laziliy init its own cursors
at runtime.

This code isn't properly tested, as these cursors are never
actually used. However, it does allow the eeschema unit test
to run.

Fixes: lp:1781191
* https://bugs.launchpad.net/kicad/+bug/1781191
2019-04-02 18:26:33 +01:00
Michael Kavanagh b0674b8802 Add Ctrl+, hotkey to preferences dialog
Also change interactive router settings from Ctrl+, to Ctrl+Shift+,
2019-04-02 12:57:27 -04:00
Jeff Young ee3bac5a32 Remove angle brackets from indeterminate string.
They don't really help any, and they confuse some users into
thinking they need angle brackets around real values.

Fixes: lp:1821601
* https://bugs.launchpad.net/kicad/+bug/1821601
2019-04-01 13:23:37 +01:00
Jeff Young 3da5396c8d Fixes for importing board setup properties.
Save/restore default netclass.
Read layers back in with correct syntax ('.' between keyword and layer name).
Write layers to project file.
Read/write layer enablement bits.
Don't set solder paste margin min to 0 (most of them are negative).

Fixes: lp:1811990
* https://bugs.launchpad.net/kicad/+bug/1811990
2019-04-01 13:23:37 +01:00
Jon Evans 83c7e7fc65 New connectivity algorithm and bus upgrades
Bus upgrades: core new connectivity code

Bus upgrades: eeschema integration and modifications

Bus upgrades: eeschema dialogs

Bus upgrades: netlist export

Bus upgrades: file format changes
2019-03-31 19:53:41 -04:00
jean-pierre charras 175a2bc0b4 Force time stamp to 32 bits unsigned values, and make it tolerant to files using 64 bits values.
define timestamp_t as uint32_t.

Fixes: lp:1821476
https://bugs.launchpad.net/kicad/+bug/1821476
2019-03-26 14:28:14 +01:00
John Beard 567bdd9b9d Add configuration of Hi-DPI canvas scaling in OpenGL
First, add automatic detection of toolkit DPI scaling options. For now, this
is, in order,

* Check the GDK_SCALE option under GTK+ (users can set this to force the scaling)
* Check the value from WX's GetContentScalingFactor(). This will start to work
  correctly from WX 3.1 and GTK+ 3.10.

Then, add a user-settable override in the main prefs panel, next to the icon
scaling. This is independent of the icon scaling options.

DPI handling is performed in a standalone class, so they can be shared between
the prefs UI and the OpenGL backend easily. Also means Cairo could use the same
interface in future.

Also adjust the OpenGL grid drawing code to use the computed scale factor,
which avoids over-thick grids in scaled environments (the user can manually
thicken the grid if wanted).

Fixes: lp:1797308
* https://bugs.launchpad.net/kicad/+bug/1797308
2019-03-25 15:00:55 +00:00
jean-pierre charras ecb168f7a7 Add MD5_HASH::Format for debug purposes. 2019-03-21 11:42:15 +01:00
Seth Hillbrand 078320e2fb Unify and correct Autosave functions
Autosave was not working correctly, partly due to different
implementations in eeschema and pcbnew and partly due to a mistaken
refactor at some point during v5 development.  This unifies the expected
autosave prefix to _autosave- for both pcbnew and eeschema.  It also
unifies the expected suffix for the backup files to -bak.

Fixes: lp:1820433
* https://bugs.launchpad.net/kicad/+bug/1820433
2019-03-18 10:25:26 -07:00
jean-pierre charras a1ee5405aa Fix missing definition of std::hash<wxPoint> when using wxWidgets 3.1.x
it was not compiled for wxWidgets 3.1.x, but it does not exist in 3.1.x
2019-03-14 17:33:25 +01:00
jean-pierre charras 3fc681c1b7 PROF_COUNTER: add a helper method. 2019-03-14 09:11:34 +01:00
jean-pierre charras d259459a14 Pcbnew: add a new primitive pad shape: chamfered round rect pad.
Allows 0 to 4 chamfered corners, not only one.

A custom shape allow this kind of shape. However because it is a primitive,
it is easier to edit and it support thermal reliefs.
2019-03-11 10:26:15 +01:00
Seth Hillbrand 9bfce26ce7 Move env var substitution into GetAssociatedDocument
We always want the documents to have their variables replaced when
opening the associated file.

Fixes: lp:1819309
* https://bugs.launchpad.net/kicad/+bug/1819309
2019-03-10 08:39:36 -07:00
John Beard b6916c490c Pcbnew: allow tab traversal of footprint orientation text control
Disable the text update event for the orientation cutom value field before
updating it when the radio buttons are selected. This allows to use the
conventional EVT_TEXT handler, rather than KEYDOWN, which has two effects:

* Tabbing though the dialog no longer sets custom orientation
* Click-driven clipboard actions trigger the update correctly.

Introduce a helper function in validators.h to assist in updating
validated fields without triggering further events.

Fixes: lp:1819006
* https://bugs.launchpad.net/kicad/+bug/1819006
2019-03-07 20:27:04 +00:00
Jeff Young 69f003ba4a Remove previous cell selection fixes in favour of slow-click hack.
wxWidgets has several bugs that result in cell editors being closed
right after they're opened.  There are two wxWidgets hacks to
partially address this: the SetInSetFocus() hack, and a slow-click
hack.  We used to try and work-around these bugs ourselves for
single-click access, but this changelist moves those over to
wxWidget's slow-click hack.

Fixes: lp:1817965
* https://bugs.launchpad.net/kicad/+bug/1817965
2019-03-04 11:09:33 +00:00
Seth Hillbrand 38be0fccb7 Symlib table: Need button handler for files
The folder button handler works will for footprint libraries but we
needed a specific class for the schematic libraries as well.

Fixes: lp:1818346
* https://bugs.launchpad.net/kicad/+bug/1818346
2019-03-02 20:05:28 -08:00
Wayne Stambaugh 8d26b07f67 Fix potential string iterator issue.
Added checks to StrCmpNum() function in common/sting.cpp to prevent
iterating past the end of the sting.  Also removed length of string
parameter since it did not seem to be used anywhere.

Fixes lp:1818157

https://bugs.launchpad.net/kicad/+bug/1818157
2019-03-02 08:20:53 -05:00
Jean-Samuel Reynaud c77031842e Fix another compilation issue on PPC64 2019-02-27 11:23:23 -05:00
Seth Hillbrand 269f420f8d OpenGL: Create shaders for each GL
Fixes: lp:1817284
* https://bugs.launchpad.net/kicad/+bug/1817284
2019-02-25 09:31:42 -08:00
John Beard 82734e7116 Adjust tab ordering in some dialogs
Introduce a shortcut method to set tab ordering and use it in
the dialogs that override the tab traversal orders:

* Eeschema sheet properties
* Pcbnew Move exact
* Pcbnew Move relative

Also set some initial focus fields in the same dialogs.

Tidy a few includes.

Fixes: lp:1816009
* https://bugs.launchpad.net/kicad/+bug/1816009
2019-02-23 14:49:38 +00:00
Seth Hillbrand dae7b03465 gal: re-enable arc outline mode
Fixes: lp:1816373
* https://bugs.launchpad.net/kicad/+bug/1816373
2019-02-21 10:52:54 -08:00
Seth Hillbrand 066b1782bb cairo: Fix grid display
Grid points were uneven in Cairo compared to OpenGL.  This standardizes
the functions for grid types and simplifies the code
2019-02-21 10:49:56 -08:00
Seth Hillbrand 484c1f63ba gtk3: Force GTK2-style input handling
GTK3 provides for additional input devices via xinput2.  These include
touchscreens and continuous scroll devices.  But wxWidgets does not have
specialized handlers for these events, so they double up for some
devices.  Until wxWidgets allows us to handle these events, we specify
that the input handler should be the old-style GDK_CORE.
2019-02-19 11:03:20 -08:00
Tomasz Włostowski 3b3c674c1a gal: opengl: use correct radius for graphical circles 2019-02-19 01:55:50 +01:00
Seth Hillbrand 5af8d2d0a8 cairo: Fix rotated oval pads
Fixes: lp:1816428
* https://bugs.launchpad.net/kicad/+bug/1816428
2019-02-18 09:44:28 -08:00
Jean-Samuel Reynaud 8c69c81393 Adding support for PPC32 and PPC64.
Modification proposed by Gianluca Renzi.
2019-02-18 05:35:52 -08:00
Jiaxun Yang 320f4b6cd9 Add MIPS N64 support for libcontext 2019-02-18 05:14:21 -08:00
Seth Hillbrand d15876595f Fix init order to quiet warnings 2019-02-16 12:53:45 -08:00
Tomasz Włostowski 85a7ab7795 gal: minor cleanup & formatting 2019-02-16 20:25:10 +01:00
Tomasz Włostowski bbee30671a gal: pixel alignment hacks, works for Retina display too now.
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL

Cleanup of pixel alignment patches

gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends

GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing

Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use).  Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.

gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
Seth Hillbrand 813578eba6 Fix a few coverity errors 2019-02-15 20:15:04 -08:00
Seth Hillbrand 99be68f0f2 Remove debugging printf
The extra wx/gal debug statements are called on initialization but are
not used.  Removing the printf prevents statements outputting that may
confuse end users
2019-02-15 18:14:58 -08:00
Seth Hillbrand 7b60c856e9 view_rtree: Map maximum BBOX2I onto maximum rtree
When re-drawing or re-caching all items, we need to search the full
rtree, including for those items that live outside of the limits of
BBOX2I.  This forces the maximum BBOX2I to the full RTree limits
2019-02-15 09:12:51 -08:00
jean-pierre charras 869bdc2b3c Eeschema: regression fix: re-enable hold down control+shift to disable grid snapping when moving the mouse.
Fixes: lp:1815487
https://bugs.launchpad.net/kicad/+bug/1815487
2019-02-12 13:12:06 +01:00
Seth Hillbrand 7b3ef1b7ed colors: Add HSL conversion and tune colors
When adding colors to length tuner, we depend on the window background
color, which can be set by the user, resulting in an unreadable text.
This uses the HSL conversion to detect which shade it should use for the
coloring.

Also adds test cases for round-trip HSL and HSV conversion

Fixes: lp:1814530
* https://bugs.launchpad.net/kicad/+bug/1814530
2019-02-11 22:08:41 -08:00
John Beard 0c6ec7dbb3 LIB_TABLE_BASE: Const and unsigned fixes
* Make LIB_TABLE_BASE::GetCount() return unsigned. This is more
  consistent with the behaviour of STL containers (especially the
  boost::ptr_vector this is really accessing). Sadly
  wxGridTableBase() forces an int, so a cast is still required
  at the WX interface.
* Make LIB_TABLE_BASE::At() return a reference. First, this is more
  consistent with normal STL indexing operator[]'s, and secondly, it
  allows an idiomatic const index method (so you can access const
  LIB_TABLE_ROWs from a const LIB_TABLE_BASE).

The motivation is to allow use of this class and LIB_TABLE_ROW
in a test program, where the LIB_TABLE_BASE is const.
2019-02-05 08:49:52 -08:00
John Beard 84d79ec10d QA: LIB_TABLE tests
Some basic tests on LIB_TABLE and LIB_TABLE_ROW that demonstrate
the behaviour of fallbacks and various access methods.

Also add a few LIB_TABLE_BASE comments and changed some NULLs to
nullptr.
2019-02-04 19:44:54 -08:00
John Beard e6a6266f3d Build: libpolygon provides its own includes
Libpolygon can provide its own includes via target_include_dirs PUBLIC.
This means any linking targets do not need to specifiy them manually.

As common requires polygon, the polygon dep is also now no longer
required downstream of libcommon, as it's transisitvely implied
by libcommon's target_link_libraries.

This resolves a circular dependency previously detected and also
simplifies CMakeLists.
2019-02-04 19:29:31 -08:00
John Beard bb2ae8e13b Bitmaps: move bitmap defs to bitmaps library
The bitmap definitions (BITMAP_DEF and so on) do not
have any dependencies on other libs, including WX. This
means the bitmaps library can be isolated from the other
dependencies.

Common now depends on bitmaps, and libraries that depend
on common can pick it up from the common target_link_libraries,
as it is PUBLIC. This means a lot of targets no longer
need manual bitmap linkage.

This avoids a circular dependency that was previously reported
by static analysis.

Avoiding pulling in WX and other headers into the include
tree of each bitmap .cpp is a huge speed up (around 10x) in
compilation, and the generated static library is also 10x
smaller (20MB vs 200MB)

Add common as a link library to pnsrouter,connectivity.
THese library do still use common code (including bitmaps,
via base_screen.h) and this allows them to pick up the libcommon
includes correctly.
2019-02-04 19:29:31 -08:00
Seth Hillbrand d7272b7f5e eagle: Handle DRC rule-based pad shapes
Circles and Squares are handled correctly.  Octagons are converted to
circles.  Pad 1 is identified by the "1" string in the Eagle name.

Fixes: lp:1784126
* https://bugs.launchpad.net/kicad/+bug/1784126
2019-02-04 07:06:49 +01:00
Tomasz Włostowski 313ebb9dff router: correct walkaround corner case when both ends of the line lie on the hull edge
Fixes: lp:1810935
* https://bugs.launchpad.net/kicad/+bug/1810935
2019-02-03 11:22:18 +01:00
Jeff Young ba7b970817 Add pre-select architecture to grid helper icon-text-buttons.
Fixes: lp:1813973
* https://bugs.launchpad.net/kicad/+bug/1813973
2019-01-31 01:09:03 +00:00
Seth Hillbrand b14bc1bead svg: Use grouping
Uses existing grouping in SVG output.  Sets schematic components as a
grouped element in SVG as well as pcbnew elements per layer.

Fixes: lp:1011754
* https://bugs.launchpad.net/kicad/+bug/1011754
2019-01-30 16:58:33 -08:00
Seth Hillbrand 37741048ce plot: Correct a couple SVG output errors
Plotting to closed lines for polygons in SVG.  Also correct the filled
polygon line width for non-copper zones.

Fixes: lp:1813964
* https://bugs.launchpad.net/kicad/+bug/1813964
2019-01-30 15:41:36 -08:00
John Beard 88f9f6f072 Break out ref-des-centric functions to own header
This breaks the following functions out to a general-purposed refdes utils
header:

* MODULE::GetReferencePrefix()
* kicad_string.h RefDesStringCompare()

This acheives:

* Slimming of MODULE interface
* Placement of refdes code in common rather than pcbnew
** Testing of this code in qa_common
* Tighter and smaller includes for code that only needed refdes functions

Note: there are failing tests commited (as expected failures). These
are the cause of lp:1813669 and will be fixed as a follow-up commit.
2019-01-30 15:41:36 -08:00
John Beard dc20521cb9 Break out getTrailingInt from MODULE
This is not logic specific to MODULE. Breaking it out to
kicad_string.h acheives:

* Slimming of the MODULE interface
* Enables reuse of the function
* Enables testing of the function

Also add a test under qa_common for this function.
2019-01-30 15:41:36 -08:00
John Beard f85f10930a Break widget save/restore out to reusable class
The CONFIG_SAVE_RESTORE_WINDOW class does not need to be tied
to the array dialog, put it in common/widgets.

Also do a refactor and tidy-up of the the class, use a union for (slightly)
better type-safety and syntax (a variant would be better but that's C++17).

Also enable integral field save/restore from text boxes.
2019-01-30 15:41:35 -08:00
John Beard 5504981d00 Separate ARRAY_OPTIONS to own class in common
The geometry and numbering logic is separate to the dialog, and
can be separated for clearer logic and better testability.

Moreover, refactor it to avoid any dependency on pcbnew
classes, so it can be move to common for potential re-use in
eeschema and friends in future.

Also convert all wxPoint logic in these classes to VECTOR2I and
fix some function visibilities.

Add some unit tests of the ARRAY_OPTIONS geometry and numbering.
2019-01-30 15:41:35 -08:00
Jeff Young b3319d29c1 Init footprint chooser with current footprint.
Fixes: lp:1813882
* https://bugs.launchpad.net/kicad/+bug/1813882
2019-01-30 15:45:29 +00:00
John Beard 6880687f00 Geom: interate ClipperLib::Path by reference
ClipperLib::Path is std::vector<IntPoint>. Iterating this with
"for( auto point : path)" could result in 'n' IntPoint copy-constructions.
It does seem GCC 8, at least, manages to optimise these constructions
out.

Replace with the "standard" for( const auto& point : path) idiom.
2019-01-30 11:55:11 +01:00
Seth Hillbrand 9d99fd188f Revert "Change top selection drop-down to combobox"
This reverts commit 7d06651a10.
2019-01-28 10:15:32 -08:00
Seth Hillbrand 9742062712 Revert "Fix missing Choice->Combobox change"
This reverts commit 0fa374cce5.
2019-01-28 10:15:25 -08:00
Seth Hillbrand 823dce1a50 modedit: Allow name input for new footprint library
When prompting for a new footprint library, we need to treat the input
as a file for creation rather than a directory for selection.
Otherwise, users cannot specify the name of their new footprint library
independently of the existing directory names.

Fixes: lp:1812135
* https://bugs.launchpad.net/kicad/+bug/1812135
2019-01-22 15:40:10 -08:00
John Beard 267e17d539 QA: Add a generic utility tool executable.
The intention here is to make it possible to wrap up many of the
KiCad utility tools into a single executable. This reduces link times
as well as the duplication of CMake files needed to build very
similar tools.

This particular tool should be suitable for any code in common,
code in pcbnew and other end-executables probalby will need an
analagous version linked to the relevant kiface.

The first tool is the coroutine_example.cpp test case, which
can be useful when learning, debugging or porting the coroutine
infrastructure.
2019-01-22 09:04:38 -05:00
Baranovskiy Konstantin 65f5bd6a01 Dialog: Esc key closes a grid editor first.
CHANGED: By default dialog closes on Esc key immediately and if dialog
has a grid control there is no way to close a cell editor with canceling
changes. New behavior is next: if dialog has a grid and the grid has an
active cell editor Esc key closes cell editor, otherwise Esc key closes
the dialog.
2019-01-19 14:55:15 -05:00
Seth Hillbrand 4a68ae4bae polygon: Fix missing steiner removal and fracture
When removing steiner points, there is the possibility that the test
point is also removed.  In this case, it is no longer a member of the
linked list and will break the output.

The test for re-fracturing a broken polygon can also result in multiple
polygons, rather than only 0 or 1.  Skipping the extra polygons will
result in a limited tesselation.

Fixes: lp:1812393
* https://bugs.launchpad.net/kicad/+bug/1812393
2019-01-18 09:19:39 -08:00
jean-pierre charras e2afe5e1a3 Toolbars with wxComboboxes: Fix incorrect ReCreate Toolbar methods: they recreated these wxComboboxes without deleting the previously created.
This issue created memory leak and not working wxComboboxes (for instance after modifying the language selection).
Now, these wxComboboxes are created only once, never recreated.

Also: minor cosmetic enhancement in footprint editor main toolbar
(the save footprint icon is modified if the footprint is saved to the board or to the library)
2019-01-18 17:24:40 +01:00
jean-pierre charras 6bea0951a3 SHAPE_ARC: fix uninitialized member in a CTOR that created issues in a QA test.
Initializing all members is always good.
2019-01-17 16:35:54 +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
jean-pierre charras 644855c5ba Fix incorrect (broken) canvas type saving in config.
The config was saving a canvas type EDA_DRAW_FRAME member not always accurately initialized.
And the last canvas opened frame setup was saved, not necessary a frame having a canvas type that can be set by user.
This is a broken feature especially because the footprint viewer has a fixed canvas setting.
2019-01-11 13:19:46 +01:00
Seth Hillbrand fe30460aeb gal: Save canvas type unconditionally
The canvas type might change without the frame being notified.  If this
happens, the user is presented with repeated notifications of OpenGL
issues.  Howver, switching canvas is not an error and should be
presented to the user as an info message to clarify that the system is
still working but it has changed how it renders the screen.

Fixes: lp:1795240
* https://bugs.launchpad.net/kicad/+bug/1795240
2019-01-09 10:36:01 -08:00
John Beard 658cc8fd96 Wildcards: unify handling of all files wildcards
Use the AddFileExtListToFilter() to also generate the
wildcard for "all files". This is because:

* Users can use AddFileExtListToFilter for the all files WC
  with the same interface as for any other extensions.
* Users do not need to worry about wxGetTranslation, as the
  _() is applied in the same way as the other *Wildcard() helpers,
  and it is a function just like the others, so it is consistent
* There is a testable interface to document the expected result.
  The test is added.
2019-01-09 08:57:42 -05:00
John Beard dd313d4d47 Wildcards: use vectors instead of varargs + tests
Varargs make it very hard to pass strings in flexibly
when they (and the number of them) are not known
at compile time.

For example, this allows up to now amalgamate the "single
ext" and "multiple ext" unit tests.
2019-01-09 08:57:35 -05:00
Fabián Inostroza 7f6b35c6bc Don't start autopan if the cursor was warped
The application warps the cursor when initiating some actions (dragging,
selecting modules or Find and Move).  This warping should not also
trigger the autopan action.

Fixes: lp:1810787
* https://bugs.launchpad.net/kicad/+bug/1810787
2019-01-08 12:15:33 -08:00
Seth Hillbrand 90ad240660 units: Move common units and add tests
Centralizing duplicate code from Eeschema and pcbnew and adding unit
tests
2019-01-08 09:29:32 -08:00
Seth Hillbrand 8f11a2133e Revert "QA: Add a generic utility tool executable."
This reverts commit 502306314e.
2019-01-06 16:17:44 -08:00
Seth Hillbrand 1e5ba6f1b1 Replace DIM() macro
The standard DIM() macro was not typesafe as it happily deferred errors
to runtime that can be caught at compile time.  Replacing it with a
generic C++11 constexpr allows for typecasting, comparison and compile
time error checking.
2019-01-06 08:43:12 -08:00
John Beard 502306314e QA: Add a generic utility tool executable.
The intention here is to make it possible to wrap up many of the
KiCad utility tools into a single executable. This reduces link times
as well as the duplication of CMake files needed to build very
similar tools.

This particular tool should be suitable for any code in common,
code in pcbnew and other end-executables probalby will need an
analagous version linked to the relevant kiface.

The first tool is the coroutine_example.cpp test case, which
can be useful when learning, debugging or porting the coroutine
infrastructure.
2019-01-06 07:51:23 -08:00
Seth Hillbrand e8333633fe GAL: Add antialiasing options to Cairo
Cairo supports antialiasing when rendering but can be slow when set to
sub-pixel mode.  This bumps the minimum version of Cairo to 1.12
(available in 14.04 LTS as well as mingw) to support three antialias
settings (fast, good, best) that offer speed/appearance tradeoffs.

This can provide a higher-quality eeschema render as it works on a
per-element basis as opposed to the OpenGL per-screen antialias.
2019-01-04 13:39:56 -08:00