Commit Graph

60 Commits

Author SHA1 Message Date
jean-pierre charras de793aa43d Fix a side effect of our LOCALE_IO by using setlocale( LC_NUMERIC, "C" ) instead of setlocale( LC_ALL, "C" )
LC_NUMERIC is the right option to use in LOCALE_IO because only the floating point separator must be modified
When using LC_ALL, the Env var expansion wxGetEnv() was not working when the env var contains non ascii7 codes after a call to LOCALE_IO.
When using setlocale( LC_NUMERIC, "C" ) in LOCALE_IO, wxGetEnv() works fine.

Fixes: lp:1795990
https://bugs.launchpad.net/kicad/+bug/1795990
2018-10-07 16:26:10 +02:00
jean-pierre charras a330eb1575 Add Chinese traditional in language list. 2018-08-27 18:30:49 +02:00
Jeff Young 86a801aabc Allow updating of file history size on the fly.
Also updates the file menu IDs so that we can actually handle
more than 9 items in the file history.

Also adds configurable file history length to the other gerber
files (zip, drill and job).

Fixes: lp:1745729
* https://bugs.launchpad.net/kicad/+bug/1745729
2018-08-21 10:34:41 +01:00
Wayne Stambaugh b8aec37ef1 Fix external check for KISYS3DMOD environment variable.
Fixes lp:1782708

https://bugs.launchpad.net/kicad/+bug/1782708
2018-07-23 12:47:48 -04:00
Jeff Young aab97c8385 Consolidate design rules UI.
Implement new Board Setup paged dialog which includes:
  Layers Setup
  Design Rules
  Solder Mask & Paste
  Text & Drawings

Moves line width and text properties to a layer-class-based
system.  Renames unlocked to upright (which also reverses the
logic).

New Edit Text and Graphic Properties dialog which replaces
Edit Footprint Text and adds layer-class-based editing and the
italic, upright and visibility properties.

Adds Import Settings functionality which allows settings to
be imported from another project at page granularity.

Also UNIT_BINDERizes the dialog and adds editing of pcb text.

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

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

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

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

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

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

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

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

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

(cherry picked from commit 3944a5e)
2018-07-17 15:12:34 +01:00
Jeff Young 7841f8a466 Unified preferences dialog framework.
(cherry picked from commit 8ee3e77)
2018-07-17 15:11:17 +01:00
Jeff Young 8f0aa68ab8 Fold 3D Search Paths dialog into Configure Paths.
Use in-place editing for both.

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

(cherry picked from commit 33622cd)
2018-07-17 15:11:01 +01: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
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
Carsten Schoenert a11714b1a4 fix misspelled 'an other' -> 'another' 2018-04-08 13:24:37 -04:00
Seth Hillbrand a607174f9a Fix english grammar 2018-03-08 12:33:32 -08:00
Jeff Young 182b134872 Don't overwite env vars with settings.
Fixes: lp:1740022
* https://bugs.launchpad.net/kicad/+bug/1740022
2018-03-08 19:17:31 +00:00
jean-pierre charras 5d72aebd22 Fix code after renaming files 2018-01-29 16:40:22 +01:00
Wayne Stambaugh 81e8d8fd89 Symbol library table remapping fixes.
Use GetPath() instead of GetFullPath() when initializing environment
variable table entries KICAD_SYMBOL_DIR and KICAD_PTEMPALTE due to
unexpected trailing path separator which was causing find libraries
by URI to fail.

Don't create a project symbol library table when there are no libraries
not found in the global symbol library table.

Don't add non-existent libraries to project symbol library table.

Clear symbol library table when loading a new schematic.

Minor remapping status message improvements.
2017-11-09 18:50:18 -05:00
Wayne Stambaugh 33cc7b3f99 Fix broken default icons in menus setting for OSX. 2017-09-13 12:59:42 -04:00
Wayne Stambaugh f781691049 Eeschema: add symbol library table editor dialog.
Create a new dialog to edit global and project specific symbol library
tables.

Add menu entries for new symbol library table editor in schematic editor
and symbol library editor main frame menus.

Add command event handler for symbol library table editor dialog to
SCH_BASE_FRAME so it is accessible from derived frames.

Fix bug in default environment variables initialization.  A test for
existing user defined environment variables was preventing any new
default environment variables added to the list from being initialized.
2017-08-12 08:10:34 -04:00
jean-pierre charras b8c621a991 fix a few Coverity warnings. 2017-08-06 14:23:03 +02:00
Fabrizio Tappero ac9a64a173 general UI fix. Fixed a lot of icons and a lot of menu.
Also a few no longer used .cpp icon files are removed.
2017-06-02 11:51:11 +02:00
Simon Wells 117faf898f Disable icons in menus by default on osx 2017-04-13 13:49:55 -04:00
Wayne Stambaugh 9c2ebf32f1 Initial symbol library table implementation prep work.
Add loading symbol library table code to schematic PROJECT object.

Fix minor issues with loading global symbol library table.

Add default symbol library path environment variable to the environment
variable list and change the variable name to KICAD_SYMBOL_DIR.

Add code to SCH_SCREENS to test if all library nicknames of the symbol
library IDs are empty.

Remove unnecessary KICAD_USE_SCH_IO_MANAGER build option.
2017-03-31 16:29:34 -04:00
John Beard ece7eeb280 Move SystemDirsAppend to own header
This function is called only from three sites, it doesn't need to be in
common.h.

The implementation was already in systemdirsappend.cpp, so a matching
header was created for it.

This reduces the visibility of the function to only the files that need
it and slightly shrinks common.h.
2017-03-23 09:23:45 -04:00
John Beard 27374c0aa3 Move file locking utilities to a separate file
The global ::LockFile() function is used in a single place, but it's in
common.h, so visible to all files.

The GetKicadLockFilePath function is used in only two places, and one of
them is LockFile.

This commit puts them both in a separate header, so they're only visible
to code using them.

The implementation of GetKicadLockFilePath is moved to lockfile.cpp,
where LockFile already was.

Also removed a (large) handful of wxT macros, which aren't needed any
more and make code less readable.
2017-03-23 09:23:45 -04:00
jean-pierre charras 4eeed8d04f Icons options menu: code rework 2017-03-03 14:18:25 +01:00
jean-pierre charras e7e972804a Make show/hide icons in menus a run time option, instead of compil option. 2017-03-02 15:45:54 +01:00
Dick Hollenbeck 7311f07eaf SWIG Improvements
*) Extend SWIG support deeper into the BOARD class.
*) Move swig *.i files into a directory identified for SWIG, in preparation
   for a parallel universe involving Phoenix's SIP.
*) Move swig files which will be common to both eeschema and pcbnew into
   common/swig.
*) Sketch out a "common" python module, and plan on dovetailing that into a
   libkicad_shared.{dll,so}
*) Add common/swig/ki_exceptions.i and define a macro HANDLE_EXCEPTIONS()
   which is to be applied to any function which needs C++ to python
   exception translation.
*) Move the test for SWIG tool into top level CMakeLists.txt file for use
   in all python modules beyond pcbnew, i.e. eeschema and common.
*) Add SWIG_MODULE_pcbnew_EXTRA_DEPS which generates a better Makefile, one
   which rebuilds the swig generated *.cxx file when one of its dependencies
   change.
*) Re-architect the board.i file so that it can be split into multiple *.i
   files easily.
*) Make some KIWAY from python progress, in preparation for Modular KiCad
   phase III.
2016-09-20 11:59:43 -04:00
ejs-ejs f8ae428428 Add Lithuanian language to language list menu. 2016-05-22 12:31:08 +02:00
jean-pierre charras ec096cc1d2 Fix an issue in LOCALE_IO class, used to switch to/back locale "C" when reading/writing files: the back to locale was broken, and created issues in countries using the ',' as fp separator, especially when the non default language was used.
It was reported in many bugs.
2016-05-10 09:11:09 +02:00
jean-pierre charras 95962cd2ba Very minor changes: minor coding style fixes, and remove a few local shadowed variables (mainly local variables having the same name in the same function) detected using " -Wshadow" gcc compil option ( No bug, just a better code readability ) 2016-04-12 17:50:42 +02:00
dwilches 1c19699a7c Fix Preferred Editor dialog (lp: 1558353)
The functions involved in the problem were PGM_BASE::GetEditorName and
EDA_BASE_FRAME::OnSelectPreferredEditor:

1) OnSelectPreferredEditor showed a dialog to allow the user selecting the
editor, but before that called GetEditorName to get the name of the current
editor (to show as a default in the choose file dialog).

2) The problem was when there was no editor, GetEditorName showed its own
dialog.

3) So the user was seeing first the dialog from (2) and then the dialog from
(1).

4) As GetEditorName is used in many other places the solution I did was to add
to it an optional parameter that tells it what to do if no editor is set. To
avoid modifying other code that relies on the current behaviour, this parameter
has a default value that causes to show the dialog. But now when
OnSelectPreferredEditor calls it, it passes the parameter that causes it to
return an empty string if no editor was set.

5) Also, I found a second bug while doing it which allowed in the first dialog
to select an unexistent file (the dialog was missing the wxFD_FILE_MUST_EXIST
flag).

6) Lastly, to avoid having duplicated code (the one that showed the same dialog
and that configured the wildcard was in two methods) I created a single
function that now both functions call: PGM_BASE::AskUserForPreferredEditor.
This way we also will have consistency in the behaviour of both dialogs and
there is a single place where it needs to be modified.
2016-03-17 16:59:35 -04:00
jean-pierre charras 8dc0a33cc7 Remove a old useless font file (the Cyrillic fonte is, since a long time, in the current font file) 2016-03-03 18:51:38 +01:00
jean-pierre charras 624c508dda Fix an issue relative to the env vars initializations on Linux: they are not initialized if the value contains any non ASCII7 char, and if the locale is not set.
The locale is now set before reading the env vars configuration.
2016-03-01 14:37:15 +01:00
jean-pierre charras d902c2716a Add Slovak entry in language menu. 2016-02-11 20:12:37 +01:00
Dick Hollenbeck f527b29e68 GitHub plugin: fix threading issues when libcurl is build against openssl.
* Dick Hollenbeck also contributed commit r6440.  I inadvertently forgot to set
  the Bazaar author tag before I committed it.  My apologies.
* Switch to static linking of libcurl and on linux and windows and also
  statically link in only required portions of openssl.
* Add the required thread locks which openssl needs.
* Remove the get curl version call from BASEFRAME since it pulls in curl and
  openssl into every derived wxFrame class link image.
* Remove curl function from PGM_BASE, switch to atexit() instead.  Anything in
  PGM_BASE made the singletops bigger.
* Tested on Linux, Windows, and OSX.
2016-01-14 10:17:13 -05:00
Chris Pavlina ee2752827a Remove old, empty header 2016-01-12 10:35:27 -05:00
Wayne Stambaugh 5c6c2a0661 GitHub plugin: fix potential multiple initialization of libcurl bug.
* Prevent libcurl from inadvertently being initialized twice.
* Dynamically load libcurl only when required.
* Reduce the number of worker threads when loading footprint libraries to
  prevent issues with the GitHub plugin.
2016-01-10 16:44:37 -05:00
Mark Roszko e47bc6883d Replace the avhttp library used by the github plugin with libcurl. 2015-12-21 15:30:33 -05:00
Mark Roszko 030c84d55d Use defined environment variables before falling back to DEFAULT_INSTALL_PATH. 2015-12-09 09:41:41 -05:00
Wayne Stambaugh a6a9d8eedf Default and most recently used path fixes. (fixes: 1494210)
* Rename Eda_FileSelector to EDA_FILE_SELECTOR.
* Add optional pointer to wxString to save the most recently used path to EDA_FILE_SELECTOR.
* Rename Eda_DirectorySelector to EDA_PATH_SELECTOR.
* Replace wxGetCwd() with wxStandardPaths::GetDocumentsDir().  This fixes the windows issue
  where wxGetCwd() returns the path where the executable files are located.
