Corrected "Add footprint library" dialog file filters
Fixes: lp:1773969 * https://bugs.launchpad.net/kicad/+bug/1773969
This commit is contained in:
parent
dfa9175209
commit
d2436e7478
|
@ -61,10 +61,10 @@ static const struct
|
||||||
} fileFilters[FILTER_COUNT] =
|
} fileFilters[FILTER_COUNT] =
|
||||||
{
|
{
|
||||||
// wxGenericDirCtrl does not handle regexes in wildcards
|
// wxGenericDirCtrl does not handle regexes in wildcards
|
||||||
{ "KiCad (folder with .kicad_mod files)", "kicad_mod", false, IO_MGR::KICAD_SEXP },
|
{ "KiCad (folder with .kicad_mod files)", "", false, IO_MGR::KICAD_SEXP },
|
||||||
{ "Eagle 6.x (*.lbr)", "lbr", true, IO_MGR::EAGLE },
|
{ "Eagle 6.x (*.lbr)", "lbr", true, IO_MGR::EAGLE },
|
||||||
{ "KiCad legacy (*.mod)", "mod", true, IO_MGR::LEGACY },
|
{ "KiCad legacy (*.mod)", "mod", true, IO_MGR::LEGACY },
|
||||||
{ "Geda (folder with *.fp files)", "fp", false, IO_MGR::GEDA_PCB },
|
{ "Geda (folder with *.fp files)", "", false, IO_MGR::GEDA_PCB },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,18 +72,25 @@ static const struct
|
||||||
static wxString getFilterString()
|
static wxString getFilterString()
|
||||||
{
|
{
|
||||||
wxString filterAll = _( "All supported library formats|" );
|
wxString filterAll = _( "All supported library formats|" );
|
||||||
|
bool firstFilterAll = true;
|
||||||
wxString filter;
|
wxString filter;
|
||||||
|
|
||||||
for( int i = 0; i < FILTER_COUNT; ++i )
|
for( int i = 0; i < FILTER_COUNT; ++i )
|
||||||
{
|
{
|
||||||
// "All supported formats" filter
|
if( fileFilters[i].m_IsFile )
|
||||||
if( i != 0 )
|
{
|
||||||
filterAll += ";";
|
// "All supported formats" filter
|
||||||
|
if( firstFilterAll )
|
||||||
|
firstFilterAll = false;
|
||||||
|
else
|
||||||
|
filterAll += ";";
|
||||||
|
|
||||||
filterAll += "*." + fileFilters[i].m_Extension;
|
wxASSERT( !fileFilters[i].m_Extension.IsEmpty() );
|
||||||
|
filterAll += "*." + fileFilters[i].m_Extension;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Rest of the filter string
|
// Individual filter strings
|
||||||
filter += "|" + fileFilters[i].m_Description +
|
filter += "|" + fileFilters[i].m_Description +
|
||||||
"|" + ( fileFilters[i].m_IsFile ? "*." + fileFilters[i].m_Extension : "" );
|
"|" + ( fileFilters[i].m_IsFile ? "*." + fileFilters[i].m_Extension : "" );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue