Commit Graph

73 Commits

Author SHA1 Message Date
Jon Evans 2fc9c7233d Add color layer for schematic aux items
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4825
2020-08-09 17:39:52 -04:00
Ian McInerney c458b50fd9 Ensure the environment variables are synchronized between KiCad and Python
Before this, the environment variables inside Python wouldn't reflect
the updates to them made after the interpreter was started in Pcbnew.
This will call into Python and set the variables when they are changed,
since Python can't synchronize itself when running in an embedded
interpreter.

Fixes https://gitlab.com/kicad/code/kicad/issues/5071
2020-08-09 19:56:12 +01:00
Jon Evans 43ab43ec9e Fix a few issues with Close Project
A new empty project needs to be reopened for now
Footprint info cache write only works with a project for now
2020-08-09 11:13:50 -04:00
Peter Montgomery 4d460ec073 Delete 3D cache files with GUI settable number of days
KiCad stores 3D cache files but never gets rid of any of them.
This patch adds a new function called 'CleanCacheDir()'.  Any cache
files older than the passed 'number of days' parameter are deleted.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/1928
2020-08-09 10:41:45 +00:00
Jon Evans 79e40cf765 Fix a few issues with Close Projects MR
Store list of previously open projects only in kicad.json
Keep all management of open projects in SETTINGS_MANAGER

Also add kicadSettings() for convenience
2020-08-08 16:00:49 -04:00
jean-pierre charras f46c1ccb32 Fix another incorrect (and useless) conversion of a wxString to and from std::string.
This useless conversion breaks non ASCII8 strings.
2020-08-07 19:44:34 +02:00
jean-pierre charras ea71d9db81 Fix incorrect (and useless) conversion of a wxString to and from std::string.
This useless conversion breaks non ASCII8 strings.
2020-08-05 18:34:49 +02:00
jean-pierre charras a146cd9e2e JSON_SETTINGS: add more wxLogTrace() calls. 2020-08-03 08:44:34 +02:00
jean-pierre charras df4226f896 Settings management: try to fix full filename issues when using non ASCII7 chars.
The fix convert all std::string storing a path to wxString (unicode support)
wxString were already used at many place to store paths, but not all.
For internal calculations mixing char strings and wide char strings is a recipe
for bug: any missing conversion between UTF8 and wxString breaks paths.
2020-08-02 21:31:03 +02:00
Jon Evans aae40148dc Switch to ordered_json and enable ignore_comments parser option 2020-08-02 13:11:16 +00:00
Jeff Young a58a75366e Give up on a cross-platform solution to non-ascii filenames.
Sometime it might be worth giving another go at it, but for now I
just put conditional compilation in.

Fixes https://gitlab.com/kicad/code/kicad/issues/5024
2020-08-01 19:47:29 +01:00
Jeff Young 689910ab0a Add missing include. 2020-08-01 15:57:44 +01:00
jean-pierre charras 91e00e14a9 JSON_SETTINGS: partial fix of non ascii7 filenames on Windows.
It should work with ASCII8 filenames, but the member
m_filename is probably not always correctly initialized in all cases.
2020-08-01 16:08:39 +02:00
Jeff Young 61c817377f Support for wchar_t Windows filenames in JSON settings. 2020-07-31 21:01:13 +01:00
Jeff Young 6e4d4401ae Make sure to translate UTF8 std::string to wchars for wxString.
Fixes https://gitlab.com/kicad/code/kicad/issues/5024
2020-07-31 14:48:45 +01:00
Mark Roszko 8324cb30b7 Save the wxDisplay index to set the position of windows correctly
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4338
2020-07-27 02:53:56 +00:00
Jeff Young f97c50bfde Give excluded DRC items their own layer.
(And fix a bug with the new mulit-layer zones and rule-based keepouts
at the same time which prevented me from testing it.)

Fixes https://gitlab.com/kicad/code/kicad/issues/4954
2020-07-24 01:28:25 +01:00
Jon Evans a107f7ce5b Fix a few issues with legacy project loading
- Prevent crash on project tree for "Empty project" item
- Correctly handle loading of legacy projects in tree view
- Fix an issue where legacy projects would not get saved

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4944
2020-07-20 19:39:59 -04:00
Ian McInerney 50b2271f84 Fix missing variable initialization 2020-07-18 23:56:39 +01:00
Jon Evans 5401f06fce Don't nag when we can't save project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4164
2020-07-16 22:56:02 -04:00
Jeff Young 7d07e6719f Make sure eeschema default grid is 50mils.
Fixes https://gitlab.com/kicad/code/kicad/issues/4835
2020-07-15 13:51:12 +01:00
Jon Evans b1b9cef5fb Full-project automatic backup system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4763
2020-07-09 13:55:19 +00:00
jean-pierre charras 8c15ecf8e4 Gerbview: fix issues when setting the grid color and the worksheet color.
The issue for the grid color was due to the fact there are 2 places to
store the color: the color settings and the m_gridColor GERBVIEW_FRAME member.
The worksheet color (color set to RED after a color change in layer render)
is a bit strange: looks like LAYER_GERBVIEW_WORKSHEET and LAYER_WORKSHEET
are both used to draw the worksheet.
2020-07-08 18:49:12 +02:00
Jon Evans 3dd2dc89ad Fix default values for color theme editor
At the time of creating a copy, the defaultColors map
is not initialized, so needs to be initialized from the
copy constructor.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4841
2020-07-08 12:19:10 -04:00
Jon Evans 6eca886292 Fix some UTF8 issues with project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4808
2020-07-05 12:26:14 -04:00
Jon Evans d143e14694 Fix memory leaks in color theme editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4794
2020-07-03 22:34:41 -04:00
Jon Evans 4dbbe1cf68 Project settings fixes from review
- Fix file extension for new project
- Fixes for exceptions on MSW
- Fix some ASAN issues
- Allow SETTINGS_MANAGER to run headless
- Don't flag schematic as modified after schematic setup is closed
- Don't automatically unload projects when LoadProject is called
- Don't unload project if it's the same as the current one
- Make sure to properly init/de-init template field names
2020-07-02 22:08:54 -04:00
Jon Evans fe5959b625 Remove the schematic and board backup file system
Per discussion on the developers list, this old system
no longer provides much value and is seen as annoying
by many users.  The new save logic should prevent any
cases of file corruption on save, which was a major
reason for the backup file system existing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2012
2020-07-02 22:08:54 -04:00
Jon Evans 12b4a55ae8 Port Eeschema to new project settings
DRC/ERC error serialization changed to use explicit tokens
Old stored severities and ignored errors are discarded
2020-07-02 22:08:54 -04:00
Jon Evans c0aa6965de Migrate PcbNew project settings to new framework
Various architecture upgrades to support this.
Creating a BOARD now requires a valid PROJECT, which caused
some (mostly transparent) changes to the Python API internals.

