Commit Graph

4828 Commits

Author SHA1 Message Date
Jon Evans eac2700af6 Launcher: use unscaled bitmaps
This is not really a toolbar so we should not scale here
2021-04-19 17:18:17 -04:00
jean-pierre charras ff3cf790c9 Commit missing change 2021-04-19 21:31:57 +02:00
jean-pierre charras 1bfa3dc6a5 Fix an annoying issue (wxMSW specific) about X_VIEW_CONTROLS::CaptureCursor()
On MSW, CaptureMouse() was sometimes called event if the GAL panel has
captured the mouse (that was not accepted by wxMSW), although HasCapture()
returns false.
(Perhaps some race condition between events)
The fix add a flag to avoid calling twice CaptureMouse() after only one
wxEVT_MOUSE_CAPTURE_LOST event was received.
Fixes #8239
https://gitlab.com/kicad/code/kicad/issues/8239
2021-04-19 21:23:07 +02:00
Ian McInerney ae91042544 Implement thread safety for symbol loading routines
These functions can be called from any thread of the library
loader, so we need to ensure we have some thread safety with them.
2021-04-18 18:39:46 +01:00
Ian McInerney 7f00b97586 Name Coroutine's in TSAN to make them identifiable 2021-04-18 18:20:09 +01:00
Jeff Young 13473420e5 Remove duplicated routine and fix bug in UTIL version. 2021-04-17 15:10:59 +01:00
Wayne Stambaugh 2ae264751f Rename class_board_stackup.{h|cpp} to board_stackup.{h|cpp}. 2021-04-16 17:07:06 -04:00
Ian McInerney 43425d7306 Add logging of the functions used in the coroutine implemntation 2021-04-16 17:49:52 +01:00
Ian McInerney 660d1596e2 Annotate the coroutines with TSAN fiber information 2021-04-16 17:49:52 +01:00
Jeff Young 3a6a919097 Improve clarity in the Print dialog around edge cuts layer.
Fixes https://gitlab.com/kicad/code/kicad/issues/8200
2021-04-16 16:53:51 +01:00
Jon Evans 433e148e08 Move some string formatting functions out of base_units
Keeping them in base_units means that we can't introduce
any dependence on these functions to anything that needs to
compile without one of the unit defines (EESCHEMA, PCBNEW, etc)
2021-04-14 23:21:10 -04:00
Johannes Maibaum 39c1387b5b Allow to relocate EDA libraries out of KICAD_DATA
Introduce a new advanced config variable `KICAD_LIBRARY_DATA` which can
be used to move templates, symbols, footprints, and 3dmodels out of
`KICAD_DATA`. If not defined, everything is kept as before.

To facilitate this, PATHS::GetStockEDALibraryPath() is added. This
allows to differentiate code paths looking for EDA library data vs. code
paths looking for plugins, demos, and the like.

Thanks to Aimylios for the hints and suggestions with regards to the
stock EDA library data path handling on Windows and MacOS.
2021-04-14 01:51:22 +00:00
Jeff Young f7cc6d1e1e Fix save as and save copy as for project files. 2021-04-13 17:56:50 +01:00
Jon Evans 7784d7cb12 PNS: Fix visible area restriction
VIEW::GetBoundary() returns the entire view area, not the visible area.
Surprisingly, we had no API for this, so I added one.

Also, changed the dragger behavior to toggle between optimizing just the
modified area and optimizing the visible area, i.e. we will now never
optimize off-screen portions of the dragged track.
2021-04-10 16:13:08 -04:00
Jon Evans 7dd6a182f2 Unhide the Altium schematic importer
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8069
2021-04-08 22:22:03 -04:00
Jon Evans 619a353c5e Decouple 3D view dirty marking and refresh
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8154
2021-04-08 22:09:19 -04:00
Seth Hillbrand da6f9c399f Add in-app donate link 2021-04-08 16:58:45 -07:00
Jon Evans e0f26fd525 Make live 3D refresh optional
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8068
2021-04-07 22:39:30 -04:00
Ian McInerney 29cc16a4c4 Push pcbnew layer alpha change update into base frame
This code was shared between the footprint frame and
pcb edit frame, so push it into the base edit frame.
Also remove the dummy wxUpdateUIEvents that weren't
actually being used.
2021-04-07 17:39:48 +01:00
Jeff Young 09b2db3139 Test for group in footprint was snagging all footprint children.
Fixes https://gitlab.com/kicad/code/kicad/issues/8121
2021-04-06 18:27:43 +01:00
Roberto Fernandez Bautista 235688e459 Less restrictive Arc Track Dragging tool
Use the connecting straight tracks even if not exactly parallel - allow
an error margin configurable in ADVANCED_CFG (default 1 degree). Also
be less strict about end point matching and use the width of the track
as the criteria to determine suitability.

