Commit Graph

5098 Commits

Author SHA1 Message Date
Wayne Stambaugh 89b1fdabe9 Pass COLOR4D object by reference instead of on the stack. 2021-07-26 13:28:56 -04:00
Marek Roszko 8921eef0be Add a "Open Demos Project" shortcut to the kicad launcher
Small UX improvement for the new user....
2021-07-25 21:58:57 -04:00
Mike Williams 7ba08962ba Eeschema/Common: convert mils to IU using doubles
The .kicad_pro file can contain fractional mils, and users working in
millimeters would also see weird rounding issues.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7865
2021-07-25 21:58:33 +00:00
jean-pierre charras 1aadf45947 DIALOG_SHIM: fix not working initial size when creating a dialog.
The first time a DIALOG_SHIM was created, with a given size, this size
was not taken in account. This this is now forced.
(when recreated during a session, this is the last dialog size that is used)
2021-07-24 18:59:28 +02:00
Jeff Young 3c1af1af74 Update selected tool string when language changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/8813
2021-07-23 20:16:53 +01:00
Jeff Young a16b85db67 Read/write group locked state. Show locked state in dialog & statusbar.
Fixes https://gitlab.com/kicad/code/kicad/issues/8796
2021-07-22 12:49:30 +01:00
Wayne Stambaugh 1a301d8eea Stop using wxDialog::EndModal() from inside dialogs.
Calling wxDialog::EndModal() directly from inside the dialog is a
potential bug if the dialog is shown in the modeless or window modal
(quasi-modal).  Use the internal button events where possible and
check for the appropriate mode before calling the correct end dialog
function.
2021-07-21 17:38:14 -04:00
Jeff Young 0fb864d596 Pull some name changes back from 7.0 to ease merging. 2021-07-21 20:58:59 +01:00
jean-pierre charras 56412cc843 PCB_TEXT: remove "hide" option, because they are never hidden.
- avoid write "hide" option in file
- always return true when calling IsVisible()
Fixes #8806
https://gitlab.com/kicad/code/kicad/issues/8806
2021-07-18 14:58:21 +02:00
Wayne Stambaugh bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Pradeepa Senanayake 6cde086ef9 Double click on defined colour executes OK action
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8778
2021-07-14 23:26:40 +00:00
Jon Evans ae55db77c5 Allow hiding version from manager title bar with advanced config 2021-07-14 18:24:21 -04:00
Wayne Stambaugh 01515680b3 Code cleaning. 2021-07-14 15:47:32 -04:00
luz paz 0446d35f0d Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-13 10:48:17 +00:00
jean-pierre charras fb246403d2 PROGRESS_REPORTER: avoid clipping the bottom of the dialog in some cases.
It occurred on Windows, when the message to display is too long and was
displayed using 2 lines.
Now the dialog is resize after changing the message.
Fixes #7953
https://gitlab.com/kicad/code/kicad/issues/7953
2021-07-11 17:52:54 +02:00
Marek Roszko 9162013132 Add advanced cfg to force reloading memory cached 3d models 2021-07-11 00:35:38 -04:00
Marek Roszko 7cb0f8f808 Add ADVANCED_CFG to always reload cached 3d models in memory 2021-07-11 00:31:06 -04:00
Marek Roszko 79b90813ec Add ADVANCED_CFG to skip caching 3d models to file 2021-07-11 00:00:06 -04:00
Marek Roszko 1fb42c5e43 Try and cleanup the input focus/key event a little 2021-07-05 20:48:48 -04:00
Jon Evans 4f3674bd1d Fix mangling of direct json_pointer access 2021-07-05 12:33:08 -04:00
Jon Evans 3f55093bff JSON_SETTINGS: Provide explicit CloneFrom 2021-07-05 12:26:21 -04:00
Marek Roszko d2aeddc6cb Add debouncing to the choose symbol dialog.
More potato pc friendly in theory.
2021-07-04 21:59:51 -04:00
Marek Roszko 3b33f94c56 Use a wxSearchCtrl instead of wxTextCtrl for the symbol chooser window
This just makes it prettier with the search icon and cancel
2021-07-04 21:24:03 -04:00
Mikolaj Wielgus 8b2b3ca797 Define .wbk in wildcards_and_files.{cpp,h}, cosmetic code changes 2021-07-04 14:04:03 +00:00
david-beinder f33ea6f997 Kiway: Improve performance by using IDs and clearing closed frame entries 2021-07-03 22:48:46 +00:00
david-beinder a5308e5f5c Fix python console toggle to work across pcbnew/eeschema 2021-07-03 22:48:46 +00:00
Jon Evans e95323a37e Revert "Remove unused variable."
It's only unused on Mac