ADDED: Project local settings file
CHANGED: Board design settings are no longer stored in PCB file
CHANGED: Net classes are no longer stored in PCB file
CHANGED: Importing board settings now reads boards, not just projects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2578
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4070
2020-07-02 22:08:54 -04:00
Jon Evans 0e2f9cb1bd Migrate CvPcb project parameters 2020-07-02 22:08:54 -04:00
Jon Evans a4fadfcdf2 Begin moving project file load to new system 2020-07-02 22:08:54 -04:00
Jon Evans a5a19076fd Move PROJECT storage to SETTINGS_MANAGER 2020-07-02 22:08:54 -04:00
Jon Evans a7708fa6dc Add PROJECT_FILE and basic load/unload methods 2020-07-02 22:08:54 -04:00
Jon Evans bd19c580f4 Add configuration for cross-probing behavior
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2317
2020-06-27 22:48:48 -04:00
jean-pierre charras 534bcc8db0 very minor fix: change the default value user grid size to 10mils
Previously, was 12.5 mils, acceptable for pcbnew but not for eeschema.

Now set to 10 mils.
2020-06-25 10:17:27 +02:00
Ian McInerney 9d78aa604f Force OSX to automatically scale the canvas on legacy settings read
As of ab83c862, the canvas scaling setting is now used on OSX
(before it was ignored). Legacy settings would have this set to 1.0,
which would not automatically scale the canvas and break on Retina
displays. OSX auto detection works well enough in wx 3.0, so we
can use it now.
2020-06-15 00:30:52 +00:00
Jeff Young ad12c42e8b Push grid settings dialogs down into common.
This also gives support for fast grid switching and a user grid
to eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/2200
2020-06-14 19:26:37 +01:00
Seth Hillbrand 810f668d45 Fix compile error
Reading integer config values are implicitly cast and need to be
specified.
2020-06-14 06:53:12 -07:00
Jeff Young c48f4272f3 Collapse a level out of the zoom settings.
The APP_SETTINGS_BASE now holds the list of zoom factors, and
the old legacy (screen-based) code has been removed.
2020-06-13 22:44:16 +01:00
Jeff Young fc44506fe1 Give up on enforcing non-defined-internal-units.
It results in trade-offs in packaging and/or conidtional compilation
which are worse than the disease.
2020-06-13 22:44:16 +01:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Ian McInerney 60915fbc76 Default canvas scale setting to automatic on OSX
Fixes https://gitlab.com/kicad/code/kicad/issues/4652
2020-06-12 18:39:08 +01:00
Jon Evans daad2824c5 Add ability to skip JSON writes if the params aren't modified 2020-05-30 18:07:24 -04:00
Jeff Young 9f2be3714f Add unresolved variable testing for worksheet items. 2020-05-28 17:36:22 +01:00
Jon Evans 40dc7a5eef Update legacy migration of common settings for mousewheel pan 2020-05-26 21:43:59 -04:00
Jon Evans a52435bbb0 ADDED: New mouse settings panel, expanded mouse settings
You can now choose the behavior of dragging with the
middle and right mouse buttons.

You can also choose which modifier keys to use for
panning and zooming with the scroll wheel or trackpad.

You can also customize the zoom speed, which makes
it possible to have a good zoom experience on a wider
range of input devices.

You can also now zoom by dragging with the right or
middle button if desired.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3885
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4348
2020-05-24 14:38:28 -04:00
Ian McInerney 4ecf99e7c8 Give the footprint viewer a toolbar and remove the options dialog
CHANGED: Cvpcb fpviewer and the pcbnew fpviewer no longer have an options dialog
ADDED: Add a side toolbar to the pcbnew footprint viewer (and the measure tool)

This also cleans up some of the settings structs in the viewers, since
it was somewhat confusing before.

Fixes https://gitlab.com/kicad/code/kicad/issues/2205
2020-05-24 11:58:33 +01:00
Jon Evans d599648ec7 ADDED: Enable color themes for schematic printing 2020-05-16 13:19:43 -04:00
jean-pierre charras 3f8d11144e Avoid crash when reading a json config file having an unexpected parameter value.
Now print the json path in debug mode instead of crashing.
In release mode, skip the parameter (the default value is still used)

Fixes #4451
https://gitlab.com/kicad/code/kicad/issues/4451
2020-05-15 15:02:40 +02:00