* Add code to handle most recently used path to EDA_BASE_FRAME.
* Fix string formatting error in kicad/files-io.cpp.
* Remove setting and restoring current working directory when launching GerbView.  Setting the CWD
  has no effect on the launched executable which starts with it's own CWD.
* Allow project path to be passed to GerbView when launched from KiCad.
* Note: this is a work in progress.  Do not expect every path and/or file selection dialog to properly
  update the most recently used path.  The correct solution to this problem requires a much more
  well though out solution which will not happen until after the next stable release.
2015-09-25 15:38:09 -04:00
jean-pierre charras 7b0d597f6d Fix some issues related to the footprint wizard frame:
* Mainly the wxDialog that was opened when the wizard is created is now no more created by the wizard frame CTOR. On some W.M. it created a serious issue related to the way Event Loops are managed. Now the user has to call it by the toolbar tool.
* 2 settings not saved in config are now saved.
* a few other minor enhancements
* better icon in  footprint wizard frame
Remove a few #define relative to the wxWidgets 2.8 version, no more supported.
2015-09-07 12:52:16 +02:00
Wayne Stambaugh 8482637c83 Default KISYSMOD and KISYS3DMOD path fixes. (fixes lp:1455472) 2015-07-20 20:46:58 -04:00
Chris Pavlina ada5274b28 Remove some unused variables. 2015-06-26 19:29:01 -04:00
Wayne Stambaugh 4274f2d5d5 Fix config.h default data install path assignment during configuration.
* Remove redundant definition of KICAD_DATA_PATH since DEFAULT_INSTALL_PATH
  was already defined.
* Use DEFAULT_INSTALL_PATH as the substitution for the default environment
  variable paths.
* Add option to define DEFAULT_INSTALL_PATH during CMake configuration with
  fall back to CMAKE_INSTALL_PREFIX if not not defined.
* Developer note: this change is primarily for package builders where
  CMAKE_INSTALL_PATH is the path where the package builder temporarily
  installs the build output before creating the package.  When building
  packages, DEFAULT_INSTALL_PATH should be set to the path where the
  package will be installed by default.
2015-04-08 13:27:04 -04:00
Wayne Stambaugh a6172bb72e Minor path configuration code fixes.
* Fix bug (and Coverity error) when deleting environment variable map entries.
* Remove debug logging code inadvertently left over from development.
2015-03-31 11:46:31 -04:00
Wayne Stambaugh 6aff74665a Fix build error cause by difference in wxRichMessageDialog between versions 3.0.1 and 3.0.2. 2015-03-30 10:52:54 -04:00
Wayne Stambaugh 45d0448bb9 Add path (environment variable) configuration dialog.
* Create new dialog to edit environment variables.
* Add helper class ENV_VAR_ITEM to manage environment variable values and
  if they were defined externally.
* A path configuration dialog access to KiCad, CvPcb, Pcbnew, and Footprint Editor
  window menus.
* Add validator for environment variables.
2015-03-29 17:22:53 -04:00
Bernhard Stegmaier 1e6c8cf88f Enable file extension filters on OSX file dialog. 2015-02-22 17:48:33 -05:00
Wayne Stambaugh bd199b894e Set default footprint library table and 3D model library environment variables. 2015-02-03 15:42:33 -05:00
Wayne Stambaugh 93b0a0831e Minor fixes and code cleaning.
* Check to see if image handler is already initialized to prevent warning
  on debug builds.
* Change LIB_PART destructor message output to use wxLogDebug for debugging
  on windows builds.
* Minor code cleaning and coding policy fixes.
2015-01-27 13:40:52 -05:00
Jose Ingnacio c9a1b239a6 Use XDG_CONFIG_DIR for lock file path on Linux.
* With fixes from Adam Wolf.
2015-01-07 10:04:57 -05:00
Bernhard Stegmaier f06bfe6d70 Commit the rest of the OSX build fixes missed in the previous commit. 2014-10-17 13:45:33 -04:00