Commit Graph

280 Commits

Author SHA1 Message Date
Ian McInerney 783480d2a6 Always force toolbars to be visible when restoring settings
There seem to be some cases where the AUI perspectives are getting saved
with false visibility. This means they aren't getting shown when
settings are restored. We don't support hiding toolbars, so just always
force them to be shown because otherwise there is no other way to get
them back.
2026-03-08 23:22:32 +00:00
Seth Hillbrand fbe31e5d36 Consolidate wxEVT_UPDATE_UI handlers to a single dispatcher
SearchDynamicEventTable does a linear scan through all dynamic
Bind entries for every dispatched event, regardless of event type.

Replace the per-action Bind() calls with a single wxID_ANY handler
that dispatches to the existing m_uiUpdateMap through a hash map.
This reduces the per-event scan from around 150 to about 1 for all
event types.  This is particularly noticeable during high frequency
events like mouse drag.
2026-02-27 15:21:23 -08:00
Christoph Moench-Tegeder 129995acbd Handle libspnav login on FreeBSD just like on Linux
FreeBSD uses libspnav, just like a Linux does, so all the
conditional code addressing the spnav APIs should be used
on FreeBSD, too.
Unfortunately, the logic was not consistent in all places:
sometimes we had "#ifdef", sometimes "#if defined" and
sometimes it was negated as "#ifndef". To make the intention
clearer across both Linux and FreeBSD, I unified all places
to a "#if defined(__linux__) || defined(__FreeBSD__)".
If we get another OS latching onto the same logic, we should
introduce a simple flag for this, but for only two OSes I
decided against adding central logic for this.
2026-02-16 22:56:27 +00:00
Ian McInerney ca8f1e245f Always set toolbars to visible when loading string perspective
Even in wx 3.3, we load string AUI perspectives on settings migration
(e.g., from a wx 3.2 version to wx 3.3, like the 9->10 transition). In
that case, we also need to ensure the toolbars are shown.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23075
2026-02-15 16:57:39 +00:00
Seth Hillbrand c52ab91c84 Reduce compile times by extracting headers
Break the most expensive header include chains that contaminate the
largest number of translation units

New lightweight headers for extractdded types:
font_metrics.h, mouse_drag_action.h, board_project_settings_params.h,
common_settings_internals.h, wx_infobar_message_type.h,
zone_layer_properties_grid.h
2026-02-13 17:10:45 -08:00
Seth Hillbrand cb31a1ade7 Fix crash when exiting KiCad with editor frames open
Guard against re-entrant wxEVT_CLOSE_WINDOW events in windowClosing().
GTK can deliver a second close event while the first is still being
processed (e.g. during Destroy() calls in doCloseWindow), leading to
use-after-free crashes when the tool manager has already been deleted.

Also add defensive null checks for GetToolManager() and GetTool() in
all SaveSettings/SaveProjectLocalSettings paths that access the
selection tool filter, since these are called during frame teardown.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22926
2026-02-13 11:00:56 -08:00
Mark Roszko 4e58ca76a4 Hide the spacemouse panel for non-linux
Space mouse is configured in the  3dconnexion app on Windows/macos
2026-02-04 19:07:19 -05:00
Mark Roszko dcc67e0d1f KIWAY_PLAYER and EDA_BASE_FRAME dont need to take turns parents to language change 2026-02-02 20:32:53 -05:00
Alex Shvartzkop 1e4b30db63 Disable GTKDoGetSize hack on wx 3.2.9+ 2026-02-02 13:17:18 +03:00
Seth Hillbrand 381559def0 Add separate User Layer Names preferences panel
This creates a new panel under Footprint Editor preferences that
contains the user layer count dropdown and the named layers grid.

The user layer count setting now controls how many unnamed user layers
appear in the footprint editor. Setting it to zero hides all unnamed
user layers unless they are used by the loaded footprint or have been
given a custom name.
2026-01-26 17:15:14 -08:00
Mark Roszko 314735e2fc Move message dialogs to KICAD_MESSAGE_DIALOG define
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22830
2026-01-25 12:42:13 -05:00
Seth Hillbrand e59dd963a8 Add work around for wx3.2 perspective
wx3.2 hides all panes and then only shows the ones that it finds in the
restore string.  This is problematic for us because it will hide things
we don't want hidden.

Iterate through the pane array and reset everything to visible so that
we can position them

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22781
2026-01-14 09:36:47 -08:00
Alex Shvartzkop 9a4694644d Show overflow button in toolbars when items don't fit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8935
2026-01-08 05:16:47 +05:00
Sven Pauli 75887af324 Ask to remove non existing file from history. 2026-01-07 10:49:52 +00:00
Alex Shvartzkop e0b0954709 Allow labels in toolbars. 2026-01-07 15:34:12 +05:00
jean-pierre charras d012e85244 eda_base_frame.cpp: fix compil issue on MINGW/msys2
The previous code used a private var. Replaced by a equivalent code using
public methods in a for() loop.
I don't know why MSVC accepted the previous code.
2026-01-07 09:52:31 +01:00
Alex Shvartzkop 320727dd82 Fix crash when AUI manager has no managed window yet. 2026-01-07 09:23:27 +05:00
Alex Shvartzkop c7868deb5e Improve DPI change handling on MSW. 2026-01-07 08:11:19 +05:00
Jeff Young 9cf72d50a2 Move customisable toolbars out from under advanced cfg. 2025-12-29 20:30:35 +00:00
Seth Hillbrand 2d538d3d69 ADDED: Remote symbol placement
Allows activating a display panel that shows a webpage designed to
provide instances of symbols, footprints, 3d models and spice models to
the designer.

The webpage can be installed via PCM or directly in the panel.  Webpages
should be registered with the KiCad project in order to avoid a warning
when showing content.
2025-11-29 17:58:32 -08:00
Seth Hillbrand 9e6ffe642a Properly clear savers when changing projects
Hook into the ProjectChanged() routine to handle all switches.  The main
routine clears the savers before re-registering new savers for the
schematic, pcb and project

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22220

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22221
2025-11-04 16:50:01 -08:00
Jeff Young 4183b27c4c Rerun queries when re-loading query text from saved dialog state.
Also fixes some layout issues in the Hotkeys List,
and removes some dead code.
2025-11-04 12:45:44 +00:00
Seth Hillbrand a3acf25262 Rework local history for safer backup
- Prompt before removing any files
- Check directory for additional files
2025-10-27 18:11:17 -07:00
Seth Hillbrand 883925bfe0 Allow local history auto update
Fix a crash with the tip menu
2025-10-24 17:55:26 -07:00
Seth Hillbrand 3a3205071b Add: local history protections
Uses lockfile to prevent overlapping commits
Ensure restore happens recursively
Remove files added after restore point
Prevent duplicate savers from overrunning each other
2025-10-23 15:48:35 -07:00
Seth Hillbrand 8257870ac3 ADDED: Local History
Local history combines project backup and autosave into a single place
where arbitrary history can be stored efficiently and restored to any
point in time.  Git commits are made on a debouce timer to hold
modifications, allowing the user to step backwards in time to arbitrary
points.  Restoring backups does not remove the existing files and
choosing to restore an autosave point does not remove the state of the
files prior to the restore, providing additional safety.

Keeps the maximum storage size limit but removes the additional
limitations of number of backups/backups per day, etc as these are not
relevant to a CoW-based backup as unchanged files do not take up
additional space.
2025-10-23 15:36:07 -07:00
jean-pierre charras ee27b2f002 Do not use LoadPerspective() on wx version before 3.3 (Perspective() is broken)
Symbol editor: add more control about toolbars visibility
2025-10-17 10:59:25 +02:00
jean-pierre charras edf5324a6d Add EnableUseAuiPerspective advanced option to allow use of aui LoadPerspective()
LoadPerspective allows a easy way to store/load frame geometry.
Unfortunately it easy create broken geometry frame (missing or misplaced toolbars
for instance) when the number or the type of items has changed between last saved
geometry and the geometry frame in use when loading old Perspective. And the only
one way to fix a broken geometry is to delete the config json files.

So the saved Perspective is loaded only if EnableUseAuiPerspective advanced option
is set to 1, mainly for developers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21828
2025-10-12 14:43:44 +02:00
Jeff Young dfd17b5843 Fix typo. 2025-09-29 20:23:38 +01:00
Seth Hillbrand 61ab7cc915 ADDED: AUI Memory
Using the new wx3.3 routines to serialize the state of our AUI elements,
we store them using JSON in the preferences for each window

