Commit Graph

3591 Commits

Author SHA1 Message Date
Carsten Schoenert 9a13dd48af fix misspelled 'Toogle' -> 'Toggle'
A small typo fixup for misspelled word Toogle.
2018-07-11 10:34:53 -04:00
Martin Aberg 9b1f2447b6 fp_lib_table: explicit assumption by assert
This commit makes an implicit assumption explicit by describing it with
an assert.

Fixes lp:1778426

https://bugs.launchpad.net/kicad/+bug/1778426
2018-06-29 19:36:58 -04:00
Seth Hillbrand 4af699e919 hotkeys: Don't import v4 hotkeys automatically
Hotkey options have shifted some options from context-specific to global
hotkeys.  This causes conflicts with old hotkey definitions.  Instead,
we keep the v5 eeschema/pcbnew hotkeys completely separate.  Users can
still import their custom hotkey files from v4.

Fixes: lp:1778408
* https://bugs.launchpad.net/kicad/+bug/1778408
2018-06-29 11:20:11 -07:00
Simon Richter d3deaf5ff5 Rewrite test for valid characters in names
The ternary operator decays array arguments to pointers, so they can no
longer be assigned to array references.
2018-06-29 09:42:10 +02:00
Seth Hillbrand 76f151b4d8 Fix issue with prev d83cff63f
Corrected the new/delete idiom
2018-06-27 16:40:57 -07:00
Seth Hillbrand d83cff63f6 fix memory leak
When staging a commit for an object that has already been modified,
there is a Clone() made for the hypothetical entry.  We need to free it
if we are not storing a new entry.
2018-06-27 16:15:27 -07:00
Seth Hillbrand d30ac2967a eeschema: Rescue symbols with illegal chars
When parsing component names, we need to account for the possibility of
illegal characters (e.g. "/", ":") in the names from v4 libraries.  They
are fixed internally by the cache parser but if we don't fix them
in the rescue routine, the symbol won't match it's cache name.

This standardizes all schematic illegal character routines into LIB_ID

Fixes: lp:1774774
* https://bugs.launchpad.net/kicad/+bug/1774774
2018-06-27 14:15:30 -07:00
Maciej Suminski f10aa6c857 Use paths relative to the executable on Windows
Paths based on DEFAULT_INSTALL_PATH do not work on Windows,
as in fact there is no default install path, as in case of Unix-based
systems. In such case, the initial paths point to mingw subdirectories
that normally do not exist on user machines.

The patch changes the initial path values to make them relative to
the executable and follow the current Windows installer scheme.

Fixes: lp:1775796
* https://bugs.launchpad.net/kicad/+bug/1775796
2018-06-27 11:02:48 +02:00
Andrzej Wolski 1f6f76beb9 Fix overbar drawing for non-italic text
Overbar was always indented inward, regardless if text was italic or not.
2018-06-24 12:01:10 -04:00
Maciej Suminski 73a8d2a9d5 OPENGL GAL: Fixed the iteration condition when drawing triangulated polyset
The loop used an incorrect variable size as the loop limit,
occasionally causing out of bounds accesses.

Fixes: lp:1778288
* https://bugs.launchpad.net/kicad/+bug/1778288
2018-06-23 02:05:21 +02:00
Maciej Suminski 1751e4631c Code formatting 2018-06-23 01:59:49 +02:00
Andrzej Wolski a7cd62ad12 Save through hole pads color to config file
TH Pads color is now user settable, so should be saved in config file.
2018-06-22 11:34:56 -04:00
Seth Hillbrand a1ef441dd9 origin viewitem needs to account for size zoom
The origin item doesn't have a fixed size.  It is constant on the screen but
changes the effective BBox size based on the zoom level.
But we can't simply set it to the maximum size as this causes a splitting degeneracy
when compiling for Debian i386.  By modestly adjusting the bbox, we avoid the degeneracy
while keeping the origin visible at all zoom levels

Fixes: lp:1777379
* https://bugs.launchpad.net/kicad/+bug/1777379
2018-06-20 12:08:57 -07:00
Wayne Stambaugh 8394e2b71e Fix broken LIB_ID library nickname illegal character tests.
During the symbol library table implementation, the legal character
tests for the footprint library table were changed and the forward
slash '/' character became illegal.  This change broke editing some
users footprint library tables that already had '/' in library table
nicknames.  This change split the library nickname and library item
name illegal character tests.
2018-06-20 14:36:40 -04:00
Jeff Young 79e0bb08d0 Architecturally-simpler fix for grid context menu unit changes.
Fixes: lp:1777519
* https://bugs.launchpad.net/kicad/+bug/1777519
2018-06-20 16:54:24 +01:00
Maciej Suminski 44337dec56 pcbnew GAL: Fix bouncing zoom on mouse wheel scroll in Windows
Handling wxEVT_SCROLLWIN_LINE{UP,DOWN} executes the scroll event handler
too many times causing zoom bounces.

Fixes: lp:1562173
* https://bugs.launchpad.net/kicad/+bug/1562173
2018-06-20 16:55:14 +02:00
jean-pierre charras f52763f22b Legacy canvas: fix issue when zooming in/out using mousewheel: slightly shifts screen up/down.
It happens only when the 'warp and center cursor on zoom' option is disabled.

Was created after modifying the code in EDA_DRAW_FRAME::AdjustScrollBars(),
making EDA_DRAW_FRAME::RedrawScreen2() not working very well.

(partial fix of bug 1562173)
2018-06-19 19:53:00 +02:00
Jeff Young 3c7b91b96a Always create grid menu so units are up-to-date.
Fixes: lp:1777519
* https://bugs.launchpad.net/kicad/+bug/1777519
2018-06-19 10:52:36 +01:00
Alexis Lockwood 860a95ca30 Correct my name in AUTHORS.txt and About dialog 2018-06-13 23:10:27 -06:00
jean-pierre charras 5411b951ae Minor compil warning (signed/unsigned compare) fix 2018-06-13 08:05:10 +02:00
Seth Hillbrand bc7bd107d9 Fix a number of untranslated strings. 2018-06-12 17:05:25 -07:00
Seth Hillbrand 5de246c5be Add handlers for scrollbar events
Fixes: lp:1776120
* https://bugs.launchpad.net/kicad/+bug/1776120
2018-06-12 08:53:50 -07:00
Maciej Suminski 813c1a2ba2 Dealing with inconsistent wxGLCanvas::IsDisplaySupported()
wxGLCanvas::IsDisplaySupported() handles wxGL_{MINOR,MAJOR}_VERSION
attributes only in 3.0.4. Since 3.1.0 the attributes are apparently not
supported, so instead wxGLContext::IsOK() is used (introduced in 3.1.0).

Fixes: lp:1775995
* https://bugs.launchpad.net/kicad/+bug/1775995
2018-06-11 12:26:59 +02:00
Damien Espitallier 0e3be5776c Add library name pseudo-hash in fp_list_table GenerateTimestamp output 2018-06-09 16:18:40 +01:00
Jeff Young b9874da3a6 Remove background fp loading from Choose Symbol dlg.
There are a bunch of problems with event processing and closing
documents, etc., when enabled.  See the bug report for more
info.

Fixes: lp:1774777
* https://bugs.launchpad.net/kicad/+bug/1774777
2018-06-09 00:51:39 +01:00
Seth Hillbrand 7d62f14dd0 Set ViewBBox to viewitem size
Limit the bbox size of origin view item to item size.  This prevents
excessive redraw.

This also side-steps a degeneracy in the RTree calculation under certain
conditions in i386 where multiple, maximum-sized items are degenerate.

Fixes: lp:1774316
* https://bugs.launchpad.net/kicad/+bug/1774316
2018-06-05 15:35:58 -07:00
John Beard 58814e838d Common: Fix -Wcatch-value warnings (catching exceptions by value)
This fixes some warnings on GCC 8.1:

warning: catching polymorphic type ‘class std::out_of_range’ by value [-Wcatch-value=]
         catch( std::out_of_range )
                     ^~~~~~~~~~~~

This fix is along the same lines as:

* ff1802d7a "Fix Coverity "Big parameter passed by value" warnings"
2018-06-05 11:46:17 +02:00
Seth Hillbrand f95b77b61a Fix overflow on 32-bit machine
Bitmap hash incorrectly shifted by 60 bits on 32 bit machines while only
shifting 28 bits on 64 bit machines.
2018-06-04 16:41:16 -07:00
Seth Hillbrand ee34aab07a Async hardening
There are three related changes here to harden our handling of threads
in the footprint async loader.

1) Footprint async loader explicitly aborts any remaining loader threads
on exit.

2) We protect the thread join by a mutex

3) We do not pause during no-wait routines
2018-06-04 15:08:40 -07:00
Wayne Stambaugh 7343e78347 Fix some Coverity uninitialized field warnings.
Fixes Coverity CIDs:

- 175824
- 169337
- 163191
- 175827
- 175440
- 175438
- 157136
2018-06-04 13:48:57 -04:00
Maciej Suminski 6bd708621b Early check of supported OpenGL version 2018-06-04 12:17:58 +02:00
jean-pierre charras 8f984c2899 OpenGL, DrawGrid(): use grid and axis alpha color value setting, instead of the fixed 1.0
In Cairo mode, this function uses already the alpha color value setting.
Now for low alpha values (usually they are low, as said in many GAL comments),
Cairo mode and OpenGL mode should have a similar look.
2018-06-01 18:29:04 +02:00
Seth Hillbrand 3cf9009f73 Delete GL context in GL destructor not program
Also lock the DeleteAll call with mutext to protect threaded access.

The OpenGL contexts are removed when OPENGL_GAL class is destroyed.
Explicitly deleting all contexts prior to destroying the OPENGL_GAL
class causes an assert when the destructor tries to lock its context
prior to cleaning up OpenGL memory.  In most cases, an unhandled assert
in a destructor-called function will simply exit the destructor.

Python thread cleanup will also attempt to close the context.  This can
cause a race condition with multiple threads accessing/deleting the
canvas.

Fixes: lp:1774096
* https://bugs.launchpad.net/kicad/+bug/1774096
2018-06-01 09:14:36 -07:00
jean-pierre charras 9a228d8ec9 Gerbview: GAL mode: shows the page worksheet, similar to legacy mode. 2018-06-01 09:11:43 +02:00
Seth Hillbrand fe1f837d0c Limit zoom out
We limit the minimum zoom to Z=0.3.  Minimum preset zoom level is 0.31,
so 0.3 is only reachable using the mouse wheel.  Smaller than 0.18, GAL
does not display properly.

Fixes: lp:1773215
* https://bugs.launchpad.net/kicad/+bug/1773215
2018-05-30 11:24:35 -07:00
Seth Hillbrand eeb273faa0 Partial revert of 3804f6 to correct assert change
ToLayerID function converts to PCB_LAYER_ID and needs to check against
that enum instead of GAL_LAYER_ID.
2018-05-30 09:17:51 -07:00
jean-pierre charras 71e64de3a4 gerber plot: fix incorrect string attribute for BGA pads on copper layer 2018-05-29 12:30:52 +02:00
jean-pierre charras c614f73c50 HPGL plotter fix incorrect scaling factor
A 0.4% scale error in hpgl plots was previously existing since a long time.

Fixes: lp:1772828
https://bugs.launchpad.net/kicad/+bug/1772828
2018-05-25 20:50:00 +02:00
Jeff Young cd5f727880 Fix off-by-1 errors in zoom menus & use zoom steps in GAL canvas.
Also bumps the maximums a bit (at user request).

Fixes: lp:1773215
* https://bugs.launchpad.net/kicad/+bug/1773215
2018-05-25 13:01:58 +01:00
Maciej Suminski 32f599654f Fixed normalizeAbsolutePaths() condition
normalizeAbsolutePath() used an invalid condition to
verify that the tested paths are on the same volume.
2018-05-25 11:07:51 +02:00
Maciej Suminski adc61024d3 DIALOG_FILE_DIR_PICKER: dialog to select both files and directories
wxWidgets offers two dialog types: wxFileDialog and wxDirDialog, one
to select files, the other to select directories, but neither of them
handles both. DIALOG_FILE_DIR_PICKER fills that gap.
2018-05-25 08:51:45 +02:00
Seth Hillbrand cf2a07559d Safely release thread memory
When starting async processes, we need to have a way to stop the process
before releasing memory.  Descoping FOOTPRINT_ASYNC_LOADER while the
threads were still running could cause crashes depending on the memory
structure.  To avoid this we define clear procedures for exiting a
running async processes and call these when exiting.