Finally, delete any short lengths of track at the end of the operation
and amend the arc end points to keep connectivity.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7967
2021-04-06 12:52:01 +00:00
Jon Evans 5d3465c54c Update tuning settings legend images
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8128
2021-04-05 21:18:24 -04:00
Ian McInerney e08387ce3d Make the GAL responsible for the native cursor management
The native cursor must be set on the GAL canvas wx object,
not its frame (otherwise on GTK the cursor is only set
when we get a request for it from the WM and not immediately).

Fixes https://gitlab.com/kicad/code/kicad/issues/6421
2021-04-05 02:36:12 +01:00
Marcus A. Romer 1632707d9b Replace tabs with spaces 2021-04-05 01:13:39 +00:00
Jeff Young 52aea0a2c9 Consistent terminology. 2021-04-03 11:15:11 +01:00
Jon Evans c1573744be Lock project files when opening; open locked projects read-only
Also clean up an include-what-you-use problem

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8037
2021-04-02 19:29:56 -04:00
Jeff Young 94470bfa15 Minor cleanup. 2021-04-01 11:10:01 +01:00
Jeff Young 0c4184f1a4 Split lib tree initialization into a two-pass affair.
This is under the supposition that we can't set the column widths
on some Mac instances because the host controls haven't yet been
created.  This is primarily conjecture based on looking at things
that have the *possibility* of going wrong.  Why this only happens
in some installs is beyond me.

Fixes https://gitlab.com/kicad/code/kicad/issues/5479
2021-04-01 10:51:29 +01:00
Jeff Young 2ad69fc56b Move importers from wxLog to REPORTER.
Fixes https://gitlab.com/kicad/code/kicad/issues/6389
2021-03-31 22:54:30 +01:00
Ian McInerney ff371af810 Remove unused field in TOOL_DISPATCHER
All use of this was removed in 0a0935e0f3
but the field wasn't removed.
2021-03-31 13:30:42 +01:00
Ian McInerney 0a0935e0f3 Remove ACTIONS::TranslateLegacyId and TOOL_DISPATCHER::DispatchWxCommand
After commit 9535153f9e there were no more IDs inside the legacy ID
system. Therefore the entire system for dispatching and looking up
the legacy ideas and handling those events can now be removed and
the tool dispatcher simplified (it no longer needs to know about
the ACTIONS class).
2021-03-30 23:20:22 +00:00
jean-pierre charras 6eb2e2a6e3 Fp editor: do not change item UUIDs when loading a footprint from library.
Fixes #8066
https://gitlab.com/kicad/code/kicad/issues/8066
2021-03-30 12:58:22 +02:00
Wayne Stambaugh 6d2f80b4cf Pcbnew: add write board netlist to file support.
This is hidden behind an advanced configuration setting and is primarily
useful for developers trying to troubleshoot the netlist payload sent
from the board editor to the schematic editor.

Fixes https://gitlab.com/kicad/code/kicad/issues/8051
2021-03-28 08:38:29 -04:00
Ian McInerney 475ac3697f Ensure toolbar controls have the correct width on frame creation
Otherwise they could be slightly too small and then look odd.
2021-03-28 13:07:56 +01:00
Ian McInerney 7bfa8575fa Remove redundant information from import/export menu item labels
Saying "Import/Export" on the labels when the submenu has "Import"
or "Export" in it is redundant.

