77 Commits

Author SHA1 Message Date
Jon Evans
5426bfcdcd Don't autosave future formats of project settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19910

(cherry picked from commit 7d689e0c616c8af4b056f20ce3c95c37624e3df7)
2025-02-10 19:20:56 -05:00
Wayne Stambaugh
e09b095533 Common folder housekeeping part 3. 2025-01-16 11:50:08 -05:00
Jeff Young
5524ff3770 Formatting. 2025-01-08 15:39:47 +00:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Marek Roszko
d3eb8b677a Fix extension append check in JSON_SETTINGS::GetFullFilename
Doesn't make sense to return the filename if the filename is "json."
2024-12-21 12:02:30 -05:00
Jon Evans
09652efec5 Clear unknown keys from environment variable maps on save
Also fix the previous code for clearing unknown keys to use
a JSON pointer so that it functions correctly when the JSON path
is more than one level deep.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18734
2024-11-02 14:53:39 -04:00
Jon Evans
826794469d Make sure to set modified bit when releasing nested settings 2024-10-31 17:39:10 -04:00
Jon Evans
eb6d85bacf Use a persistent flag to track JSON modifications 2024-10-31 17:39:03 -04:00
John Beard
a56da89bb8 JSON_SETTINGS constness
The Load and MatchesFile methods never change the aSettings parameter.

They also immediately dereference the pointer unchecked, so make it a
ref so that the client code (single call site) becomes formally
responsible for never passing a nullptr.
2024-10-10 12:33:52 +08:00
JamesJCode
658eb1d338 Assert if NESTED_SETTINGS migration is missing for an intermediate version
- Fixes early load during NESTED_SETTINGS construction within
  SCHEMATIC_SETTINGS, now failing due to missing migrations at that
  object construction point
- Adds missing (NOOP) migration for NET_SETTINGS schema versions 1 -> 2
2024-05-05 19:12:01 +01:00
JamesJCode
39d9aba576 Don't stop migrating JSON_SETTINGS if intermediate migrator missing 2024-05-05 14:22:53 +01:00
Jon Evans
a3b6ab48a4 Add a new plugin system for the new API 2024-04-02 19:51:16 -04:00
Marek Roszko
e32b26ebeb Move JSON_SETTINGS and PARAMS to kicommon 2024-03-20 23:29:42 -04:00
Mark Roszko
72d83cd5de Revert "Move JSON_SETTINGS and PARAMS to kicommon"
This reverts commit 81855aaaa6bd2fd1bb2d812f9e64664fc1e7c18e
2024-03-18 00:08:46 +00:00
Marek Roszko
81855aaaa6 Move JSON_SETTINGS and PARAMS to kicommon 2024-03-17 18:11:49 -04:00
Jeff Young
5d4b4f39ec Allow PARAM_WXSTRING_MAP to behave as an array.
In particular, overwrite file contents with current
contents of map rather than merging.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16801
2024-01-31 14:58:48 +00:00
Jeff Young
445ed380b8 Formatting. 2024-01-31 14:58:48 +00:00
Wayne Stambaugh
922aee1532 Coding policy fixes. 2023-12-20 07:17:23 -05:00
Jeff Young
68cbb820a7 performance efficiencies 2023-12-18 17:20:34 +00:00
Jeff Young
11805d6696 performance efficiencies 2023-12-18 17:01:55 +00:00
Jon Evans
ab4d9bcb14 Fix sloppy path handling in migration for old color settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15964
2023-10-31 23:38:44 -04:00
Mike Williams
b1a388ca69 Grids: Support X and Y for all grids, add optional names 2023-08-30 11:22:19 -04:00
Jon Evans
5cbe3c5d42 PNS: Fix a few issues with debug logging
Hide non-copper layers for clarity

Fix saving of router settings
2023-08-06 15:30:58 -04:00
Wayne Stambaugh
24b04795fd Add net navigator panel to schematic editor.
[ADDED]: A panel to the schematic editor  that allows quick access to all
         of the items connected to the currently highlighted net.

This is an initial swag at implementing a full net navigator feature.  For
now it only shows the currently highlighted net nodes.  The incremental
net list advanced setting must be enabled in order to use this feature due
to performance reasons.  There are still some issues with saving the panel
position which will be addressed in the future.