Fixes: lp:1772909
* https://bugs.launchpad.net/kicad/+bug/1772909
2018-05-23 08:55:55 -07:00
jean-pierre charras 3893c43eb0 Fix compil issues. 2018-05-23 11:31:13 +02:00
Seth Hillbrand 8c5037a48b Optionally sort reporter messages
It can be useful to have similar class messages grouped together so that
error messages in a larger report don't get lost among the
warning/info/action messages.

This patch allows sorting of messages for dialogs that benefit from
organization.  Default behavior of reporter messages remains
unchanged by this patch.

Fixes: lp:1772090
* https://bugs.launchpad.net/kicad/+bug/1772090
2018-05-22 13:55:02 -07:00
Jeff Young 2b22cbe94d Release mouse before closing HTML_MESSAGE_BOX.
Fixes: lp:1772275
* https://bugs.launchpad.net/kicad/+bug/1772275
2018-05-21 13:18:41 +01:00
Wayne Stambaugh 5678a166ee Fix template path bugs.
Remove KICAD_PTEMPLATE environment variable as it's purpose was not
clear and was often poorly defined as the path to the KiCad installed
templates.

Add a new KICAD_TEMPLATE_DIR environment variable which clearly should
be the path of the KiCad installed templates.  Make this environment
variable available in the user settings in case the default is wrong
which has been the case in some instances.  Use the standard search
stack to set the default system template path which has a much greater
chance of being correct.

Add a new KICAD_USER_TEMPLATE_DIR environment variable which clearly
should be the path of the user defined templates.  Users most likely
were not even aware of the old default user path unless they read the
fine manual.

Set template path search stack priority as follows:

* KICAD_USER_TEMPLATE_DIR
* KICAD_TEMPLATE_DIR
* Search stack template paths

Reverse template selection dialog and project path dialog for improved
user experience.

Fixes lp:1543443

https://bugs.launchpad.net/kicad/+bug/1543443
2018-05-20 18:56:11 -04:00
Jeff Young 63c9e11aae Bug fixes in Length Tuning UI.
1) hide the status popup when the dialog is brought up
2) forward events from the popup to the canvas so hotkeys work
3) make sure diff pair radius is always 100%
4) fix greyed-out Miter style label
5) make L a hotkey so it works before you start dragging

Fixes: lp:1545856
* https://bugs.launchpad.net/kicad/+bug/1545856
2018-05-20 23:48:29 +01:00
Seth Hillbrand d62b4f36a6 Save hotkeys to combined app-based file
Unifies the different sections of hotkeys so that we are not storing two
[eeschema] or [pcbnew] sections in two different files.

Previous hotkey definitions are loaded at start if they exist but are
overwritten by the new format, if it exists.  Changes to hotkeys save
only in the combined format.

Hotkey editor for each application only shows the hotkeys relevant to
that application.

Fixes: lp:1741757
* https://bugs.launchpad.net/kicad/+bug/1741757

Fixes: lp:1668799
* https://bugs.launchpad.net/kicad/+bug/1668799
2018-05-18 12:57:38 -07:00
Seth Hillbrand d22fceca7c Revert hotkey save format
This reverts the hotkeys file format to a human readable and VCS
compatible listing by splitting individual hotkey assignments onto
separate lines instead of the single key. This unifies the hotkey format
between the application configuration and export Hotkey routines.

Both hotkey formats remain readable by the same routines.
2018-05-18 12:53:45 -07:00
jean-pierre charras ec98bbba11 Fix issue: HPGL (plot mode sketch) : polygons are not closed.
Fixes: lp:1771531
https://bugs.launchpad.net/kicad/+bug/1771531
2018-05-18 10:13:46 +02:00