Note that we can't just update the action text with the new name,
because that is used in the hotkey list and would become too confusing
without the "Import"/"Export" text.
2021-03-27 18:50:35 +00:00
Ian McInerney 57518fd0f9 Update the icon set + toolbars when the system color theme changes
This ensures the icons switch from dark<->light when set
to the automatic theme.
2021-03-26 15:50:56 +00:00
Ian McInerney 3146d03aaa Properly ellipsize layer names in the GerbView layer manager
Before, the layers were always ellipsized if the name was >30
characters, even if the widget was wide enough to display
the full name. Now they are ellipsized when needed (e.g. if
the widget is shrunk small enough).

Fixes https://gitlab.com/kicad/code/kicad/issues/1919
2021-03-26 15:50:56 +00:00
Ian McInerney f6041fb52d Force update of some text when activation status changes
The text areas aren't always redrawn when the window is activated
or deactivated, so we need to force a refresh of the text to ensure
it is the correct font color.
2021-03-26 15:50:56 +00:00
Ian McInerney 804c09b8f2 Use wx to draw the arrow on the collapsable pane
This allows for color changes and scaling of the arrow
when the display needs it (e.g. HiDPI displays).

Also make the arrow and text respond to if the window is
active to mimic native controls.

Fixes https://gitlab.com/kicad/code/kicad/issues/6042
2021-03-26 15:50:56 +00:00
qu1ck 75819206a0 Add support for dark theme in plugin icons
Action plugin authors can specify alternative icon path for dark theme.
If it's not specified then standard icon will be used for both light and
dark themes. If neither icon is specified then the default puzzle piece
icon is used.

Fixes #7984
2021-03-24 21:59:30 +00:00
Jon Evans 41d97e0007 Fix thread cleanup issue on Windows/msys2 2021-03-23 13:39:20 -04:00
Jon Evans 4dbeb15024 Use a worker thread to send socket commands
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6503
2021-03-23 03:20:40 +00:00
Wayne Stambaugh d96cccbf20 OpenGL GAL tracing improvements. 2021-03-22 17:45:49 -04:00
Jon Evans e0fdfbe1d5 createThemeList takes a filename, not a name
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7075
2021-03-21 21:03:01 -04:00
Jon Evans cc8413c841 Tweak default zoom settings for Windows
Acceleration seems to be worse than constant on many
systems, so let's turn it off by default.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5434
2021-03-21 19:46:23 -04:00
Marcus A. Romer e9eb5a5e21 Refactor definition of stock data path
It is not always useful to distinguish between the cases when KiCad is
run from the build or the installation directory. E.g., the libraries
are generally not available in the same path as the code. Make the
evaluation of KICAD_RUN_FROM_BUILD_DIR conditional to accomodate these
scenarios.
2021-03-21 00:28:33 +00:00
Jon Evans 6924b98bc3 Remove deprecated BRIGHT_BOX preview item 2021-03-20 12:09:20 -04:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Jon Evans 4fbbdc31ba Squash clang warnings about hashtables.h 2021-03-19 20:57:19 -04:00
Jeff Young f0e6f812ff Edit One Field improvements.
1) Accept <enter> as OK if the multiline textbox isn't shown.
2) Focus and select all in first control if multiline textbox isn't shown.
3) Make title be title caps ("Edit Sheet name Field" looked dorky).

Fixes https://gitlab.com/kicad/code/kicad/issues/7940
2021-03-20 00:41:09 +00:00
Jeff Young 812d38736e Naming conventions. 2021-03-19 23:06:19 +00:00
Jon Evans 7231f1dc68 Fix caching strategy
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7960
2021-03-19 12:13:00 -04:00
Jon Evans 472d0e03fc Remove unused color layer 2021-03-18 22:30:24 -04:00
Wayne Stambaugh acec6ad7fc Spice simulator: add Ngspce model behavior mode settings.
ADDED: Ngspice simulator model behavior mode settings for PSpice, LTSpice,
       PSpice and LTSpice, and HSpice.