Initial code for serializing wxAuiPaneInfo settings to and from JSON have
be implemented.
2023-05-20 13:48:03 -04:00
Mike Williams
c5cc313da9 Symbol Fields Table: BOM presets saved in JSON settings 2023-04-03 09:07:52 -04:00
Jon Evans
f076f6fb46 Preserve unknown keys in JSON_SETTINGS
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13847
2023-02-22 19:00:47 -05:00
Jon Evans
d9d3ccd6eb DbLib: Allow inheriting field properties from source symbol
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12856
2022-11-09 21:24:31 -05:00
Jon Evans
3a15fa5e0f Don't remove a read-only settings file
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12844
2022-11-08 23:27:26 -05:00
Jon Evans
995a153f27 Update nlohmann::json to 3.11.2
Also update json_schema_validator to match new deprecations
2022-11-05 10:53:57 -04:00
Tomasz Wlostowski
f25d449d5f JSON_SETTINGS: added direct serialization to a string (FormatAsString) and parsing
from explicitly provided file (bypassing the migration and settings framework). Used for
router regression tests.
2022-10-31 11:17:31 +01:00
Seth Hillbrand
f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
Jeff Young
a9536b5de9 CHANGED netclass assignments now done via canvas or via patterns. 2022-08-14 22:56:29 +01:00
Seth Hillbrand
168ad58eef Convert strings to wide when using wxString routines
WxString does not allocate space for wide strings needed during
conversion unless the string is explicitly wide.  This can cause buffer
over/underflow

Fixes https://gitlab.com/kicad/code/kicad/issues/10605

(cherry picked from commit 7601a3385fb326ad795a3a42a2344517f7dfcbd3)
2022-02-03 13:08:33 -08:00
Seth Hillbrand
3c29e68992 Use wxFFileInputStream to avoid dangling pointer
Cases where fp was left open could lead to dangling files until KiCad is
closed.  Stack-based file stream automatically closes after parsing and
on exception

Fixes https://gitlab.com/kicad/code/kicad/issues/9336
2021-10-08 13:42:04 -07:00
Jeff Young
7d501e8a43 Add PARAM_OBSOLETE to clean out old JSON structures.
While not technically necessary, the old structures can be confusing
to users looking at the files.

Fixes https://gitlab.com/kicad/code/kicad/issues/8856
2021-08-02 12:53:57 +01:00
Jon Evans
28909c1a72 Maybe fix arch build 2021-06-05 22:10:23 -04:00
Jon Evans
c9a660a80c Rework JSON integration to speed up build 2021-06-05 17:08:38 -04:00
Marek Roszko
cf2bb5692a Remove the wxLog calls from math/util.h for now
This was leaking windows headers and partial wx headers to 1084 compilation units......
This also means math/util.h is leaking to 1084 compilation units which seems a bit high too.
2021-06-01 18:44:22 -04:00
Jon Evans
f1039dfb94 Disable project saving outside explicit save actions
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7589
2021-02-21 21:31:45 -05:00
Jon Evans
6fa0ac45af Re-enable custom grid settings for Pcbnew
Add a reset button that will only show up if the user
edits the JSON configuration for grids. This is a temporary
measure until we have a real grid editor GUI in V7.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7595
2021-02-21 15:33:13 -05:00
Wayne Stambaugh
5ecef204cd Coding policy fixes.
Using "this->" violates coding policy section 2.7.
2021-02-09 11:35:43 -05:00
Jon Evans
3ac5fd6342 Get rid of wx popups when opening a read-only project 2021-02-03 19:17:32 -05:00
Marek Roszko
3ae87ba613 Use wxFFileOutputStream in place of previous wxFFile switch
wxFFile with fwrite still has a chance of partial writes.
wxFFileOutputStream provides WriteAll which will iterate until all bytes written or error.
2020-12-12 10:46:30 -05:00
Marek Roszko
b4e4e1cf5e Use wxFFile instead of wxFile for saving json settings/json_settings.cpp
wxFile is dangerous, it's ::Write method is a direct map to the write syscall. It does not handle partial writes!
This must be handled in our code which we don't.
2020-12-12 10:00:49 -05:00
Marek Roszko
1d559108c8 Move LOCALE_IO out of common.h 2020-10-23 21:49:42 -04:00
Jon Evans
7fcef7268b Handle read-only settings files better
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5688
2020-10-22 20:31:04 -04:00
Jon Evans
728c207105 Deduplicate settings migration handling 2020-10-05 23:21:57 -04:00
Jon Evans
45d7f2b6f5 Expose via holes to color theme properly 2020-10-02 21:12:59 -04:00
Ian McInerney
9e6a1225db Catch exception when creating app settings objects
These settings objects could be created in a constructor/destructor
so we should catch the exception since those are noexcept.

Also change the settings trace to match the other kicad traces
as KICAD_SETTINGS
2020-09-21 12:07:51 +01:00
Ian McInerney
e0c2531f53 Catch exception inside JSON_SETTINGS constructor
This exception will probably never be thrown in real life,
but the constructors are normally noexcept, so throwing
any exception from the json library causes Coverity to
have a fit.
2020-09-20 23:50:09 +01:00