Commit Graph

1163 Commits

Author SHA1 Message Date
Ian McInerney 879a8f4efb Rework the file history menus to not need references to the file history
Keeping a pointer to the actual file history inside a special
file history menu led to many cases of use after free crashes,
so instead rework the actual file history to add the menu
items.

Fixes https://gitlab.com/kicad/code/kicad/issues/3741
2020-02-25 16:18:10 +00:00
jean-pierre charras 7206b567ac Gerbview: Gerber attributes display: fix incorrect attributes deletion.
The Gerber attribute deletion command (%TD,xxx) always cleared all attributes,
instead of clearing xxx attribute.
Therefore some attributes were not always displayed.
2020-02-23 09:42:02 +01:00
Jeff Young 4014afad54 Remove unused functionality. 2020-02-20 21:29:52 +00:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Ian McInerney b1240b5b1e Gracefully shutdown tools when frames are closed
If the tools are not gracefully exited, then the stack variables are
never destroyed, so variable lifetime issues can occur.

Fixes https://gitlab.com/kicad/code/kicad/issues/1753
2020-02-05 22:23:24 +00:00
Jeff Young a04fdf64da Improve directory handling for Project Save As.
1) don't change directory names that we don't recognize
2) when we do, make sure the child files get copied to the
changed name.

Fixes https://gitlab.com/kicad/code/kicad/issues/3834
2020-02-03 15:08:01 +00:00
Ian McInerney 88e0ef548d gerbview: Add default filename to export to pcbnew function
Some platforms (such as Linux) don't automatically append file
extensions, so we should ensure extensions are correct and the user is
prompted accordingly.

Fixes https://gitlab.com/kicad/code/kicad/issues/3817
2020-01-26 15:44:30 +00:00
Ian McInerney 06c979dfaa Convert all CMake paths to absolute instead of relative
It is cleaner and safer to handle the include and source paths
as absolute from the source directory instead of relative to every
path.
2020-01-22 23:27:20 +00:00
Jeff Young 45ca0a5ab8 Avoid divide-by-zero. 2020-01-15 18:50:47 +00:00
Jeff Young 836c1ea56e Fix a bunch of un-caught boost::bad_pointer exceptions.
This also removes vector cover types which do nothing except obfuscate
the underlying implementation.

Mainly changes SCH_SHEET_PINS and CONFIG_PARAM_ARRAY (which will soon
be replaced by Jon's new stuff).
2020-01-12 19:55:00 +00:00
Seth Hillbrand 7c28c3838a Comment-only changes
Makes class comments conform to coding standards
2020-01-10 16:43:01 -08:00
Jeff Young 7bb9551801 Handle boost exceptions. (From Coverity scan.) 2020-01-11 00:04:01 +00:00
Seth Hillbrand 77c60d9655 Remove the last vestiges of dlist
It served us (mostly) well for more than a decade.  It helped KiCad grow
before the std:: came into decent shape or speed.  It was a good little
list.

RIP DLIST 2008-2020
2020-01-10 06:37:08 -08:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Jon Evans 4ae4c4e243 Switch from JSON11 to nlohmann/json in GerbView
See #3638
2020-01-04 10:46:49 -05:00
Jon Evans 0748ec16ed Fix assertions in progress bar on MSW64 2020-01-04 10:46:49 -05:00
Ian McInerney b18b08e944 Deprecate DLIST in GerbView 2020-01-03 19:40:11 +00:00
jean-pierre charras baa1db031e Fix incorrect arc bounding box calculation.
add comments to SHAPE_ARC ctor.
2020-01-03 14:27:00 +01:00
jean-pierre charras ce77106994 Remove code only used during a test. 2020-01-02 20:44:43 +01:00
jean-pierre charras 3543de039b More about code cleaning.
Remove useless includes and dead code
2019-12-31 13:08:50 +01:00
jean-pierre charras 8d649b5351 Gerbview: cleanup code.
Remove GERBER_FILE_IMAGE_LIST dependency to EDA_ITEM, useless.
GERBER_FILE_IMAGE: replace DLIST by std::deque to store gerber draw items.
Remove dead code
2019-12-31 11:58:43 +01:00
Mark Roszko 19ceb11ae7 Change more enums over to scoped enums 2019-12-28 00:55:11 +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
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Ian McInerney 0259e0ba07 Cleanup struct initialization and formatting 2019-12-17 16:09:32 +00:00
jean-pierre charras 25504319df Gerbview,export to pcbnew: avoid exporting not valid polygons.
Gerber regions are exported as polygons (they are filled polygon).
The fix ensure the polygons are simple and valid.
2019-12-15 11:50:19 +01:00
jean-pierre charras 962baf8b6c Gerbview: fix crash or incorrect drawings after code change in shape_line_chain 2019-12-14 10:14:50 +01:00
Seth Hillbrand c4d853c1e8 SHAPE_LINE_CHAIN: Remove element access
This is the first step to allowing non-segments in the line chain.
External routines cannot be allowed to change the line chain without
going through the internal routines.  To accomplish this, we remove the
Vertex() and Point() access routines and only leave the const versions.
Transformations are given for both points as well as the chain itself.
2019-12-12 13:54:48 +00: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 a2edf9c442 Unified update to C++14 std::make_unique
This update replaces the existing uses of unique pointer creation with
the C++14 std::make_unique call that provides proper memory release in
event of an exception.
2019-12-05 10:43:55 -08:00
John Beard 44a6a61ff9 Gerbview: fix formatting assert
In GERBVIEW_FRAME::loadListOfGerberAndDrillFiles, the variables
ii and aFilenameList.GetCount() are unsigned and size_t, respectively.

This means the format string must be %u and %lu, respectively.
2019-11-24 12:27:23 +08:00
Ian McInerney 99b9354a51 Add clear recent files action to the menus
ADDED: Menu item to allow the recent file lists in each program to be
cleared

Fixes: lp:1821685
* https://bugs.launchpad.net/kicad/+bug/1821685
2019-11-23 23:35:21 +00:00
jean-pierre charras 71cd8c57bf ADDED: Pcbnew, add "pin function" (pin name in eeschema) to pads.
The pin name defined in Eeschema is now available as pad info.
Useful for the board designer (the pin function is displayed in the message panel).
Needed for the Gerber P&P files.
2019-11-23 09:12:43 +01:00
jean-pierre charras 32043cfa26 Gerbview: add parsing of optional Aperture Macro parameter.
AMP_CIRCLE primitive has 4 or 5 parameters (last is optional)
Reading the optional parameter was missing.

Fixes: lp:1852924
https://bugs.launchpad.net/kicad/+bug/1852924
2019-11-18 09:06:43 +01:00
Jeff Young 04b0feb365 Fix a couple of issues in new Save As command.
Handle symbols as well as strings in the "source" lists of
netlist files.

Handle Protex gerber file extensions.

Check for project_name-whatever pattern for files that we
don't recognize (such as project_name-NPTH-drl_map.ps)
2019-11-11 20:36:48 +00:00
Jeff Young 10abc6097f Cleanup, commenting, etc. 2019-11-10 14:52:01 +00:00
jean-pierre charras 4de6ed6206 Fix issues created by Adds Save As... to the Kicad manger.
Mainly replacing std::string by wxString to manage filenames.
On Windows, a sdt::string cannot manage a filename, unless using
in many places TO_UTF8 and FROM_UTF8.
So the best way is to use a wxString for filenames and error messages.
2019-11-10 09:37:39 +01:00
Jeff Young b5904b0401 Installment one of project Save As... feature.
ADD: Adds Save As... to the File menu for the project window.

Fixes: lp:594051
* https://bugs.launchpad.net/kicad/+bug/594051
2019-11-09 20:22:44 +00:00
Seth Hillbrand 6625d0721e Implement Get/Set display options
The pointer passing for display options is deprecated.  This removes the
excess casting as the EDA_FRAME didn't need the base call with no value.
All requests for display options are now returned const and are updated
with a Set() routine after modification.

In Gerbview, this resolves an issue where the display options were not
stored because it was receiving the NULL from EDA_FRAME.
2019-11-07 08:26:44 -08:00
jean-pierre charras c59fa1b672 Gerbview: Fix outdated warning message about missing D-Codes and old RS274D files.
RS274X Gerber files using only regions (polygons) can be valid, and are not old RS274D files
Now a warning is raised only if there are some missing D codes definitions
(RS274D file or broken RS274X file)

Remove unused var and add comments

Fixes: lp:1850821
https://bugs.launchpad.net/kicad/+bug/1850821
2019-11-01 08:34:24 +01:00
jean-pierre charras 4a0bd46ed6 More work on Gerber pick and place files
In P&P files, user strings are now quoted, and use UTF8 encoding
2019-11-01 08:34:24 +01:00
jean-pierre charras 0878c7c64c Fix typo 2019-10-15 17:51:29 +02:00
jean-pierre charras 337244d423 Gerbview: displays aperture attribute value (TA.attribute) for Regions (polygons) having no dcode 2019-10-12 14:04:41 +02:00
jean-pierre charras 1a3f4fb38b Gerbview: enhancement: show attributes for polygons (Regions in Gerber dialect) 2019-10-06 17:34:35 +02:00
jean-pierre charras 9d617502d5 Gerbview: fix missing grid initialization at starting. 2019-10-03 18:33:16 +02:00
jean-pierre charras c3175b45af Gerbview: fix incorrect canvas type saving after closing Gerbview.
Was due to the fact the canvas type was now saved into m_canvasType when opening Gerbview.
2019-10-02 18:19:44 +02:00
jean-pierre charras 937b5bd69a Gerbview allows larger DCodes values (previously DCode id number max 999, now 10000)
This is not the DCodes max count but the DCode id (like in %ADD20C,0.05*%: the id is 20)
2019-09-16 14:49:26 +02:00
Jeff Young 2553dd2942 Bail on our custom dockart provider.
It appears that it was causing some crashes, and it was never clear
that it looked better anyway.
2019-09-06 23:38:20 +01:00
Jeff Young 3bd38ec245 Improve zoom-to-extents for footprints with long text.
Fixes: lp:1820540
* https://bugs.launchpad.net/kicad/+bug/1820540
2019-09-05 21:02:29 +01:00
Jeff Young ebbb12e978 Give empty preference pages the right parent.
Fixes: lp:1841665
* https://bugs.launchpad.net/kicad/+bug/1841665
2019-08-27 21:50:52 +01:00