Fixes https://gitlab.com/kicad/code/kicad/issues/5810
2021-03-18 15:31:02 -04:00
Jon Evans 5e6b02f2d3 Cache APP_SETTINGS lookups
These are essentially singletons
2021-03-16 20:46:58 -04:00
Jon Evans 045160d486 Work around wxProgressDialog layout bug
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4288
2021-03-16 20:44:24 -04:00
Jon Evans 6d502cb2a5 Don't generate real random UUIDs while loading libraries
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7921
2021-03-17 00:43:13 +00:00
Jeff Young 46d71f0d23 Go back to validate-on-OK, but stop doing design checks.
If we keep doing design validations at two different places, they can
only start to drift apart.  Board Setup should validate for malformed
data ONLY; everything else is the business of DRC.

This also fixes a bug where implementation validations would not allow
OK in the dialog, but wouldn't put up a message to say why.  We now use
the InfoBar impl from Jon's commit for that.
2021-03-16 14:49:03 +00:00
Jeff Young cad1cb0262 Improve naming. 2021-03-16 12:07:06 +00:00
Jeff Young b2ac9cc29f Formatting & naming conventions. 2021-03-15 19:04:59 +00:00
Jon Evans 2cbd7b5043 Reduce scope of some view repaints to improve performance 2021-03-14 11:42:09 -04:00
Fabien Corona f428ce03f2 ADDED: pcbnew - stackup / characteristics table 2021-03-13 20:19:46 +00:00
Jon Evans 77d7eae7c3 Fix availability of "other"-sized bitmaps; update some comments 2021-03-11 17:16:49 -05:00
Jon Evans e570b9b548 Update dark mode icons 2021-03-11 08:39:24 -05:00
Jon Evans 44f88f840c Bitmaps: a few improvements from review 2021-03-11 08:37:35 -05:00
Jon Evans 405fa183b2 Add icon theme selection behind advanced config flag 2021-03-11 08:37:35 -05:00
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00
Dominik Wernberger e2aa7be4b3 Added a lot of consts and refactored a few lines 2021-03-08 12:49:48 -08:00
Jon Evans 720147d272 Remove transitive inclusion of bitmaps.h 2021-03-07 16:08:57 -05:00
Seth Hillbrand 0d3a0e0dff Move Serbian po
Updates the Serbian language code from sr_RS to sr.  This appears to
work as intended under Debian whereas the full code, despite existing in
the i18n directory was not recognized by wxWidgets or Weblate.
2021-03-05 09:19:58 -08:00
Jeff Young 3e9eb3c8ac More complete fix for crasher JP found.
Fixes https://gitlab.com/kicad/code/kicad/issues/7806
2021-03-05 15:30:52 +00:00
Jon Evans 68f958145d Gracefully handle lack of diff pair settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7806
2021-03-05 09:09:56 -05:00
Ian McInerney 908de37e7c Don't hardcode the file extensions where possible 2021-03-03 01:13:59 +00:00
Jon Evans 924accfdc8 Consolidate wxAui art providers 2021-03-01 23:10:03 -05:00
Jon Evans 93578517e4 Support dark mode in AuiBar buttons for wx 3.0 2021-03-01 21:24:29 -05:00
Jeff Young 6e7d7af3c9 Add Reset buttons for mouse and trackpad defaults.
ADDED: Preferences > Mouse and Trackpad > Reset to Mouse Defaults and
Reset to Trackpad Defaults.

Fixes https://gitlab.com/kicad/code/kicad/issues/7681
2021-03-01 14:14:00 +00:00
Jeff Young 8a33542bcd SCH_COMPONENT::GetField() expects a vector index, not a field id.
Check this at compile time.  Callers wanting to use an index now must
use SCH_COMPONENT::GetFields()[i] instead.

Fixes https://gitlab.com/kicad/code/kicad/issues/7757
2021-02-28 15:10:37 +00:00
Marek Roszko c3c777d07f Remove another abandoned function 2021-02-26 19:36:55 -05:00
Marek Roszko b02d28c676 Remove another abandoned prototype 2021-02-26 19:33:35 -05:00
Marek Roszko 23beaff2ff Remove unused prototype 2021-02-26 19:30:58 -05:00
Jeff Young 86aaa2e9cb Rationalize footprint bounding boxes and cache all of them.
Fixes https://gitlab.com/kicad/code/kicad/issues/7720
2021-02-26 13:50:27 +00:00
Seth Hillbrand 0dca0e752b Reduce the number of built-up calls to DisplayFootprint
When updating the libtree, we modify the tree multiple times to avoid
crashes on Linux.  These generated events that buffered while the widget
was frozen and resulted in redrawing the same footprint 4-10x.

This reduces the buffering by discarding events that are generated
during the freeze and only redrawing when there is a new footprint to
draw
2021-02-25 12:13:42 -08:00
Tomasz Wlostowski 87ea540953 Fix whitespace errors 2021-02-25 17:18:23 +01:00
Tomasz Wlostowski a9c54c10a2 VIEW_OVERLAY: support for bitmap text 2021-02-25 17:18:23 +01:00
Jeff Young fcf6511f0c Implement Delete in grid tricks.
Fixes https://gitlab.com/kicad/code/kicad/issues/7703
2021-02-25 15:37:52 +00:00
Jon Evans 92cc88f87c Tighten up schematic label bounding boxes
Margins were being added in more places than necessary

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7689
2021-02-24 17:15:35 -05:00
Seth Hillbrand 0bab025832 Fixup toolchaining for immediate mode
The move tool can stack on others, so when we re-enter the previous tool
this caused another immediate action.  We flag re-entry in the tool
stack to check for this and avoid unexpected tool starts
2021-02-24 10:44:54 -08:00
Jon Evans 8dcf5404fc Better UX for handling vertical scroll mapping
Show an error instead of preventing an invalid state
2021-02-24 00:07:17 -05:00
Jon Evans aedc65f20f Fix footprint editor default grid
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7659
2021-02-23 20:07:46 -05:00
Jeff Young efae25e24e Splitter bar for netclass setup.
Fixes https://gitlab.com/kicad/code/kicad/issues/7668
2021-02-23 15:06:41 +00:00
Jeff Young a3b9e8ddb4 Round 2 of Worksheet -> Drawing Sheet. 2021-02-23 11:57:44 +00:00
Jeff Young cad5198ab7 Worksheet -> (industry standard) Drawing Sheet. 2021-02-22 17:35:46 +00:00
Wayne Stambaugh be8327bd54 GAL memory allocation fixes.
Vertex memory allocation uses malloc and realloc without checking the
result.  Throw exceptions that can be caught in the DoRepaint() method
in EDA_DRAW_PANEL_GAL when malloc and realloc return a null pointer.
2021-02-22 08:15:09 -05:00
Jeff Young 41b8ef85e3 Fix preferences on OSX. 2021-02-22 11:05:47 +00: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
Jeff Young 2d28ed8eda Move canvas backend selection to Preferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/7630
2021-02-21 20:12:43 +00:00
Mikolaj Wielgus f9c42585fb Force immediate action for auto start wire feature
Fixes https://gitlab.com/kicad/code/kicad/issues/7503
2021-02-21 18:43:34 +00:00
Jon Evans 3bc9d7b95e Rework GAL layer enum to fix visibility import from legacy boards 2021-02-21 13:41:43 -05:00
jean-pierre charras f43c639a4d Fix issue with predefined variable texts ${COMMENT0} to ${COMMENT9}
- remove ${COMMENT0}, that was broken (returned the same as ${COMPANY}.
- So ${COMMENT1} to ${COMMENT9} are only recognized for Comment1 to Comment9
  in page settings dlg, and are equivalent to our old %C0 to %C8 format string
- fix a minor coding style issue.
Fixes #7642
https://gitlab.com/kicad/code/kicad/issues/7642
2021-02-21 18:29:14 +01:00
Seth Hillbrand 8a12aa4e3a Handle unit changes in the netlist
Each symbol unit in eeschema has a unique identifier.  But we don't have
a unique identifier for the entire symbol.  So changing which symbol
instance was unit A (our default base for matching), changed the UUID
that we were using to match the footprints.

This commit adds all UUIDs to the netlist, allowing us to match symbol
to footprint without worrying about which unit is referenced.

This still does not handle changing different units on different sheets.

Fixes https://gitlab.com/kicad/code/kicad/issues/7604
2021-02-20 20:11:49 -08:00