I have left the SavePerspective in place for now to see how legacy
(mostly *nix) builds handle this and provide a smooth transition to 3.3

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2381
2025-09-24 18:43:47 -07:00
Jeff Young de1491256f ADDED: DRC item context menu "fix" actions.
Active for the following errors:
DRCE_LIB_FOOTPRINT_ISSUES
DRCE_LIB_FOOTPRINT_MISMATCH
DRCE_FOOTPRINT_FILTERS
DRCE_SCHEMATIC_PARITY
DRCE_MISSING_FOOTPRINT
DRCE_DUPLICATE_FOOTPRINT
DRCE_EXTRA_FOOTPRINT
DRCE_FOOTPRINT_TYPE_MISMATCH
DRCE_FOOTPRINT
DRCE_PADSTACK
DRCE_PADSTACK_INVALID
DRCE_TEXT_HEIGHT
DRCE_TEXT_THICKNESS
DRCE_MIRRORED_TEXT_ON_FRONT_LAYER
DRCE_NONMIRRORED_TEXT_ON_BACK_LAYER
DRCE_DANGLING_TRACK
DRCE_DANGLING_VIA

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21646
2025-09-24 11:36:48 +01:00
Alex Shvartzkop 89af3c34b9 Support vector graphics drag-and-drop in PCB and schematic editors.
This just shows the import dialogs with filename pre-populated.
2025-09-17 00:44:29 +03:00
Seth Hillbrand 9f2b04c7e2 Prevent autosave error from cluttering the screen
Once per session, per editor we can show the error.  After that, assume
that the designer has seen and knows about the issue.

Fixes https://gitlab.com/kicad/code/kicad/issues/21464
2025-08-16 13:49:32 -07:00
Jeff Young d5f16adde1 ADDED: maintenance page to preferences. 2025-08-15 16:57:46 +01:00
Seth Hillbrand 87ccb2abc0 Move Annotation preferences (most) to schematic setup
The scope, recursion, reset options and message filters remain in the
user preferences.  Others including numbering, sort order and reuse are
schematic preferences.

Also, the oddball subunit display remains here but it doesn't really
belong in annotation.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17942
2025-08-12 16:15:17 -07:00
Seth Hillbrand 0a5de5010f ADDED: Spacemouse support for Linux
Uses libspnav to handle spacemouse data.  Overlays on existing
spacemouse framework to handle view activation

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16133
2025-08-12 07:04:54 -07:00
Jeff Young 8827323361 Remove Help menu hacks which appear to no longer be necessary.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10124
2025-04-14 11:52:07 +01:00
Seth Hillbrand f83e607e6e Enable/disable git tracking in user prefs
Don't require advanced config for people who want to disable
2025-03-24 11:52:50 -07:00
Jeff Young f951497a4f Code brevity. 2025-03-01 21:58:31 +00:00
Ian McInerney e202b00a74 Rework the toolbar settings storage and panel
This format is more extendable in the future, should separator and
spacer support be added to groups.

Also, this now has a working UI for modifying the toolbars.
2025-02-28 02:05:50 +00:00
Ian McInerney 85810510f4 Tweak toolbar settings a bit
* Manage the settings using the settings manager for better lifetimes
* Better architect the internals and JSON to make it easier to identify
  the various tool types
2025-02-28 01:57:37 +00:00
Ian McInerney ab114c4159 Put preferences panes for toolbars, but hide behind an advanced config
There is still more work to do to make this feature actually
user-friendly and make it so people can't break their UI config too
easily.
2025-02-28 01:57:37 +00:00
Ian McInerney e53c155b8c Initial dialog work 2025-02-28 01:57:37 +00:00
Ian McInerney 548334b4e2 Load toolbar configuration from settings 2025-02-28 01:57:37 +00:00
Ian McInerney caa03ab59e Add setting for custom toolbar and read custom toolbar config 2025-02-28 01:57:37 +00:00
Ian McInerney 7ad1103f55 Move toolbars to a serializable storage format 2025-02-28 01:57:37 +00:00
Jeff Young f510cce2da Apply List Hotkeys fix to Edit Hotkeys.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19989
2025-02-26 19:17:53 +00:00
Jeff Young 8874f137fa Read hotkeys from disk after they change.
(Otherwise we'll write the old versions back out
when closing one app.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19612
2025-02-01 20:01:13 +00:00
Wayne Stambaugh 5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05: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