This reverts commit d3fb22014f.
2021-07-03 16:48:46 -04:00
Jeff Young d3fb22014f Remove unused variable. 2021-07-03 21:16:15 +01:00
Roberto Fernandez Bautista c3051ba48a Refactor SHAPE_LINE_CHAIN to allow two shapes per point
m_shapes now has two possible indices. The first one is populated if
the point is associated with an arc and the second index is populated
if the point is shared between two arcs.
2021-07-03 19:37:50 +00:00
Marek Roszko eff75b630f Get rid of anonymous struct typedefs
We are using C++14 where there is no reason for this and is banned in C++20 under P1766R1. MSVC generates a warning under C++14 as a reminder.
2021-07-01 18:28:41 -04:00
Wayne Stambaugh 175b474c3e Coverity issue fixes.
Fixes issues #280412, #314755, #329615, #332459, #332157, #332167,
2021-06-30 18:08:49 -04:00
Jeff Young 6810912f09 Refuse to load schematics from the future.
Also fixes a bug where an empty window would get left when loading
a file from the KiCad manager window errored out.

Also fixes a bug where we were getting the wrong exception because
we were rethrowing the type-casted one (rather than just calling
throw).

Fixes https://gitlab.com/kicad/code/kicad/issues/8604
2021-06-30 18:32:07 +01:00
Jeff Young 5cac8afe1d Remove long-dead revision support for LIB_IDs. 2021-06-30 13:12:57 +01:00
Jeff Young b1b4caee6a Escape "naughty" characters in symbol names.
It's tempting to say that we don't need to exclude filename chars
from symbols, but we might regret that decision down the road.  Better
to just escape them.

Fixes https://gitlab.com/kicad/code/kicad/issues/8694
2021-06-30 13:12:57 +01:00
Jeff Young 0c2ac9a711 Move GUI font code to common.
This also allows the Mac fixes for font facenames to be more
compartmentalized.

Fixes https://gitlab.com/kicad/code/kicad/issues/8657
2021-06-29 18:27:58 +01:00
Jeff Young 64f07ea9c6 Update text variables after changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/8697
2021-06-29 13:55:06 +01:00
Jeff Young 8526394394 Attempt to fix gcc builds.... 2021-06-28 11:44:22 +01:00
Jeff Young d296bec5b8 Differentiate aSingleLine mode for SCINTILLA_TRICKS
This allows us to avoid the monospaced font (along with the tab-stop
handling), and process a <return> as an OK rather than just <shift> +
<return>.

Fixes https://gitlab.com/kicad/code/kicad/issues/8425
2021-06-28 11:20:12 +01:00
Marek Roszko 7802037495 Namespace the env_vars.h functions 2021-06-27 00:38:19 -04:00
Jeff Young 0f27618125 Use a list dialog that can be parented by the Board Setup dialog.
(The current one keeps pulling the Kicad Manager window to the front
on OSX.)

I also removed the UpdateUI stuff which was probably causing:

Fixes https://gitlab.com/kicad/code/kicad/issues/5049
2021-06-27 01:41:35 +01:00
Jeff Young 81fc710a5d Use consistent terminology.
Fixes https://gitlab.com/kicad/code/kicad/issues/8681
2021-06-26 10:11:41 +01:00
Jeff Young 1f4a56005e Remove extraneous isPrinting test.
Fixes https://gitlab.com/kicad/code/kicad/issues/8609
2021-06-25 12:44:51 +01:00
Jeff Young 27804e40e2 Go back to using space-width for tabs (instead of max-char-width).
The max-char-width impl was buggy and never applied to PCBNew anyway.
Plus the stroke font has a max-char-width of 2.8 time the space width,
so it made for really wide tab spacing.

Also fixes a bug where the Scintilla editors weren't getting a
monospace font on Mac.  (This bug may also exist on the other
platforms, but each would need its own fix.)

Also moves more of the Scintalla customizations to SCINTILLA_TRICKS
where they can be shared.

Fixes https://gitlab.com/kicad/code/kicad/issues/8666
2021-06-24 23:53:27 +01:00
Jeff Young 5fa5a73c6d File open/import progress dialogs.
Fixes https://gitlab.com/kicad/code/kicad/issues/6864

Fixes https://gitlab.com/kicad/code/kicad/issues/2166
2021-06-23 23:55:54 +01:00
Marek Roszko aadb62bd42 Avoid generating paths on windows with ".." in them
This causes wxwidgets to failover to legacy windows dialogs as windows doesn't know how to handle them being passed to dialogs.
2021-06-21 18:03:55 -04:00
Jeff Young 99da3d1336 Bail on single instance checker.
We lock the project file, board, and schematic now, so the second copy
can only open them read-only.  While issues might remain, it's unclear
the warning ever prevented anyone from shooting themselves in the foot
anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/7465
2021-06-20 21:37:02 +01:00
Jeff Young 89718dd3ba Naming conventions. 2021-06-19 19:36:53 +01:00
Jon Evans 32c21f4a94 Fix several window sizing problems on macOS
- Remove outdated y-offset that prevented restoring full-height
  (client area returned by wx is correct these days)
- Clamp frame geometry to fit new display when display is changed
- Handle when an automatic window reposition causes a DPI change

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8341
2021-06-17 23:59:19 -04:00
Jeff Young 16047b7419 3D preferences bug fixes.
1) Make sure prefs get saved when closing parent frame.
2) Add camera projection mode to settings.

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

Fixes https://gitlab.com/kicad/code/kicad/issues/8626
2021-06-17 12:22:18 +01:00
Marek Roszko 45c7c7c350 Remove unused m_crossHairPosition 2021-06-15 21:25:27 -04:00
Wayne Stambaugh ee3eac325d Expunge the use of the word part from Eeschema code. 2021-06-15 08:32:11 -04:00
Jeff Young abc5a6e775 Migrate net names in netclass info.
Fixes https://gitlab.com/kicad/code/kicad/issues/8606
2021-06-15 00:17:39 +01:00
Wayne Stambaugh fb46cd8bc5 Expunge the use of the word component from Eeschema code.
The only exception to this is the SPICE simulator's use of component
when referring to physical component (R, L, C, etc.) values.
2021-06-14 14:00:21 -04:00
Jeff Young 2c1da70181 Write all variables to temp config file and have Kicad2Step use that.
Fixes https://gitlab.com/kicad/code/kicad/issues/7670
2021-06-14 16:54:45 +01:00
Wayne Stambaugh 71c183d7bb Rename LIB_PART to LIB_SYMBOL. 2021-06-14 07:11:17 -04:00
david-beinder da833ad7dd Separate focus from hover state in BITMAP_BUTTON, trigger after mouse down+up
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8556
Adds AcceptDragInAsClick() to maintain support for use in toolbar palettes
2021-06-13 17:00:41 +00:00
Jeff Young 74cefecaac Add legacy empty-string token handling to EDA_TEXT. 2021-06-13 12:11:01 +01:00
Seth Hillbrand 09e1a0dc48 Increase maximum zoom for pcbnew and gerbview
Zoom levels remain the same but high zooms reachable by mouse wheel

