Commit a2b9241e authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix minor issue when loading a foorprint: if the footprint name has...

Pcbnew: fix minor issue when loading a foorprint: if the footprint name has lower case letters, the name was asked twice
parent 819589cf
...@@ -415,13 +415,7 @@ public: ...@@ -415,13 +415,7 @@ public:
* @return a pointer to the new module, or NULL * @return a pointer to the new module, or NULL
*/ */
MODULE* GetModuleLibrary( const wxString& aLibraryPath, const wxString& aFootprintName, MODULE* GetModuleLibrary( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aDisplayError ) bool aDisplayError );
{
if( aLibraryPath.IsEmpty() )
return loadFootprintFromLibraries( aFootprintName, aDisplayError );
else
return loadFootprintFromLibrary( aLibraryPath, aFootprintName, aDisplayError );
}
/** /**
* Function Select_1_Module_From_List * Function Select_1_Module_From_List
......
...@@ -175,8 +175,6 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& aLibrary, ...@@ -175,8 +175,6 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& aLibrary,
return NULL; return NULL;
} }
moduleName.MakeUpper();
if( dlg.IsKeyword() ) // Selection by keywords if( dlg.IsKeyword() ) // Selection by keywords
{ {
allowWildSeach = false; allowWildSeach = false;
...@@ -241,12 +239,12 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& aLibrary, ...@@ -241,12 +239,12 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& aLibrary,
module->SetPosition( curspos ); module->SetPosition( curspos );
// Put it on FRONT layer, // Put it on FRONT layer,
// (Can be stored on BACK layer if the lib is an archive built from a board) // (Can be stored flipped if the lib is an archive built from a board)
if( module->GetLayer() != LAYER_N_FRONT ) if( module->IsFlipped() )
module->Flip( module->m_Pos ); module->Flip( module->m_Pos );
// Put in in orientation 0, // Place it in orientation 0,
// even if it is not saved with with orientation 0 in lib // even if it is not saved with orientation 0 in lib
// (Can happen if the lib is an archive built from a board) // (Can happen if the lib is an archive built from a board)
Rotate_Module( NULL, module, 0, false ); Rotate_Module( NULL, module, 0, false );
...@@ -259,6 +257,25 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& aLibrary, ...@@ -259,6 +257,25 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& aLibrary,
return module; return module;
} }
/* scans active libraries to find and load aFootprintName.
* If found the module is added to the BOARD, just for good measure.
* aLibraryPath is the full/short name of the library.
* if empty, search in all libraries
* aFootprintName is the footprint to load
* aDisplayError = true to display an error message if any.
*
* return a pointer to the new module, or NULL
*/
MODULE* PCB_BASE_FRAME::GetModuleLibrary( const wxString& aLibraryPath,
const wxString& aFootprintName,
bool aDisplayError )
{
if( aLibraryPath.IsEmpty() )
return loadFootprintFromLibraries( aFootprintName, aDisplayError );
else
return loadFootprintFromLibrary( aLibraryPath, aFootprintName, aDisplayError );
}
/* loads aFootprintName from aLibraryPath. /* loads aFootprintName from aLibraryPath.
* If found the module is added to the BOARD, just for good measure. * If found the module is added to the BOARD, just for good measure.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment