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.
This will always show 1 unit from each system, with the primary unit
being the current frame unit and the secondary unit being the
most recent unit used from the other system. These are saved in
the settings, so they are saved between runs.
Using CopyFile() that can collide with a windows header create hard to
understand errors, including link errors.
Renaming this function avoids these strange errors.
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
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.
You can now enable and disable snap to grid when drawing/editing across
all apps. You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
Better fix than a0df876d
For new users, if this folder does not exist, saving colors does not work,
because if this folder does not exist, it is not created.
For now, much of KiCad depends on Prj() working, so when we
are asked to unload a project, immediately load the null project
so that nothing breaks.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5374
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
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
Store list of previously open projects only in kicad.json
Keep all management of open projects in SETTINGS_MANAGER
Also add kicadSettings() for convenience
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.
- 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
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.
- 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
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
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
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.
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
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
Migrate COLOR_SETTINGS 0->1 to remove fpedit section
Migrate FOOTPRINT_EDITOR_SETTINGS 0->1 to use new theme if created
Remove COLOR_CONTEXT that is no longer needed
Let cmake generate the needed version strings, so we don't
have to spend program time doing it. This simplifies the
settings manager versioning.
Also, convert some file line endings to UNIX from Windows.
A more robust fix for https://gitlab.com/kicad/code/kicad/-/issues/4015.
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.