Fixes https://gitlab.com/kicad/code/kicad/issues/7093
2021-06-11 14:26:38 -07:00
Jeff Young 096e342386 Prefix TRACK, ARC and VIA. 2021-06-11 22:07:02 +01:00
Mikolaj Wielgus 63c263090f Add versioning to page layout editor worksheets 2021-06-11 18:40:57 +00:00
Mikolaj Wielgus ade38f48bc Add conversion from old `~...~` to new `~{...}` notation 2021-06-11 18:40:57 +00:00
Jeff Young 16b0147af8 Prefix DIMENSION types. 2021-06-11 17:59:44 +01:00
Marek Roszko 803e2101de Fix MSVC compile error
Templates and linkage, ugh
2021-06-11 07:32:41 -04:00
Jeff Young 44086ff2b2 Pull 3D preferences into KiCad preferences architecture.
Fixes https://gitlab.com/kicad/code/kicad/issues/5187
2021-06-11 11:19:40 +01:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00
jean-pierre charras 1c3df973d6 Coverity warnings fixes. 2021-06-10 13:45:02 +02:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
david-beinder 053bd66650 Fix localization of OS unsupported message, disallow bug reports from W7 2021-06-09 19:01:54 +00:00
Jeff Young de95edb5ad UI improvements for Manage Symbol Libraries.
Fixes https://gitlab.com/kicad/code/kicad/issues/8466
2021-06-09 19:20:51 +01:00
jean-pierre charras 5cce3f6e18 Fix a few Coverity warnings (not initialized vars) and a minor compil warning 2021-06-09 19:03:44 +02:00
Jeff Young 9411d301a0 Repair recent pass-by-reference cleanup.
Fixes https://gitlab.com/kicad/code/kicad/issues/8576
2021-06-09 10:56:53 +01:00
Marek Roszko fad5f9881a Remove abandoned variable and thus another include 2021-06-09 00:07:12 -04:00
Marek Roszko d946d6e68f Cleanup some pgm_base.h includes 2021-06-08 21:56:00 -04:00
Marek Roszko 19faadf149 Move wx/dynlib.h include to source file 2021-06-08 21:35:02 -04:00
Marek Roszko 2ede720e1d Remove wx/cmdline.h include 2021-06-08 21:33:09 -04:00
Marek Roszko ffa87e69c6 Remove/replace some stdint.h includes 2021-06-08 21:17:57 -04:00
Seth Hillbrand ea283625a7 Further simplification of AA regime
Reduce each (Accel & Fallback) to 3 options: Off, Fast, Good.  Fast AA
in accelerated canvas uses SMAA with tweaks suggested by David Beinder.
Good AA is super-sampled x2.

Cairo is similarly reduced to Off, Fast, Good, which map to the Cairo
options themselves.  Best is removed as it mostly affects text rendering
and not line drawing (as our text is)
2021-06-08 17:20:41 -07:00
Marek Roszko f2e5a5d34e Add missing cstdint include 2021-06-08 19:51:35 -04:00
Marek Roszko 6e01ce84b9 Break out eda_item_flags.h, fix the typedef to std::uint32_t, fix some signed vars 2021-06-08 19:12:30 -04:00
Marek Roszko cc4d38d347 Slightly "unhide" the UNDO_REDO_LIST enum 2021-06-08 19:12:30 -04:00
Marek Roszko b2f5c989a6 Suppress leaking eda_item so much via undo_redo_container.h 2021-06-08 19:12:30 -04:00
Marek Roszko 20134e4a1b Evict some more eda_item.h includes 2021-06-08 19:12:29 -04:00
Marek Roszko 5db1559018 tool_base.h doesn't need eda_item.h 2021-06-08 19:12:29 -04:00
Wayne Stambaugh e6346e3103 Pass objects by reference instead of on the stack part 2. 2021-06-08 13:47:21 -04:00
Wayne Stambaugh 9ebabb222c Pass objects by reference instead of on the stack. 2021-06-08 10:09:38 -04:00
Marek Roszko 8f2819cfa4 Kill the last of wx/wx.h in headers 2021-06-07 17:59:20 -04:00
Johannes Maibaum 022dd6072c Add utility method to resolve symlinks
The same logic block to resolve possible symlinks exists in 5 different
places now. This change moves this duplicated code to a static member
function of WX_FILENAME instead.
2021-06-07 20:59:59 +00:00
Jeff Young 3ff670d2a4 Disable ACTIONS::openPreferences for now.
wxWidgets needs to move the item to the KiCad menu on Mac, and it
can only find it if it has the id wxID_PREFERENCES.
2021-06-07 20:51:45 +01:00
Wayne Stambaugh 08e8b17029 Minor plotter code improvements. 2021-06-07 14:32:27 -04:00
Marek Roszko 5bb6f8c5e3 hashtables.h doesn't need eda_item.h 2021-06-06 19:11:35 -04:00
Marek Roszko 4a1126c5e0 DIALOG_SHIM doesn't use hashtables.h 2021-06-06 19:08:34 -04:00
Marek Roszko 10e60acf34 Clean up including of board_design_settings.h 2021-06-06 15:03:42 -04:00
Ian McInerney dc27079b71 cleanup tool event and tool action includes 2021-06-06 18:26:26 +01:00
Ian McInerney 425331b655 Explictly copy TOOL_EVENT_LIST in the copy constructor 2021-06-06 18:25:17 +01:00
Ian McInerney e29b61ccc1 Fix build error with selection class 2021-06-06 17:26:12 +01:00
Marek Roszko 527bda5d58 Split out selection.cpp to reduce header sharing
selection.h is included into 782 compilation units....
2021-06-06 11:09:07 -04:00
Marek Roszko 38e3b7eacd We don't need eda_item in unit_binder.h 2021-06-06 11:09:07 -04:00
Marek Roszko fcb21038cb Reduce some eda_item.h usage in headers 2021-06-06 11:09:06 -04:00
jean-pierre charras 2078483f50 Fix incorrect test of wxUSE_GLCANVAS_EGL (Linux).
in wxWidgets 3.1.5 wxUSE_GLCANVAS_EGL is always defined (set to 0 or to 1)
So using "ifdef wxUSE_GLCANVAS_EGL" is incorrect.
2021-06-06 16:10:35 +02:00
Marek Roszko e234e4dc8b Remove wx/log.h from vertex_manager.h 2021-06-06 09:31:00 -04:00
Marek Roszko 4712d7a918 Remove a leaky wx/msgdlg.h include 2021-06-06 08:45:38 -04:00
Jon Evans c9a660a80c Rework JSON integration to speed up build 2021-06-05 17:08:38 -04:00
david-beinder 2b4564571c GAL: Tune SMAA to have a conservative and aggressive mode
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8522
Conservative makes SMAA usable in Eeschema through weaker AA.
Aggressive reduces some artifacts compared to the High preset.
Restores the unused Ultra preset in the shader source to its original state.
2021-06-04 17:48:34 +00:00
Ian McInerney f94816fbd4 Cleanup wx includes in the filter reader 2021-06-04 01:26:58 +01:00
Seth Hillbrand cccdaddd50 Adding SHAPE_ARC direct plotting 2021-06-03 17:12:56 -07:00
Marek Roszko 013209046b KIWAY_HOLDER doesnt need wx/frame.h 2021-06-03 18:59:11 -04:00
Marek Roszko c346da0ed2 Remove not needed wx/event.h include 2021-06-03 18:54:48 -04:00
Marek Roszko b1c9083743 Remove the wx/docview.h include 2021-06-03 18:42:08 -04:00
Marek Roszko 4e94b1fe86 Remove the universal sockets include 2021-06-03 17:59:46 -04:00
Hajo Nils Krabbenhöft 937f502158 Improve accelerated supersampling 2x antialiasing
Avoid fractional pixel offsets by forcing integer division of m_screenSize.
Shift rounded lookAtPoint onto OpenGL pixel center to ensure consistent rounding to int.
The pixel 0..1 @ 1x needs to fill the area 0..2 @ 2x so its center moves by 0.5 * (pixel size @ 1x).
2021-06-03 17:53:51 +00:00
Wayne Stambaugh 7c14e4e967 Common widget header housekeeping. 2021-06-03 12:02:45 -04:00
Marek Roszko 4df3cb912d Remove another leaky wx/log.h header 2021-06-03 08:11:15 -04:00
Marek Roszko 7faee5eda5 Stop salt the eart with wxhtml.h 2021-06-03 07:49:49 -04:00
Marek Roszko 5f91d3e321 Add header to bitmap_info.h.in in previous move 2021-06-03 07:14:59 -04:00
Marek Roszko b5b76eedf7 Avoid sharing gdicmn for just bitmaps 2021-06-03 01:46:04 -04:00
Marek Roszko 8ea180c6b7 Don't leak wx/debug everywhere via tool_event 2021-06-03 01:36:12 -04:00
Ian McInerney 3ab69939f9 Remove wx.h from many files 2021-06-03 02:19:20 +01:00
Marek Roszko af2707929d Don't leak a wx header via eda_item.h
Turns out this provided the translation header globally :D
2021-06-02 19:18:48 -04:00
Ian McInerney f03ca3259e Remove unused Boost code/includes 2021-06-02 18:39:43 +01:00
Ian McInerney 9a07b03b4c Replace boost::function with std::function 2021-06-02 18:39:43 +01:00
Marek Roszko 45d1684bbe Move inline function declaration to allow removing include 2021-06-01 19:03:22 -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
Marek Roszko 04ab71c47c Tweaks to build 2021-06-01 20:18:24 +00:00
Seth Hillbrand bf1437899e Add Python Tool to pcbnew 2021-06-01 20:18:24 +00:00
Seth Hillbrand c7d188a8d0 Centralizing SCRIPTING class 2021-06-01 20:18:24 +00:00
Seth Hillbrand 192fbfd5e5 Finalize Python Frame 2021-06-01 20:18:24 +00:00
Seth Hillbrand 81d58bcea9 Working python window 2021-06-01 20:18:24 +00:00
Seth Hillbrand 6fbbba8db3 Adding Python shell KIFACE 2021-06-01 20:18:24 +00:00
Seth Hillbrand f274a00c08 Remove PYTHON_* compile options 2021-06-01 20:18:24 +00:00
Jon Evans 247da631f9 Revert "Fix typo and clean up leftover tracks"
This reverts commit ed66c0f14d.

Revert "Clean up co-linear tracks after finishing routing"

This reverts commit 1a102f03c0.

More complex solution needed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8526
2021-06-01 11:18:00 -04:00
Jon Evans 1a102f03c0 Clean up co-linear tracks after finishing routing
This involved adding some extra infrastructure to be able
to handle the case where a track that is sitting in the
router's commit waiting to be added to the board actually
needs to be deleted instead.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8419
2021-05-31 17:36:38 -04:00
Jeff Young c4cabb38d5 More worksheet -> drawing sheet cleanup.
Fixes https://gitlab.com/kicad/code/kicad/issues/8516
2021-05-31 12:26:44 +01:00
Jeff Young 0598c82972 Terminology (use present tense for flags). 2021-05-31 12:26:44 +01:00
Marek Roszko 382dca4e6f Fix uninitialized member warnings
Based on PVS Studio report
2021-05-30 20:01:01 -04:00
Tomasz Wlostowski 2b955437b6 VIEW_OVERLAY: add Get[Fill/Stroke]Color methods. 2021-05-31 00:15:16 +02:00
Jon Evans eff9746f34 CHANGED: Net highlight in PcbNew is now persistent to match Eeschema
CHANGED: Highlight net tool changed to highlight display toggle; moved to left toolbar
CHANGED: Multi-net highlight is now accessible when using the highlight net action
ADDED: Highlight Net and Clear Highlight actions to Net Tools context menu
ADDED: Default hotkey (Ctrl+`) for toggling net highlighting

The current and previous net highlight state are now stored and can be toggled
on or off with an action (no hotkey by default).

Highlight is now treated as a persistent state rather than a tool that is entered,
meaning there is no longer a special tool to enter in order to highlight nets.
Highlighting can be controlled while any other tool is active using the hotkeys
or context menu on a net object.

Tweak the icons for highlight net and layer display mode to better disambiguate them.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8250
2021-05-29 12:40:24 -04:00
jean-pierre charras 81c7fb61f8 Sub-menu "Preferences..." in main menu "Preferences": fix not working accelerator key.
Accelerator keys are disable in our WX_MENUBAR. A common ACTION_MENU is used and
"Preferences..." is now shown in Hotkeys list.
2021-05-29 18:09:49 +02:00
Seth Hillbrand 752ae4d519 Rename modification flag routines
Differentiates better between the EDA_ITEM IsModified(), referring to
items themselves changing and the EDA_SCREEN IsContentModified(),
referring to whether we have made any unsaved changes.
2021-05-28 12:07:04 -07:00
Seth Hillbrand 11438eb0ec Add standard wire orange and correct color init
Initialized COLOR4D takes an EDA_COLOR_T enum but then referenced it as
an index to the color table.  This uses the enum as comparison against
the table-stored enum.

Adds standard orange to picker swatches
2021-05-28 11:51:54 -07:00
Seth Hillbrand b1dcf74042 Use standard "Untitled" name for files without names
Also translates to provide useful information regardless of language
2021-05-28 11:51:54 -07:00
Seth Hillbrand d7f219e98f Unify IsSave and IsModify
The flags and calls were used identically, leading to potential
confusion/bugs.  Testing for modification should go through
IsContentModified()
2021-05-28 11:51:54 -07:00
Jeff Young e93e9fa3e5 Add rudimentary type checking to rule eval with reporter.
Also cleaned up existing error reporting to not expend CPU cycles
when there was no reporter.

Fixes https://gitlab.com/kicad/code/kicad/issues/8438
2021-05-20 23:06:24 +01:00
Jeff Young 224d258474 A bit of safety.
Should also silence Coverity.
2021-05-17 10:45:26 +01:00
Jeff Young 12f985f978 Add Quit and Close to the HotKeys list.
Fixes https://gitlab.com/kicad/code/kicad/issues/8391
2021-05-11 23:25:13 +01:00
Jon Evans bc6b9b527a Allow stackup height to be excluded from length calculations
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8384
2021-05-10 22:11:58 -04:00
Jeff Young 7356f9568d Move grid disable modifier from ALT to CTRL.
Also had to move the H/V/45 disable modifier from CTRL to SHIFT.

Fixes https://gitlab.com/kicad/code/kicad/issues/8124
2021-05-09 20:17:40 +01:00
Ian McInerney 916a15793f Fix some OSX compiler warnings 2021-05-09 12:59:57 +01:00
jean-pierre charras 1c6f291bcd EDA_BASE_FRAME: add accessor to m_ident (useful in debug) 2021-05-09 08:41:41 +02:00
jean-pierre charras 56058314be Fix minor Coverity warnings and minor compil warnings.
(uninitialized or shadowed vars)
2021-05-05 08:58:55 +02:00
Jon Evans b986797469 Move pcb calculator to new bitmap system
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8324
2021-05-03 22:28:25 -04:00
Wayne Stambaugh d2a7f81b10 Debugging improvements and clean up.
* Remove unused wxLogDebug calls.
* Add add application level character tracing to detect unhandled key
  events.
* Catch unhandled exceptions in KiCad main event loop like single top
  applications.
2021-05-03 18:08:15 -04:00
Tomasz Wlostowski 69e1891e42 common: add PROPERTY::IsValueDefined() 2021-05-03 23:45:54 +02:00
Roberto Fernandez Bautista 0f0c5c194b Add qa test: save and reload schematic with page numbers
Note: PGM_BASE::InitPgm() is creating a SETTINGS_MANAGER object, which
in turn tries to display a "migrate settings" dialog when no settings
are found, but obviously the dialog can't be displayed inside docker.

Needed to add an optional parameter to InitPgm() in order to allow
running in headless mode.
2021-05-03 19:38:31 +01:00
Roberto Fernandez Bautista 5822cd85c4 Fix eeschema copy/paste: save and load sheet and symbol instances
Save sheet and symbol instance information to the clipboard on copy

Load sheet and symbol instance information from the clipboard on paste
and renumber page numbers after loading.

Correctly handle pasting in a multiple hierarchy by ensuring symbol and
sheet instances are updated for all instances of the destination sheet.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8207
2021-05-03 19:38:31 +01:00
Ian McInerney ad705e1065 Formatting 2021-05-03 15:47:55 +01:00
Jon Evans 5b040f16a3 Refactor environment variable storage
CHANGED: Environment variables defined outside of KiCad will no longer
         be saved in the settings file.  Paths can be configured via
         the Configure Paths dialog and those changes will be saved in
         the settings file if the new path is different from the default
         and the path variable was not defined in the system environment.
2021-05-01 13:39:43 -04:00
Jon Evans a82a693d20 PARAM_LAMBDA: Fix implementation of MatchesFile 2021-05-01 13:39:43 -04:00
jean-pierre charras 0427bda768 Remove useless wx/wx.h include, that create sometimes compil warnings on msys.
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
2021-05-01 19:32:15 +02:00
Marek Roszko cc1bfd4c18 Harden drawing sheet loading slightly...
The fact it blindly assumed it would always work makes me sad :( So this is just ducktape
2021-05-01 13:20:58 -04:00
Marek Roszko 3a9a85b373 Enum class PAD_PROP_T
Renamed such that it does not affect python
2021-05-01 10:58:30 -04:00
Marek Roszko 03cf2b517f Enum class PAD_ATTR_T
Renamed such that python stays the same
2021-05-01 10:51:54 -04:00
Marek Roszko b243c2280d enum class PAD_SHAPE_T 2021-05-01 08:22:35 -04:00
Marek Roszko 21fde9b629 enum class PCB_SHAPE_TYPE_T 2021-04-30 22:36:12 -04:00
Jon Evans 64d35ecebc Enable dark mode for MacOS 2021-04-28 23:24:19 -04:00
Jonathan Haas 075bd788eb Remove unused OBSTACLE_VISITOR::m_extraClearance 2021-04-23 01:53:09 +00:00
Ian McInerney ecd9bf696e Be consistent about using nullptr instead of 0
0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
2021-04-22 22:20:34 +01:00
Wayne Stambaugh 54e18f6b1f Pcbnew: remove update schematic option for geographical annotation dialog.
REMOVED: Update schematic option from geographical annotation dialog due
to potential issues with incomplete and/or broken updates.  Use "Update
Schematic from PCB" tool to update reference designation changes.

Forcing the footprint reference designator changes back to the schematic
without checking any other board changes in the schematic could leave the
schematic in a undefined state.  The update schematic from board tool is
the correct method to sync any changes from the board.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8042
2021-04-22 12:45:59 -04:00
Jon Evans e7d3bf29aa Don't save project for legacy board without explicit action
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7368
2021-04-21 21:27:23 -04:00
Marcus A. Romer c5e77e9739 Respect KICAD_DOCS when searching for help files
On Linux, the documentation and help files are potentially installed to
a non-standard location (i.e., outside of /usr/share/doc/kicad/). This
can be the case when, e.g., multiple versions of KiCad are installed in
parallel. Making KICAD_DOCS available at run-time is the only viable
solution to allow the applications to find the help files in this case.

Fixes https://gitlab.com/kicad/code/kicad/issues/7874
2021-04-21 19:19:25 +00:00
Marcus A. Romer a97ccbf7ed Refactor help file search logic
Rely on existing code to initialise the list of paths in which the KiCad
documentation might be located, thereby making SearchHelpFileFullPath
platform-agnostic and easier to read.
2021-04-21 19:19:25 +00:00
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