Can't use wxDD_MULTIPLE before 3.1.4.
Fixes https://gitlab.com/kicad/code/kicad/issues/8465
This commit is contained in:
parent
ee00d8386f
commit
9554aaee7f
|
@ -822,6 +822,7 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if wxCHECK_VERSION( 3, 1, 4 ) // 3.1.4 required for wxDD_MULTIPLE
|
||||||
wxDirDialog dlg( nullptr, title, openDir,
|
wxDirDialog dlg( nullptr, title, openDir,
|
||||||
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_MULTIPLE );
|
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_MULTIPLE );
|
||||||
|
|
||||||
|
@ -831,12 +832,19 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dlg.GetPaths( files );
|
dlg.GetPaths( files );
|
||||||
|
#else
|
||||||
|
wxDirDialog dlg( nullptr, title, openDir,
|
||||||
|
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||||
|
|
||||||
|
int result = dlg.ShowModal();
|
||||||
|
|
||||||
|
if( result == wxID_CANCEL )
|
||||||
|
return;
|
||||||
|
|
||||||
// is there a file extension configured to hunt out their containing folders?
|
// is there a file extension configured to hunt out their containing folders?
|
||||||
if( files.GetCount() == 1 && fileType.m_FolderSearchExtension != "" )
|
if( fileType.m_FolderSearchExtension != "" )
|
||||||
{
|
{
|
||||||
wxDir rootDir( files.front() );
|
wxDir rootDir( dlg.GetPath() );
|
||||||
files.clear();
|
|
||||||
|
|
||||||
LIBRARY_TRAVERSER traverser( fileType.m_FolderSearchExtension, rootDir.GetName() );
|
LIBRARY_TRAVERSER traverser( fileType.m_FolderSearchExtension, rootDir.GetName() );
|
||||||
rootDir.Traverse( traverser );
|
rootDir.Traverse( traverser );
|
||||||
|
@ -856,6 +864,11 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
detailedMsg );
|
detailedMsg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
files.Add( dlg.GetPath() );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !files.IsEmpty() )
|
if( !files.IsEmpty() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue