Browse Source

fixe paths

6.0.7
Franck Bourdonnec 4 years ago
committed by Seth Hillbrand
parent
commit
d877f04198
  1. 30
      common/paths.cpp
  2. 3
      eeschema/dialogs/panel_sym_lib_table.cpp
  3. 3
      eeschema/eeschema_settings.cpp
  4. 15
      include/paths.h
  5. 3
      pcbnew/dialogs/panel_fp_lib_table.cpp
  6. 5
      pcbnew/pcbnew_settings.cpp

30
common/paths.cpp

@ -199,6 +199,36 @@ wxString PATHS::GetStockEDALibraryPath()
}
wxString PATHS::GetStockSymbolsPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/symbols" );
return path;
}
wxString PATHS::GetStockFootprintsPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/footprints" );
return path;
}
wxString PATHS::GetStock3dmodelsPath()
{
wxString path;
path = GetStockDataPath() + wxT( "/3dmodels" );
return path;
}
wxString PATHS::GetStockScriptingPath()
{
wxString path;

3
eeschema/dialogs/panel_sym_lib_table.cpp

@ -218,9 +218,6 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, P
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
if( cfg->m_lastSymbolLibDir.IsEmpty() )
cfg->m_lastSymbolLibDir = PATHS::GetDefaultUserSymbolsPath();
m_lastProjectLibDir = m_project->GetProjectPath();
auto setupGrid =

3
eeschema/eeschema_settings.cpp

@ -29,6 +29,7 @@
#include <symbol_editor_settings.h>
#include <macros.h>
#include <pgm_base.h>
#include <paths.h>
#include <settings/common_settings.h>
#include <settings/json_settings_internals.h>
#include <settings/parameters.h>
@ -398,7 +399,7 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
&m_LibViewPanel.show_pin_electrical_type, true ) );
m_params.emplace_back( new PARAM<wxString>( "system.last_symbol_lib_dir",
&m_lastSymbolLibDir, "" ) );
&m_lastSymbolLibDir, PATHS::GetStockSymbolsPath() ) );
// Migrations

15
include/paths.h

@ -86,6 +86,21 @@ public:
*/
static wxString GetDefault3rdPartyPath();
/**
* Gets the stock (install) symbols path
*/
static wxString GetStockSymbolsPath();
/**
* Gets the stock (install) footprints path
*/
static wxString GetStockFootprintsPath();
/**
* Gets the stock (install) 3dmodels path
*/
static wxString GetStock3dmodelsPath();
/**
* Gets the stock (install) scripting path
*/

3
pcbnew/dialogs/panel_fp_lib_table.cpp

@ -377,9 +377,6 @@ PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent,
*/
PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
if( cfg->m_lastFootprintLibDir.IsEmpty() )
cfg->m_lastFootprintLibDir = PATHS::GetDefaultUserFootprintsPath();
m_lastProjectLibDir = m_projectBasePath;
auto setupGrid =

5
pcbnew/pcbnew_settings.cpp

@ -28,6 +28,7 @@
#include <layer_ids.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>
#include <paths.h>
#include <router/pns_routing_settings.h>
#include <settings/common_settings.h>
#include <settings/nested_settings.h>
@ -511,10 +512,10 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
addParamsForWindow( &m_FootprintWizard, "footprint_wizard" );
m_params.emplace_back( new PARAM<wxString>( "system.last_footprint_lib_dir",
&m_lastFootprintLibDir, "" ) );
&m_lastFootprintLibDir, PATHS::GetStockFootprintsPath() ) );
m_params.emplace_back( new PARAM<wxString>( "system.last_footprint3d_dir",
&m_lastFootprint3dDir, "" ) );
&m_lastFootprint3dDir, PATHS::GetStock3dmodelsPath() ) );
registerMigration( 0, 1,
[&]()

Loading…
Cancel
Save