Slight fixup to previous library browse change

This commit is contained in:
Marek Roszko 2021-01-28 07:30:59 -05:00
parent f0aa6aa442
commit 78dbcdcdb7
3 changed files with 8 additions and 6 deletions

View File

@ -888,12 +888,12 @@ wxString EDA_DRAW_FRAME::GetScreenDesc() const
bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
const wxString& wildcard, const wxString& ext,
bool isDirectory, bool aIsGlobal )
bool isDirectory, bool aIsGlobal, const wxString& aGlobalPath )
{
wxString prompt = doOpen ? _( "Select Library" ) : _( "New Library" );
aFilename.SetExt( ext );
wxString dir = PATHS::GetDefaultUserSymbolsPath();
wxString dir = aGlobalPath;
if( isDirectory && doOpen )
@ -903,7 +903,7 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
dir = Prj().GetProjectPath();
}
wxDirDialog dlg( this, prompt, Prj().GetProjectPath(),
wxDirDialog dlg( this, prompt, dir,
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
if( dlg.ShowModal() == wxID_CANCEL )

View File

@ -38,6 +38,7 @@
#include <symbol_library_manager.h>
#include <lib_text.h>
#include <symbol_editor_settings.h>
#include <paths.h>
#include <pgm_base.h>
#include <sch_draw_panel.h>
#include <sch_painter.h>
@ -803,7 +804,8 @@ bool SYMBOL_EDIT_FRAME::AddLibraryFile( bool aCreateNew )
if( !LibraryFileBrowser( !aCreateNew, fn, KiCadSymbolLibFileWildcard(),
KiCadSymbolLibFileExtension, false,
( libTable == &SYMBOL_LIB_TABLE::GetGlobalLibTable() ) ) )
( libTable == &SYMBOL_LIB_TABLE::GetGlobalLibTable() ),
PATHS::GetDefaultUserSymbolsPath() ) )
{
return false;
}

View File

@ -166,8 +166,8 @@ public:
* @return true for OK; false for Cancel.
*/
bool LibraryFileBrowser( bool doOpen, wxFileName& aFilename, const wxString& wildcard,
const wxString& ext, bool isDirectory = false,
bool aIsGlobal = false );
const wxString& ext, bool isDirectory = false, bool aIsGlobal = false,
const wxString& aGlobalPath = wxEmptyString );
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;