diff --git a/common/paths.cpp b/common/paths.cpp index ec3e4bacec..c2e37a557e 100644 --- a/common/paths.cpp +++ b/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; diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index b7191f6d52..c18b1c8716 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/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(); - if( cfg->m_lastSymbolLibDir.IsEmpty() ) - cfg->m_lastSymbolLibDir = PATHS::GetDefaultUserSymbolsPath(); - m_lastProjectLibDir = m_project->GetProjectPath(); auto setupGrid = diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index bb16cafda9..f2e2570910 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -398,7 +399,7 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() : &m_LibViewPanel.show_pin_electrical_type, true ) ); m_params.emplace_back( new PARAM( "system.last_symbol_lib_dir", - &m_lastSymbolLibDir, "" ) ); + &m_lastSymbolLibDir, PATHS::GetStockSymbolsPath() ) ); // Migrations diff --git a/include/paths.h b/include/paths.h index 9c23e96741..4a2c72404e 100644 --- a/include/paths.h +++ b/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 */ diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 6532c33b60..486fb71292 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/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(); - if( cfg->m_lastFootprintLibDir.IsEmpty() ) - cfg->m_lastFootprintLibDir = PATHS::GetDefaultUserFootprintsPath(); - m_lastProjectLibDir = m_projectBasePath; auto setupGrid = diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 00d70df057..278e47b6c5 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -511,10 +512,10 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() addParamsForWindow( &m_FootprintWizard, "footprint_wizard" ); m_params.emplace_back( new PARAM( "system.last_footprint_lib_dir", - &m_lastFootprintLibDir, "" ) ); + &m_lastFootprintLibDir, PATHS::GetStockFootprintsPath() ) ); m_params.emplace_back( new PARAM( "system.last_footprint3d_dir", - &m_lastFootprint3dDir, "" ) ); + &m_lastFootprint3dDir, PATHS::GetStock3dmodelsPath() ) ); registerMigration( 0, 1, [&]()