7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 15:01:41 +00:00

design blocks: use correct global library path in dialog

This commit is contained in:
Mike Williams 2024-09-09 15:13:05 -04:00
parent b175c0fc39
commit 0a5de3510d
2 changed files with 5 additions and 5 deletions

View File

@ -270,8 +270,6 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath,
wxString dbSchPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::KiCadSchematicFileExtension;
wxString dbMetadataPath = dbPath + aDesignBlockName + wxT( "." ) + FILEEXT::JsonFileExtension;
// Library name needs to be empty for when we fill it in with the correct library nickname
// one layer above
newDB->SetLibId( LIB_ID( wxEmptyString, aDesignBlockName ) );
@ -364,7 +362,6 @@ void DESIGN_BLOCK_IO::DesignBlockDelete( const wxString& aLibPath, const wxStrin
wxFileName dbDir = wxFileName( aLibPath + wxFileName::GetPathSeparator() + aDesignBlockName
+ wxT( "." ) + FILEEXT::KiCadDesignBlockPathExtension );
if( !dbDir.DirExists() )
{
THROW_IO_ERROR(

View File

@ -97,10 +97,13 @@ wxString SCH_EDIT_FRAME::createNewDesignBlockLibrary( const wxString& aL
if( aTable == nullptr )
return wxEmptyString;
wxString initialPath = aProposedName.IsEmpty() ? Prj().GetProjectPath() : aProposedName;
wxFileName fn;
bool doAdd = false;
bool isGlobal = ( aTable == &GDesignBlockTable );
wxString initialPath = aProposedName;
if( initialPath.IsEmpty() )
initialPath = isGlobal ? PATHS::GetDefaultUserDesignBlocksPath() : Prj().GetProjectPath();
if( aLibName.IsEmpty() )
{
@ -108,7 +111,7 @@ wxString SCH_EDIT_FRAME::createNewDesignBlockLibrary( const wxString& aL
if( !LibraryFileBrowser( false, fn, FILEEXT::KiCadDesignBlockLibPathWildcard(),
FILEEXT::KiCadDesignBlockLibPathExtension, false, isGlobal,
PATHS::GetDefaultUserFootprintsPath() ) )
initialPath ) )
{
return wxEmptyString;
}