Show KISYSMOD in DIALOG_FP_LIB_TABLE even if it has not been referenced by a URI.
This commit is contained in:
parent
7196e7bc98
commit
593aa2dc12
|
@ -51,6 +51,7 @@
|
|||
#include <online_help.h>
|
||||
#include <gestfich.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <fp_lib_table.h>
|
||||
|
||||
|
||||
static const wxChar* CommonConfigPath = wxT( "kicad_common" );
|
||||
|
@ -1161,18 +1162,19 @@ bool EDA_APP::LockFile( const wxString& fileName )
|
|||
bool EDA_APP::SetFootprintLibTablePath()
|
||||
{
|
||||
wxString path;
|
||||
wxString kisysmod = FP_LIB_TABLE::GlobalPathEnvVariableName();
|
||||
|
||||
// Set the KISYSMOD environment variable for the current process if it is not already
|
||||
// defined in the user's environment. This is required to expand the global footprint
|
||||
// library table paths.
|
||||
if( wxGetEnv( wxT( "KISYSMOD" ), &path ) && wxFileName::DirExists( path ) )
|
||||
if( wxGetEnv( kisysmod, &path ) && wxFileName::DirExists( path ) )
|
||||
return true;
|
||||
|
||||
// Set the KISYSMOD environment variable to the path defined in the user's configuration
|
||||
// if it is defined and the path exists.
|
||||
if( m_commonSettings->Read( kicadFpLibPath, &path ) && wxFileName::DirExists( path ) )
|
||||
{
|
||||
wxSetEnv( wxT( "KISYSMOD" ), path );
|
||||
wxSetEnv( kisysmod, path );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1198,7 +1200,7 @@ bool EDA_APP::SetFootprintLibTablePath()
|
|||
|
||||
if( modFileCount != 0 )
|
||||
{
|
||||
wxSetEnv( wxT( "KISYSMOD" ), bestPath );
|
||||
wxSetEnv( kisysmod, bestPath );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -734,6 +734,12 @@ const wxString FP_LIB_TABLE::ProjectPathEnvVariableName()
|
|||
}
|
||||
|
||||
|
||||
const wxString FP_LIB_TABLE::GlobalPathEnvVariableName()
|
||||
{
|
||||
return wxT( "KISYSMOD" );
|
||||
}
|
||||
|
||||
|
||||
wxString FP_LIB_TABLE::GetProjectFileName( const wxFileName& aPath )
|
||||
{
|
||||
wxFileName fn = aPath;
|
||||
|
|
|
@ -574,6 +574,16 @@ public:
|
|||
*/
|
||||
static const wxString ProjectPathEnvVariableName();
|
||||
|
||||
/**
|
||||
* Function GlobalPathEnvVarVariableName
|
||||
* returns the name of the environment variable used to hold the directory of
|
||||
* locally installed "KiCad sponsored" system footprint libraries. These can
|
||||
* be either legacy or pretty format. The only thing special about this
|
||||
* particular environment variable is that it is set automatically by
|
||||
* KiCad on program startup, <b>iff</b> it is not set already in the environment.
|
||||
*/
|
||||
static const wxString GlobalPathEnvVariableName();
|
||||
|
||||
static wxString GetProjectFileName( const wxFileName& aPath );
|
||||
|
||||
/**
|
||||
|
|
|
@ -696,6 +696,7 @@ private:
|
|||
// not used yet. It is automatically set by KiCad to the directory holding
|
||||
// the current project.
|
||||
unique.insert( FP_LIB_TABLE::ProjectPathEnvVariableName() );
|
||||
unique.insert( FP_LIB_TABLE::GlobalPathEnvVariableName() );
|
||||
|
||||
m_path_subs_grid->AppendRows( unique.size() );
|
||||
|
||||
|
|
Loading…
Reference in New Issue