fixe paths

This commit is contained in:
Franck Bourdonnec 2021-12-02 02:23:34 +01:00 committed by Seth Hillbrand
parent 863699f2d1
commit d877f04198
6 changed files with 50 additions and 9 deletions

View File

@ -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;

View File

@ -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 =

View File

@ -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

View File

@ -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
*/

View File

@ -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 =

View File

@ -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,
[&]()